file-type

Kotlin与Micronaut框架实现Clean Architecture项目

ZIP文件

下载需积分: 5 | 92KB | 更新于2025-02-19 | 66 浏览量 | 0 下载量 举报 收藏
download 立即下载
### Kotlin清洁架构项目知识点解析 #### Kotlin介绍 Kotlin是一种开源的静态类型编程语言,主要运行在Java虚拟机(JVM)上,也可以编译成JavaScript源代码或使用LLVM编译器编译成原生代码。它是由JetBrains公司设计,于2011年首次发布。Kotlin最初目的是为了提供一种更加简洁、安全、表达力丰富的语言来替代Java,并且可以与Java代码互操作,这意味着Kotlin可以使用现有的Java库,并且允许平滑地迁移到Kotlin。 #### Clean Architecture简介 Clean Architecture(清洁架构)是由著名软件工程师Robert C. Martin(Uncle Bob)提出的一种软件设计方法论。它的核心理念是将软件分层,使得依赖关系只指向内层,确保核心业务逻辑与外部框架或数据库技术的解耦。这种架构风格支持软件的可测试性、可维护性、可移植性,通常包含以下层次: 1. **实体(Entities)** - 应用程序的业务规则。 2. **用例(Use Cases)** - 编排实体来实现具体的业务用例。 3. **接口适配器(Interface Adapters)** - 负责将外部数据转换为内部格式(如控制器和视图模型),反之亦然。 4. **框架和驱动(Frameworks & Drivers)** - 最外层,包括用户界面、数据库、Web服务器等。 #### Micronaut Framework Micronaut是一个基于Java的开源框架,专门用于构建微服务和云原生应用程序。它在设计上优化了内存消耗,减少了启动时间,并且与Netty和GraalVM进行了集成优化,支持原生镜像的构建,使得应用能够快速启动并具有高性能。 #### 项目结构 根据给出的信息,这个“kotlin-clean-arch”项目是基于Kotlin语言和Micronaut框架,采用Clean Architecture设计风格。项目结构包含以下主要组件: - **配置(Configuration)**:负责整个应用的配置管理。 - **核(Core)**:核心的业务逻辑层。 - **数据提供者(Dataproviders)**:负责数据访问和数据库的交互。 - **入口点(EntryPoints)**:应用程序的访问点,例如REST API、gRPC接口、Kafka消费者等。 #### 构建与部署 项目的构建和部署需要遵循以下步骤: 1. **先决条件**:需要安装JDK 11或更高版本,并且应该熟悉Docker和Docker Compose的使用。 2. **构建**:通过在命令行中执行`gradle clean build`来构建项目。这会清理之前的构建结果,并对项目进行编译、测试和打包。 3. **建立基础架构**:使用Docker Compose来启动和管理依赖的基础架构组件,如数据库和Kafka消息队列。命令是在项目根目录下执行`docker-compose up -d`。 4. **启动应用程序**:项目中有一个应用程序主类,位于配置包中,可以在集成开发环境(IDE)中直接运行这个类来启动应用程序。 #### 包装结构 - **entrypoints**:包含不同类型的入口点,例如REST API和gRPC接口,以及Kafka消费者的实现。 - **dataproviders**:负责数据交互的部分,可能包含与数据库交互的代码。 #### 测试 在软件开发中,测试是至关重要的一步。根据描述,项目中的测试涵盖了以下几类: - **单元测试(Unit Tests)**:对单个组件(类、方法)的测试,确保其按照预期工作。 - **集成测试(Integration Tests)**:确保不同组件之间交互的测试。 - **模拟(Mocking)**:模拟外部依赖(如数据库、外部服务)以便于独立地测试代码。 - **断言(Assertion)**:用于验证测试结果是否符合预期。 - **变异测试(Mutation Testing)**:一种测试方法,用于改进测试套件的质量,通过修改代码来生成变异体,并检查测试是否能够捕捉到这些变异。 #### 总结 这个“kotlin-clean-arch”项目展示了如何利用Kotlin语言和Micronaut框架实现Clean Architecture。项目的模块化结构有助于开发者理解如何将应用分离为独立、可测试的组件,同时也方便未来可能的扩展和维护。通过Docker Compose来启动和管理基础架构的方式,也体现了现代云原生应用开发的趋势。此外,项目还涉及到了全面的测试策略,这有助于确保代码质量,减少生产环境中的缺陷。通过遵循这个项目的设计和实践,开发团队能够构建出高效、可维护、可扩展的应用程序。

相关推荐

filetype

