-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdepend_java.gradle
More file actions
97 lines (92 loc) · 4.01 KB
/
depend_java.gradle
File metadata and controls
97 lines (92 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//Java业务模块通用依赖
android {
//编译版本
compileSdkVersion COMPILE_SDK_VERSION as int
//lint设置
lintOptions {
//lint 不被终止
abortOnError false
//打Release版本时,不进行检测
checkReleaseBuilds false
//关闭检索的功能
disable 'GoogleAppIndexingWarning'
}
//数据绑定
dataBinding {
enabled = true
}
//Dex分包
dexOptions {
jumboMode = true//忽略方法数限制的检查
}
//Java1.8支持
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
//单元测试,Robolectric支持
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
//将源代码打包进aar
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.javaDirectories
}
artifacts {
archives sourcesJar
}
//仓库
repositories {
//本地仓库,添加aar支持
flatDir { dirs 'libs' }
}
//Gradle可以缓存SNAPSHOT构建,以确保Gradle始终选择构建的“最新”版本:
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
//通用Base库
implementation "com.github.coolfire2015.RxFluxArchitecture:core-base:${RX_FLUX_ARCHITECTURE}"
//测试Android
testImplementation "androidx.test:runner:${TEST_X_RUNNER}"
testImplementation "androidx.test.ext:junit:${TEST_X_JUNIT}"
testImplementation "androidx.test:core:${TEST_X_CORE}"
testImplementation "androidx.test:rules:${TEST_X_RULES}"
testImplementation "androidx.fragment:fragment-testing:${X_FRAGMENT}"
testImplementation "androidx.test.espresso:espresso-core:${TEST_X_ESPRESSO}"
testImplementation "androidx.room:room-testing:${X_ROOM}"
//单元测试
testImplementation "junit:junit:${TEST_JUNIT}"
testImplementation "org.mockito:mockito-core:${TEST_MOCKITO}"
testImplementation "org.mockito:mockito-inline:${TEST_MOCKITO}"//解决Mockito无法mock final class的问题
//解决Mockito any()等返回null的问题
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:${TEST_MOCKITO_KOTLIN}"
testImplementation "org.robolectric:robolectric:${TEST_ROBOLECTRIC}"
testImplementation "com.github.coolfire2015:RxFluxTest:${RX_FLUX_TEST}"
testImplementation "com.github.fabioCollini.daggermock:daggermock:${TEST_DEAAGE_MOCK}"
testImplementation "com.github.fabioCollini.daggermock:daggermock-kotlin:${TEST_DEAAGE_MOCK}"
//测试Api
testImplementation "com.squareup.okhttp3:okhttp-tls:${OKHTTP}"
testImplementation "com.squareup.okhttp3:mockwebserver:${OKHTTP}"
testImplementation "com.github.andrzejchm.RESTMock:android:${TEST_REST_MOCK}"
//编译时生成
annotationProcessor "androidx.room:room-compiler:${X_ROOM}"
annotationProcessor "com.android.tools.build.jetifier:jetifier-core:${JETIFIER}"
annotationProcessor "com.google.dagger:dagger-compiler:${DAGGER}"
annotationProcessor "com.google.dagger:dagger-android-processor:${DAGGER}"
annotationProcessor "com.alibaba:arouter-compiler:${AROUTER_COMPILER}"
annotationProcessor "com.github.coolfire2015.RxFluxEventBus:core-eventbus-processor:${RX_FLUX_EVENTBUS}"
annotationProcessor "com.github.coolfire2015.RxFluxArchitecture:core-arch-processor:${RX_FLUX_ARCHITECTURE}"
//单元测试编译时生成
testAnnotationProcessor "androidx.room:room-compiler:${X_ROOM}"
testAnnotationProcessor "com.android.tools.build.jetifier:jetifier-core:${JETIFIER}"
testAnnotationProcessor "com.google.dagger:dagger-compiler:${DAGGER}"
testAnnotationProcessor "com.google.dagger:dagger-android-processor:${DAGGER}"
testAnnotationProcessor "com.alibaba:arouter-compiler:${AROUTER_COMPILER}"
testAnnotationProcessor "com.github.coolfire2015.RxFluxEventBus:core-eventbus-processor:${RX_FLUX_EVENTBUS}"
testAnnotationProcessor "com.github.coolfire2015.RxFluxArchitecture:core-arch-processor:${RX_FLUX_ARCHITECTURE}"
}