releaseRuntimeClasspath - Resolved configuration for runtime for variant: release +--- androidx.appcompat:appcompat:1.6.1 | +--- androidx.activity:activity:1.6.0 -> 1.8.0 | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 | | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.core:core:1.8.0 -> 1.9.0 | | | +--- androidx.annotation:annotation:1.2.0 -> 1.3.0 | | | +--- androidx.annotation:annotation-experimental:1.3.0 | | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.10 -> 1.8.22 | | | | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 | | | | \--- org.jetbrains:annotations:13.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.concurrent:concurrent-futures:1.0.0 -> 1.1.0 | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | \--- com.google.guava:listenablefuture:1.0 | | | +--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.6.1 | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | +--- androidx.arch.core:core-common:2.2.0 | | | | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | +--- androidx.arch.core:core-runtime:2.2.0 | | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | | \--- androidx.arch.core:core-common:2.2.0 (*) | | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 | | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 | | | | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 | | | | | | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4 | | | | | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4 | | | | | | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (c) | | | | | | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 (c) | | | | | | | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4 (c) | | | | | | | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 -> 1.8.22 | | | | | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 (*) | | | | | | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22 | | | | | | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 (*) | | | | | | | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21 -> 1.8.22 | | | | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4 (*) | | | | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 -> 1.8.22 (*) | | | | | +--- androidx.lifecycle:lifecycle-livedata:2.6.1 (c) | | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (c) | | | | | +--- androidx.lifecycle:lifecycle-process:2.6.1 (c) | | | | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (c) | | | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (c) | | | | | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 (c) | | | | +--- androidx.profileinstaller:profileinstaller:1.3.0 | | | | | +--- androidx.annotation:annotation:1.2.0 -> 1.3.0 | | | | | +--- androidx.concurrent:concurrent-futures:1.1.0 (*) | | | | | +--- androidx.startup:startup-runtime:1.1.1 | | | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | | | \--- androidx.tracing:tracing:1.0.0 | | | | | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | | \--- com.google.guava:listenablefuture:1.0 | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-process:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 (c) | | | | \--- androidx.lifecycle:lifecycle-livedata:2.6.1 (c) | | | +--- androidx.versionedparcelable:versionedparcelable:1.1.1 | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | \--- androidx.core:core-ktx:1.9.0 (c) | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (*) | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-process:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 (c) | | | \--- androidx.lifecycle:lifecycle-livedata:2.6.1 (c) | | +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 | | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | | | +--- androidx.core:core-ktx:1.2.0 -> 1.9.0 | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | +--- androidx.core:core:1.9.0 (*) | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.10 -> 1.8.22 (*) | | | | \--- androidx.core:core:1.9.0 (c) | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 | | | | +--- androidx.arch.core:core-common:2.1.0 -> 2.2.0 (*) | | | | +--- androidx.arch.core:core-runtime:2.1.0 -> 2.2.0 (*) | | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (*) | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-livedata:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-process:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (c) | | | | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (*) | | | +--- androidx.savedstate:savedstate:1.2.1 | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | | +--- androidx.arch.core:core-common:2.1.0 -> 2.2.0 (*) | | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (*) | | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (*) | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-process:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (c) | | | \--- androidx.lifecycle:lifecycle-livedata:2.6.1 (c) | | +--- androidx.profileinstaller:profileinstaller:1.3.0 (*) | | +--- androidx.savedstate:savedstate:1.2.1 (*) | | +--- androidx.tracing:tracing:1.0.0 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 (*) | +--- androidx.annotation:annotation:1.3.0 | +--- androidx.appcompat:appcompat-resources:1.6.1 | | +--- androidx.annotation:annotation:1.2.0 -> 1.3.0 | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | +--- androidx.core:core:1.6.0 -> 1.9.0 (*) | | +--- androidx.vectordrawable:vectordrawable:1.1.0 | | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | | +--- androidx.core:core:1.1.0 -> 1.9.0 (*) | | | \--- androidx.collection:collection:1.1.0 (*) | | +--- androidx.vectordrawable:vectordrawable-animated:1.1.0 | | | +--- androidx.vectordrawable:vectordrawable:1.1.0 (*) | | | +--- androidx.interpolator:interpolator:1.0.0 | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | | | \--- androidx.collection:collection:1.1.0 (*) | | \--- androidx.appcompat:appcompat:1.6.1 (c) | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | +--- androidx.core:core:1.9.0 (*) | +--- androidx.core:core-ktx:1.8.0 -> 1.9.0 (*) | +--- androidx.cursoradapter:cursoradapter:1.0.0 | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | +--- androidx.drawerlayout:drawerlayout:1.0.0 -> 1.1.1 | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.core:core:1.2.0 -> 1.9.0 (*) | | \--- androidx.customview:customview:1.1.0 | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.core:core:1.3.0 -> 1.9.0 (*) | | \--- androidx.collection:collection:1.1.0 (*) | +--- androidx.emoji2:emoji2:1.2.0 | | +--- androidx.annotation:annotation:1.2.0 -> 1.3.0 | | +--- androidx.collection:collection:1.1.0 (*) | | +--- androidx.core:core:1.3.0 -> 1.9.0 (*) | | +--- androidx.lifecycle:lifecycle-process:2.4.1 -> 2.6.1 | | | +--- androidx.annotation:annotation:1.2.0 -> 1.3.0 | | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (*) | | | +--- androidx.startup:startup-runtime:1.1.1 (*) | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-livedata:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (c) | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (c) | | | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 (c) | | \--- androidx.startup:startup-runtime:1.0.0 -> 1.1.1 (*) | +--- androidx.emoji2:emoji2-views-helper:1.2.0 | | +--- androidx.collection:collection:1.1.0 (*) | | +--- androidx.core:core:1.3.0 -> 1.9.0 (*) | | \--- androidx.emoji2:emoji2:1.2.0 (*) | +--- androidx.fragment:fragment:1.3.6 | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.core:core:1.2.0 -> 1.9.0 (*) | | +--- androidx.collection:collection:1.1.0 (*) | | +--- androidx.viewpager:viewpager:1.0.0 | | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | | | +--- androidx.core:core:1.0.0 -> 1.9.0 (*) | | | \--- androidx.customview:customview:1.0.0 -> 1.1.0 (*) | | +--- androidx.loader:loader:1.0.0 | | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | | | +--- androidx.core:core:1.0.0 -> 1.9.0 (*) | | | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.1 | | | | +--- androidx.arch.core:core-common:2.1.0 -> 2.2.0 (*) | | | | +--- androidx.arch.core:core-runtime:2.1.0 -> 2.2.0 (*) | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (*) | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.8.22 (*) | | | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-process:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (c) | | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (c) | | | | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 (c) | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.6.1 (*) | | +--- androidx.activity:activity:1.2.4 -> 1.8.0 (*) | | +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1 -> 2.6.1 (*) | | +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.6.1 (*) | | +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 -> 2.6.1 (*) | | +--- androidx.savedstate:savedstate:1.1.0 -> 1.2.1 (*) | | \--- androidx.annotation:annotation-experimental:1.0.0 -> 1.3.0 (*) | +--- androidx.lifecycle:lifecycle-runtime:2.5.1 -> 2.6.1 (*) | +--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 -> 2.6.1 (*) | +--- androidx.resourceinspection:resourceinspection-annotation:1.0.1 | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | +--- androidx.savedstate:savedstate:1.2.0 -> 1.2.1 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.10 -> 1.8.22 (*) | \--- androidx.appcompat:appcompat-resources:1.6.1 (c) +--- com.google.android.material:material:1.10.0 -> 1.11.0 | +--- org.jetbrains.kotlin:kotlin-bom:1.8.22 | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 (c) | | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 (c) | | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22 (c) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22 (c) | +--- com.google.errorprone:error_prone_annotations:2.15.0 | +--- androidx.activity:activity:1.8.0 (*) | +--- androidx.annotation:annotation:1.2.0 -> 1.3.0 | +--- androidx.appcompat:appcompat:1.6.1 (*) | +--- androidx.cardview:cardview:1.0.0 | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | +--- androidx.coordinatorlayout:coordinatorlayout:1.1.0 | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.core:core:1.1.0 -> 1.9.0 (*) | | +--- androidx.customview:customview:1.0.0 -> 1.1.0 (*) | | \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | +--- androidx.constraintlayout:constraintlayout:2.0.1 -> 2.1.4 | | +--- androidx.appcompat:appcompat:1.2.0 -> 1.6.1 (*) | | +--- androidx.core:core:1.3.2 -> 1.9.0 (*) | | \--- androidx.constraintlayout:constraintlayout-core:1.0.4 | +--- androidx.core:core:1.6.0 -> 1.9.0 (*) | +--- androidx.drawerlayout:drawerlayout:1.1.1 (*) | +--- androidx.dynamicanimation:dynamicanimation:1.0.0 | | +--- androidx.core:core:1.0.0 -> 1.9.0 (*) | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | \--- androidx.legacy:legacy-support-core-utils:1.0.0 | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | | +--- androidx.core:core:1.0.0 -> 1.9.0 (*) | | +--- androidx.documentfile:documentfile:1.0.0 | | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | | +--- androidx.loader:loader:1.0.0 (*) | | +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 | | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | | \--- androidx.print:print:1.0.0 | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0 | +--- androidx.annotation:annotation-experimental:1.0.0 -> 1.3.0 (*) | +--- androidx.fragment:fragment:1.2.5 -> 1.3.6 (*) | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.1 (*) | +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.core:core:1.1.0 -> 1.9.0 (*) | | +--- androidx.customview:customview:1.0.0 -> 1.1.0 (*) | | \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | +--- androidx.resourceinspection:resourceinspection-annotation:1.0.1 (*) | +--- androidx.transition:transition:1.2.0 | | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | | +--- androidx.core:core:1.0.1 -> 1.9.0 (*) | | \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | +--- androidx.vectordrawable:vectordrawable:1.1.0 (*) | \--- androidx.viewpager2:viewpager2:1.0.0 | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0 | +--- androidx.fragment:fragment:1.1.0 -> 1.3.6 (*) | +--- androidx.recyclerview:recyclerview:1.1.0 (*) | +--- androidx.core:core:1.1.0 -> 1.9.0 (*) | \--- androidx.collection:collection:1.1.0 (*) +--- com.google.android.material:material:1.11.0 (*) +--- androidx.activity:activity:1.8.0 (*) \--- androidx.constraintlayout:constraintlayout:2.1.4 (*) (c) - A dependency constraint, not a dependency. The dependency affected by the constraint occurs elsewhere in the tree. (*) - Indicates repeated occurrences of a transitive dependency subtree. Gradle expands transitive dependency subtrees only once per project; repeat occurrences only display the root of the subtree, followed by this annotation. A web-based, searchable dependency report is available by adding the --scan option. BUILD SUCCESSFUL in 20s 1 actionable task: 1 executed

filetype

[versions] ######## Codes denpendency versions ######## # Build plugins: androidGradlePlugin = "8.2.2" oapm = "3.0.8.1" obuild = "1.7.0" protobufPlugin = "0.9.4" androidToolsR8 = "8.2.42" # Kotlin libs: kotlin = "1.9.22" kotlinCoroutines = "1.7.3" kotlinSerializationJson = "1.6.2" koin = "3.4.3" koinCoroutines = "3.4.1" # Android libs: chips = "1.0.0" # Androidx libs: coreKtx = "1.12.0" appcompat = "1.6.1" room = "2.4.3" pagingKtx = "3.2.1" fragmentKtx = "1.4.1" lifecycle = "2.6.2" recyclerview = "1.2.1" constraintlayout = "2.1.3" # Google libs: material = "1.11.0" protobuf = "3.23.0" protobufProtoc = "3.10.0" gson = "2.10.1" # Oplus libs: addon = "15.0.34.17-preview" apiAdapter = "13.3.5" couiSupport = "15.0.28" couiMaterialcolor = "1.0.1" olint = "1.2.5" trackinglib = "1.0.3" feedbackCdp = "15.0.4" feedbackEnvDomestic = "1.0.1" synergysdk = "14.1.10" castsdk = "4.1.4" oplusSettings = "2.1.1" oapsSdkDownload = "3.1.2" sauaar = "3.0.3" sysapi = "13.0.6" push = "3.5.3" #dmpSdk = "2.0.0-betafab8c2d-SNAPSHOT" dmpSdk = "2.1.1" dmpSdkExport = "2.3.0-20240903.080150-1" aiunit = "1.1.0" stdid = "1.0.8" oworkSync = "1.0.2-beta" appfeature = "1.0.2" oplusTrack = "3.0.13" oplusCloudconfig = "3.4.8" oplusCloudconfigTest = "1.0.0" heytapCloudconfigTest = "0.0.7" pantanalCardSeedling = "3.0.1" oplusBackup = "2.0.0" onetSdk = "14.4.60" dfsSdk = "1.0.1-alpha62bb292-SNAPSHOT" ptcSdk = "1.0.1-alpha7066ba4-SNAPSHOT" accessorySdk = "3.0.35" oplusTBLPlayer = "1.7.9PRO" remoteControlSdk = "15.0.0-alphacd8fa13-SNAPSHOT" workmanagerversion = "2.7.0" # HeyTap libs: addonAdapter = "11.2.5" cloudDrive = "1.1.8" cloudBase = "1.1.3" ucAccountSDK = "2.5.1" heytapTrack = "1.1.3.1" heytapNearxUtils = "1.0.8.security" heytapProtobuff = "2.2.0.222" heytapCloudconfig = "2.4.2.9" adOverseas = "2.24.0" tapHttpVerSion = "4.9.3.8.1" heytapCloudkitCommonVersion="2.2.10" heytapCloudkitSyncVersion="2.2.10" # 3rd parts libs: findbugs = "3.0.2" okio = "3.7.0" okhttp3 = "4.12.0" glide = "4.16.0" wechatSdk = "6.8.24" retrofit2 = "2.9.0" retrofit2Protobuf = "2.9.0" commonsCompress = "1.21" commonsLogging = "1.3.0" commonsIo = "2.15.1" commonsCodec = "1.6" zip4j = "2.11.5" unrar = "1.0.0" gnuCrypto = "2.0.1" tika = "2.8.0" cryptography = "2.1.1" slf4j = "2.0.10" rxjava = "3.1.8" wpsSdkSnapshot = "20210524-SNAPSHOT" maxVersion = "12.6.1" googleAdapter = "23.6.0.1" facebookAdapter = "6.18.0.1" mytargetAdapter = "5.27.0.0" bytedanceAdapter = "6.4.0.3.0" # FileManager inner libs: fileManagerThumbnail = "15.12.34-alpha7640294-SNAPSHOT" fileManagerThumbnailWpsCompat = "15.11.0-beta1a8f9af-SNAPSHOT" fileManagerSimulateClick = "15.11.4-beta7146442-SNAPSHOT" fileManagerDragDrop = "15.11.0-beta1a8f9af-SNAPSHOT" ######## Unit test denpendency versions ######## # Base test libs: jacoco = "0.8.7" junit = "4.13.2" mockito = "3.11.2" mockk = "1.12.1" kotlinCoroutinesTest = "1.6.0" robolectric = "4.10" powermock = "2.0.9" # Androidx test libs: androidxCoreTest = "2.1.0" # 3rd parts libs: json = "20231013" # riskctrl riskctrl="1.1.6" ######## AndroidTest denpendency versions ######## # Androidx test libs: espresso = "3.5.1" testRunner = "1.4.0" testRules = "1.4.0" testTruth = "1.4.0" androidxJunit = "1.1.5" uiautomator = "2.2.0" roomTesting = "2.2.5" # Oplus test libs: oTestLib = "1.4.1" oTestCoverage = "2.0.6@aar" [libraries] ######## Codes denpendencies ######## # Build plugins: android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" } kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } oplus-oapm-plugin = { module = "com.oppo.test:oapm-perf", version.ref = "oapm" } oplus-build-plugin = { module = "com.inno.buildplugin:build-plugin", version.ref = "obuild" } google-protobuf-plugin = { module = "com.google.protobuf:protobuf-gradle-plugin", version.ref = "protobufPlugin" } android-tools-r8 = { module = "com.android.tools:r8", version.ref = "androidToolsR8" } # Kotlin libs: kotlin-stdlib-common = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinCoroutines" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinSerializationJson" } koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } koin-core-coroutines = { module = "io.insert-koin:koin-core-coroutines", version.ref = "koinCoroutines" } koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" } # Android libs: android-ex-chips = { module = "com.android.ex.chips:chips", version.ref = "chips" } # Androidx libs: androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } androidx-room-paging = { module = "androidx.room:room-paging", version.ref = "room" } androidx-paging-ktx = { module = "androidx.paging:paging-runtime-ktx", version.ref = "pagingKtx" } androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtx" } androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" } androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" } androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" } androidx-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "lifecycle" } androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle" } androidx-lifecycle-service = { module = "androidx.lifecycle:lifecycle-service", version.ref = "lifecycle" } androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" } androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } androidx-workmanager-ktx = {module = "androidx.work:work-runtime-ktx", version.ref = "workmanagerversion"} google-material = { module = "com.google.android.material:material", version.ref = "material" } google-protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" } google-protobuf-protoc = { module = "com.google.protobuf:protoc", version.ref = "protobufProtoc" } google-gson = { module = "com.google.code.gson:gson", version.ref = "gson" } # Oplus libs: oplus-check-olint = { module = "com.sectools.check:olint", version.ref = "olint" } oplus-appcompat-base = { module = "com.oplus.appcompat:base", version.ref = "couiSupport" } oplus-appcompat-controls = { module = "com.oplus.appcompat:controls", version.ref = "couiSupport" } oplus-appcompat-bars = { module = "com.oplus.appcompat:bars", version.ref = "couiSupport" } oplus-appcompat-lists = { module = "com.oplus.appcompat:lists", version.ref = "couiSupport" } oplus-appcompat-panel = { module = "com.oplus.appcompat:panel", version.ref = "couiSupport" } oplus-appcompat-responsiveui = { module = "com.oplus.appcompat:responsiveui", version.ref = "couiSupport" } oplus-appcompat-component = { module = "com.oplus.appcompat:component", version.ref = "couiSupport" } oplus-material-color = { module = "com.oplus.materialcolor:coui-material-color", version.ref = "couiMaterialcolor" } oplus-tool-trackinglib = { module = "com.oplus.tool.trackinglib:trackinglib", version.ref = "trackinglib" } oplus-feedback-cdp = { module = "com.customer.feedback.sdk:feedback-cdp", version.ref = "feedbackCdp" } oplus-feedback-env-domestic = { module = "com.customer.feedback.sdk:feedback-env-domestic", version.ref = "feedbackEnvDomestic" } oplus-synergy-compat = { module = "com.oplus.synergysdk:synergysdkcompat", version.ref = "synergysdk" } oplus-cast-sdk = { module = "com.oplus.cast.api:castsdk", version.ref = "castsdk" } oplus-appprovider-settings = { module = "com.oplus.appprovider:settings-oplus", version.ref = "oplusSettings" } oplus-sau-coui = { module = "com.oplus.sauaar:coui-sauaar", version.ref = "sauaar" } oplus-aiunit-core = { module = "com.oplus.aiunit.open:core", version.ref = "aiunit" } oplus-aiunit-nlp = { module = "com.oplus.aiunit.open:nlp", version.ref = "aiunit" } oplus-stdid-sdk = { module = "com.oplus.stdid.sdk:sdk", version.ref = "stdid" } oplus-owork-sync = { module = "com.oplus.owork:sync-sdk", version.ref = "oworkSync" } oplus-coreapp-appfeature = { module = "com.oplus.coreapp.appfeature:AppFeatureHelper", version.ref = "appfeature" } oplus-statistics-track = { module = "com.oplus.statistics:track", version.ref = "oplusTrack" } oplus-cloudconfig-base = { module = "com.oplus.nearx:cloudconfig", version.ref = "oplusCloudconfig" } oplus-cloudconfig-env = { module = "com.oplus.nearx:cloudconfig-env", version.ref = "oplusCloudconfig" } oplus-cloudconfig-testenv = { module = "com.nearx.test:env", version.ref = "oplusCloudconfigTest" } heytap-cloudconfig-testenv = { module = "com.heytap.test:env", version.ref = "heytapCloudconfigTest"} oplus-pantanal-card-seedling = { module = "com.oplus.pantanal.card:seedling-support-internal", version.ref = "pantanalCardSeedling" } oplus-backup-sdk = { module = "com.oplus.backup:backup-sdk", version.ref = "oplusBackup" } oplus-onet-sdk = { module = "com.oplus.onet:sdk", version.ref = "onetSdk" } oplus-dfs-sdk = { module = "com.oplus.dfs:dfssdk", version.ref = "dfsSdk" } oplus-ptc-sdk-core = { module = "com.oplus.pantaconnect.sdk:core", version.ref = "ptcSdk" } oplus-ptc-sdk-connect = { module = "com.oplus.pantaconnect.sdk:connectionservice", version.ref = "ptcSdk" } oplus-ptc-sdk-ext = { module = "com.oplus.pantaconnect.sdk:extensions", version.ref = "ptcSdk" } oplus-ptc-sdk-protocol = { module = "com.oplus.pantaconnect.sdk:protocol-plugin", version.ref = "ptcSdk" } oplus-accessory-sdk = { module = "com.heytap.accessory:sdk", version.ref = "accessorySdk" } oplus-addon-sdk = { module = "com.oplus.sdk:addon", version.ref = "addon" } oplus-api-adapter-compat = { module = "com.oplus.support:api-adapter-compat", version.ref = "apiAdapter" } oplus-api-adapter-oplus = { module = "com.oplus.support:api-adapter-oplus", version.ref = "apiAdapter" } oplus-sysapi = { module = "com.oplus.appplatform:sysapi", version.ref = "sysapi" } oplus-dmp-sdk = { module = "com.oplus.dmp.sdk:connect", version.ref = "dmpSdk" } oplus-dmp-sdk-export = { module = "com.oplus.dmp.sdk:connect-export", version.ref = "dmpSdkExport" } oplus-tbl-player = { module = "com.oplus.TBLPlayer:CommonPlayer", version.ref = "oplusTBLPlayer" } oplus-remotecontrol-sdk = { module = "com.oplus.remotecontrol:remotecontrolsdk", version.ref = "remoteControlSdk" } oplus-push = { module = "com.heytap.msp:push", version.ref = "push" } # HeyTap libs: heytap-addon-adapter = { module = "com.heytap.support:addon-adapter", version.ref = "addonAdapter" } heytap-cloud-drive = { module = "com.heytap.cloud:clouddisksdk", version.ref = "cloudDrive" } heytap-cloud-base = { module = "com.heytap.cloud:base", version.ref = "cloudBase" } heytap-account-uc = { module = "com.heytap.accountsdk:UCAccountSDK_Base_heytap", version.ref = "ucAccountSDK" } heytap-nearx-track = { module = "com.heytap.nearx:track", version.ref = "heytapTrack" } heytap-nearx-utils = { module = "com.heytap.nearx:utils", version.ref = "heytapNearxUtils" } heytap-nearx-protobuff = { module = "com.heytap.nearx.protobuff:wire-runtime-isolate", version.ref = "heytapProtobuff" } heytap-cloudconfig-base = { module = "com.heytap.nearx:cloudconfig", version.ref = "heytapCloudconfig" } heytap-cloudconfig-env = { module = "com.heytap.nearx:cloudconfig-env-oversea", version.ref = "heytapCloudconfig" } heytap-cloudconfig-area = { module = "com.heytap.nearx:cloudconfig-area", version.ref = "heytapCloudconfig" } opos-ad-overseas = { module = "com.opos.ad:overseas-ad-global-pub", version.ref = "adOverseas" } #opos-ad-overseas = { module = "com.opos.ad:overseas-ad-global-dev", version.ref = "adOverseas" } taphttp = { module = "com.heytap.nearx:taphttp", version.ref = "tapHttpVerSion" } taphttp-domestic = { module = "com.heytap.nearx:taphttp-env", version.ref = "tapHttpVerSion" } taphttp-env = { module = "com.heytap.nearx:taphttp-env-oversea", version.ref = "tapHttpVerSion" }#HttpDns需要 oppo-marker-oaps-download = { module = "com.oppo.market:oaps_sdk_download", version.ref = "oapsSdkDownload" } heytap-cloudkit-common = { module = "com.heytap.cloudkit.libcommon:libcommon", version.ref = "heytapCloudkitCommonVersion"} heytap-cloudkit-sync = { module = "com.heytap.cloudkit.libsync:libsync", version.ref = "heytapCloudkitSyncVersion"} gis-riskctrl = { module = "com.heytap.gis:riskctrl", version.ref = "riskctrl" } # 3rd parts libs: findbugs = { module = "com.google.code.findbugs:jsr305", version.ref = "findbugs" } okio = { module = "com.squareup.okio:okio", version.ref = "okio" } squareup-okhttp3-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp3" } squareup-okhttp3-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp3" } squareup-retrofit2-retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit2" } squareup-retrofit2-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit2" } squareup-retrofit2-adapter = { module = "com.squareup.retrofit2:adapter-rxjava3", version.ref = "retrofit2" } squareup-retrofit2-protobuf = { module = "com.squareup.retrofit2:converter-protobuf", version.ref = "retrofit2Protobuf" } bumptech-glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" } bumptech-glide-base = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } tencent-sdk-wechat = { module = "com.tencent.mm.opensdk:wechat-sdk-android", version.ref = "wechatSdk" } apache-commons-compress = { module = "org.apache.commons:commons-compress", version.ref = "commonsCompress" } apache-commons-logging = { module = "commons-logging:commons-logging", version.ref = "commonsLogging" } apache-commons-io = { module = "commons-io:commons-io", version.ref = "commonsIo" } apache-commons-codec = { module = "commons-codec:commons-codec", version.ref = "commonsCodec" } apache-tika-core = { module = "org.apache.tika:tika-core", version.ref = "tika" } lingala-zip4j = { module = "net.lingala.zip4j:zip4j", version.ref = "zip4j" } innosystec-unrar-java = { module = "de.innosystec.unrar:java-unrar", version.ref = "unrar" } gnu-crypto = { module = "gnu.crypto:crypto", version.ref = "gnuCrypto" } allawn-crypto-android = { module = "com.allawn.cryptography:crypto-android-sdk", version.ref = "cryptography" } slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } rxjava = { module = "io.reactivex.rxjava3:rxjava", version.ref = "rxjava" } wps-sdk-snapshot = { module = "com.wps.sdk:snapshot", version.ref = "wpsSdkSnapshot" } # FileManager Inner libs: oplus-filemanager-thumbnail = { module = "com.oplus.filemanager:thumbnail", version.ref = "fileManagerThumbnail" } oplus-filemanager-thumbnailWpsCompat = { module = "com.oplus.filemanager:thumbnail_wps_compat", version.ref = "fileManagerThumbnailWpsCompat" } oplus-filemanager-simulateClickEngine = { module = "com.oplus.filemanager:simulate_click_engine", version.ref = "fileManagerSimulateClick" } oplus-filemanager-dragDrop = { module = "com.oplus.filemanager:dragdrop", version.ref = "fileManagerDragDrop" } max-applovin-sdk = { module = "com.applovin:applovin-sdk", version.ref = "maxVersion" } mediation-google-adapter = { module = "com.applovin.mediation:google-adapter", version.ref = "googleAdapter" } mediation-facebook-adapter = { module = "com.applovin.mediation:facebook-adapter", version.ref = "facebookAdapter" } mediation-mytarget-adapter = { module = "com.applovin.mediation:mytarget-adapter", version.ref = "mytargetAdapter" } mediation-bytedance-adapter = { module = "com.applovin.mediation:bytedance-adapter", version.ref = "bytedanceAdapter" } ######## Unit test denpendencies ######## junit-base = { module = "junit:junit", version.ref = "junit" } mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } mockito-inline = { module = "org.mockito:mockito-inline", version.ref = "mockito" } mockk-base = { module = "io.mockk:mockk", version.ref = "mockk" } mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" } mockk-agnet = { module = "io.mockk:mockk-agent-jvm", version.ref = "mockk" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinCoroutinesTest" } robolectric-base = { module = "org.robolectric:robolectric", version.ref = "robolectric" } powermock-module-junit4-base = { module = "org.powermock:powermock-module-junit4", version.ref = "powermock" } powermock-module-junit4-rule = { module = "org.powermock:powermock-module-junit4-rule", version.ref = "powermock" } powermock-api-mockito2 = { module = "org.powermock:powermock-api-mockito2", version.ref = "powermock" } powermock-classloading-xstream = { module = "org.powermock:powermock-classloading-xstream", version.ref = "powermock" } androidx-arch-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "androidxCoreTest" } json-base = { module = "org.json:json", version.ref = "json" } ######## AndroidTest denpendencies ######## androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" } androidx-test-espresso-intents = { module = "androidx.test.espresso:espresso-intents", version.ref = "espresso" } androidx-test-espresso-web = { module = "androidx.test.espresso:espresso-web", version.ref = "espresso" } androidx-test-espresso-idling-concurrent = { module = "androidx.test.espresso.idling:idling-concurrent", version.ref = "espresso" } androidx-test-espresso-idling-resource = { module = "androidx.test.espresso:espresso-idling-resource", version.ref = "espresso" } androidx-test-runner = { module = "androidx.test:runner", version.ref = "testRunner" } androidx-test-rules = { module = "androidx.test:rules", version.ref = "testRules" } androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "androidxJunit" } androidx-test-truth = { module = "androidx.test.ext:truth", version.ref = "testTruth" } androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" } androidx-room-testing = { module = "androidx.room:room-testing", version.ref = "roomTesting" } mockito-android = { module = "org.mockito:mockito-android", version.ref = "mockito" } otest-testLib = { module = "otestPlatform:testLib", version.ref = "oTestLib" } otest-coverageLib = { module = "otestPlatform:coverageLibTest", version.ref = "oTestCoverage" } koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" } koin-test-junit4 = { module = "io.insert-koin:koin-test-junit4", version.ref = "koin" } seedling-sdk = { module = "com.oplus.pantanal.card:seedling-support-internal", version.ref = "koin" } [bundles] ######## Codes denpendencies ######## kotlin = ["kotlin-stdlib-common", "kotlin-stdlib-jdk8", "kotlinx-coroutines-android"] oplus-cloudconfig = ["oplus-cloudconfig-base", "oplus-cloudconfig-env"] oplus-feedback-domestic = ["oplus-feedback-cdp", "oplus-feedback-env-domestic"] heytap-cloudconfig = ["heytap-cloudconfig-base", "heytap-cloudconfig-env", "heytap-cloudconfig-area"] heytap-clouddrive = ["heytap-cloud-drive", "heytap-cloud-base"] squareup-okhttp3 = ["squareup-okhttp3-okhttp", "squareup-okhttp3-logging"] squareup-retrofit2 = [ "squareup-retrofit2-retrofit", "squareup-retrofit2-gson", "squareup-retrofit2-adapter", "rxjava" ] ######## Unit test denpendencies ######## test-mockito = ["mockito-core", "mockito-inline"] test-mockk = ["mockk-base", "mockk-android", "mockk-agnet"] test-powermock = [ "powermock-module-junit4-base", "powermock-module-junit4-rule", "powermock-api-mockito2", "powermock-classloading-xstream" ] ######## AndroidTest denpendencies ######## android-test-suit = [ "androidx-test-runner", "androidx-test-rules", "androidx-test-junit", "androidx-test-truth" ] android-test-espresso = [ "androidx-test-espresso-core", "androidx-test-espresso-intents", "androidx-test-espresso-web", "androidx-test-espresso-idling-concurrent", "androidx-test-espresso-idling-resource" ]AGP升到8.3.1要修改哪些东西

filetype

Build file 'D:\project\HDMI\VIEW_MODE_MEDIA\Media\Application\configs\platforms\android_gradle\mediafunc\build.gradle' line: 2 Could not compile build file 'D:\project\HDMI\VIEW_MODE_MEDIA\Media\Application\configs\platforms\android_gradle\mediafunc\build.gradle'. > startup failed: build file 'D:\project\HDMI\VIEW_MODE_MEDIA\Media\Application\configs\platforms\android_gradle\mediafunc\build.gradle': 2: argument list must be exactly 1 literal String or String with property replacement plugins { id 'com.android.library' version agp_version } android { namespace 'com.denso.mediafunc' compileSdkVersion 32 defaultConfig { minSdkVersion 32 targetSdkVersion 32 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug { testCoverageEnabled true } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } packagingOptions { exclude 'META-INF/*' exclude 'kotlin/*/*' exclude 'kotlin/*' exclude 'wm_shell_protolog.json' exclude 'META-INF/androidx.loader_loader.version' } } dependencies { implementation files('libs/directorlib.jar') compileOnly files('libs/ts-platform-library.jar') implementation files('libs/telcommonapi.jar') // compileOnly files('libs/telcommonapi-bta.jar') // compileOnly files('libs/ts-platform-library-bta.jar') compileOnly files('libs/vendor.denso.persistence-V1.0-java.jar') implementation files('libs/soundmodeservicelib.jar') api files('libs/dtvlib.jar') implementation files('libs/smartphonemanager.jar') compileOnly fileTree(dir: 'libs', include: ['*.aar']) compileOnly files('libs/android.car.jar') implementation project(path: ':mediaplugin') compileOnly files('libs/framework.jar') implementation files('libs/windowmanager-shell.jar') implementation files('libs/popupmanager.jar') implementation files('libs/radioservicelib.jar') implementation files('libs/PlayBeepplugin.jar') implementation files('libs/hdmilib.jar') implementation files('libs/displaylib.jar') //implementation 'androidx.appcompat:appcompat:1.4.1' // implementation 'com.google.android.material:material:1.6.0' implementation('androidx.palette:palette:1.0.0') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.arch.core", module: "core-common" exclude group: "androidx.arch.core", module: "core-runtime" exclude group: "androidx.collection", module: "collection" exclude group: "androidx.core", module: "core" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "androidx.loader", module: "loader" exclude group: "androidx.lifecycle", module: "lifecycle-livedata-core" exclude group: "androidx.lifecycle", module: "lifecycle-viewmodel" } implementation("androidx.startup:startup-runtime:1.0.0"){ exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.tracing", module: "tracing" } testImplementation('junit:junit:4.13.2') { exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation('androidx.test.ext:junit:1.1.3') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation('androidx.test:rules:1.4.0') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation 'org.mockito:mockito-core:4.8.1' androidTestImplementation 'org.mockito:mockito-android:4.8.1' androidTestImplementation fileTree(dir: 'libs', include: ['*.aar', '*.jar']) }

filetype

plugins { id 'com.android.application' } apply from: 'jacoco-report.gradle' def cfg = rootProject.ext.configuration android { compileSdk cfg.targetSdk defaultConfig { applicationId cfg.applicationId minSdk cfg.minSdk targetSdk cfg.targetSdk versionCode cfg.versionCode versionName cfg.versionName } signingConfigs { release { storeFile file("$rootDir/platform.jks") storePassword = "123456" keyPassword = "123456" keyAlias = "ktplatfrom" } debug { storeFile file("$rootDir/platform.jks") storePassword = "123456" keyPassword = "123456" keyAlias = "ktplatfrom" } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debugCoverage { minifyEnabled false testCoverageEnabled false } } // buildTypes { // release { // minifyEnabled false // signingConfig signingConfigs.release // } // debug { // minifyEnabled false // signingConfig signingConfigs.debug // debuggable true // testCoverageEnabled false // } // } applicationVariants.all { variant -> variant.outputs.all { output -> def newName = "ktLauncher.apk" outputFileName = newName } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } dataBinding { enabled = true } buildFeatures { aidl true } //儿童模式 flavorDimensions "default" productFlavors { _NORMAL_MODE { buildConfigField("int", "user_model", "0") } _CHILD_MODE { buildConfigField("int", "user_model", '1') } } testOptions { unitTests { includeAndroidResources = true returnDefaultValues = true } } } gradle.projectsEvaluated { tasks.withType(JavaCompile) { Set<File> fileSet = options.bootstrapClasspath.getFiles() List<File> newFileList = new ArrayList<>(); //将framework.jar插入到最前面 newFileList.add(new File("libs/framework.jar")) //最后将原始的数据插入 newFileList.addAll(fileSet) options.bootstrapClasspath = files( newFileList.toArray() ) } } dependencies { // api fileTree(include: ['*.jar'], dir: 'libs') implementation rootProject.ext.dependencies["appcompat"] implementation rootProject.ext.dependencies["material"] implementation rootProject.ext.dependencies["constraintlayout"] implementation rootProject.ext.dependencies["lifecycle-extensions"] implementation rootProject.ext.dependencies["gson"] implementation project(':base') compileOnly files('libs/framework.jar') implementation 'com.github.bumptech.glide:glide:4.12.0' implementation 'com.android.support:design:28.0.0' implementation "androidx.constraintlayout:constraintlayout:2.1.3" annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' // test testImplementation 'org.powermock:powermock-module-junit4:2.0.7' testImplementation 'org.powermock:powermock-module-junit4-rule:1.7.4' testImplementation 'org.powermock:powermock-api-mockito2:2.0.7' testImplementation 'org.mockito:mockito-core:3.3.3' testImplementation 'android.arch.core:core-testing:1.1.1' testImplementation 'org.mockito:mockito-inline:3.11.2' } -----build.gradle----------- apply plugin: 'jacoco' //gradlew clean & gradlew createOfflineTestCoverageReport & gradlew jacocoTestReport tasks.withType(Test) { jacoco.includeNoLocationClasses = true jacoco.excludes = ['jdk.internal.*'] } configurations { jacocoAnt jacocoRuntime } jacoco { toolVersion = "0.8.5" } def offline_instrumented_outputDir = "$buildDir.path/intermediates/classes-instrumented/debugCoverage" tasks.withType(Test) { jacoco.includeNoLocationClasses = true jacoco.excludes = ['jdk.internal.*'] } def coverageSourceDirs = [ 'src/main/java' ] task jacocoTestReport(type: JacocoReport, dependsOn: "test") { group = "Reporting" description = "Generate Jacoco coverage reports" classDirectories.from = fileTree( dir: './build/intermediates/javac/debugCoverage/classes/', excludes: [ '**/R.class', '**/R$*.class', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*', '**/BuildConfig.*', '**/**Bean.class', '**/inputmethod/*', '**/config/*.*', '**/flex/*.*', '**/AssetsUtils.class' ] ) getSourceDirectories().setFrom(files(coverageSourceDirs)) getExecutionData().setFrom(files('./build/jacoco/testDebugUnitTest.exec')) } jacocoTestReport { reports { xml.enabled true html.enabled true html.destination file("build/test-results/jacocoHtml") } } /* This task is used to create offline instrumentation of classes for on-the-fly instrumentation coverage tool like Jacoco. See jacoco classId * and Offline Instrumentation from the jacoco site for more info. * * In this case, some classes mocked using PowerMock were reported as 0% coverage on jacoco & Sonarqube. The issue between PowerMock and jacoco * is well documented, and a possible solution is offline Instrumentation (not so well documented for gradle). * * In a nutshell, this task: * - Pre-instruments the original *.class files * - Puts the instrumented classes path at the beginning of the task's classpath (for report purposes) * - Runs test & generates a new exec file based on the pre-instrumented classes -- as opposed to on-the-fly instrumented class files generated by jacoco. * * It is currently not implemented to run prior to any other existing tasks (like test, jacocoTestReport, etc...), therefore, it should be called * explicitly if Offline Instrumentation report is needed. * * Usage: gradle clean & gradle createOfflineInstrTestCoverageReport & gradle jacocoTestReport * - gradle clean //To prevent influence from any previous task execution * - gradle createOfflineInstrTestCoverageReport //To generate *.exec file from offline instrumented class * - gradle jacocoTestReport //To generate html report from newly created *.exec task */ task createOfflineTestCoverageReport(dependsOn: ['instrument', 'testDebugCoverageUnitTest']) { group = "reporting" doLast { ant.taskdef(name: 'report', classname: 'org.jacoco.ant.ReportTask', classpath: configur3+ations.jacocoAnt.asPath) ant.report() { executiondata { ant.file(file: "$buildDir.path/jacoco/testDebugCoverageUnitTest.exec") } structure(name: 'Example') { classfiles { fileset(dir: "$project.buildDir/intermediates/javac/debugCoverage") } sourcefiles { fileset(dir: 'src/main/java') } } //Uncomment if we want the task to generate jacoco html reports. However, the current script does not exclude files. //An alternative is to used jacocoTestReport after this task finishes //html(destdir: "$buildDir.path/reports/jacocoHtml") } } } createOfflineTestCoverageReport.dependsOn(clean) /* * Part of the Offline Instrumentation process is to add the jacoco runtime to the class path along with the path of the instrumented files. */ gradle.taskGraph.whenReady { graph -> if (graph.hasTask(instrument)) { tasks.withType(Test) { doFirst { systemProperty 'jacoco-agent.destfile', buildDir.path + '/jacoco/testDebugCoverageUnitTest.exec' classpath = files(offline_instrumented_outputDir) + classpath + configurations.jacocoRuntime } } } } /* * Instruments the classes per se */ task instrument(dependsOn:'compileDebugUnitTestSources') { doLast { println 'Instrumenting classes' ant.taskdef(name: 'instrument', classname: 'org.jacoco.ant.InstrumentTask', classpath: configurations.jacocoAnt.asPath) ant.instrument(destdir: offline_instrumented_outputDir) { fileset(dir: "$buildDir.path/intermediates/javac/debugCoverage") } } } -----jacoco-report.gradle--------------- jacoco-report.gradle 在同一个项目中的base模块可以正常生成jacoco单元测试覆盖率报告,但是在app模块无法生成,build文件夹中,都没有jacoco和 test-results文件夹。上述的jacoco-report.gradle和build.gradle是app模块的内容 请问应该如何解决app模块无法显示jacoco报告的问题i

易三叨
  • 粉丝: 54
上传资源 快速赚钱