-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
225 lines (195 loc) · 6.46 KB
/
build.gradle
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
buildscript {
ext.kotlin_version = '2.0.0'
ext.dokka_version = '1.9.20'
repositories {
google()
mavenCentral()
maven {
url="https://plugins.gradle.org/m2/"
}
maven {
url="https://dl.bintray.com/kotlin/dokka"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.4'
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'org.ajoberstar.grgit' version '3.0.0'
id 'org.jetbrains.kotlin.jvm' version "$kotlin_version"
id 'org.jetbrains.dokka' version "$dokka_version"
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
}
apply from: 'gradle/versioning.gradle'
apply from: 'gradle/maven-publish-config.gradle'
setVersion(buildVersionName())
group = "com.motorro.rxlcemodel"
setDescription("A reactive data loading for Android based on RxJava and `Loading`/`Content`/`Error` states.")
ext {
// Android
androidBuildToolsVersion = '34.0.0'
androidMinSdkVersion = 24
androidTargetSdkVersion = 34
androidCompileSdkVersion = 34
versionName = project.version
versionCode = buildVersionCode()
//Bin-tray
developerId = 'motorro'
developerName = 'Nikolai Kotchetkov'
developerEmail = '[email protected]'
bintrayUserOrg = "motorro"
bintrayRepoName = "RxLceModel"
projectScm = 'https://github.com/motorro/RxLceModel.git'
projectUrl = 'https://github.com/motorro/RxLceModel'
// Dokka
docDir = "${projectDir}/docs"
}
allprojects {
ext {
commonLibVersions = [
// Code
"rx_java": '3.1.8',
"coroutines": '1.8.1',
"core_ktx_version": '1.13.1',
"lifecycle_version": '2.8.1',
"arch_version": "2.1.0",
"nav_version": '2.7.7',
"work_version": '2.9.0',
// Tests
"junit": '4.13.2',
"mockito_kotlin": "2.2.0",
"mockative": "1.2.6",
// Compose
"compose_ui_bom": '2024.05.00',
"compose_ui_activity_version": "1.4.0",
"compose_viewmodel_version": '2.8.1',
"compose_livedata_version": "1.2.0",
]
}
repositories {
google()
mavenCentral()
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn",
"-Xinline-classes",
"-Xexpect-actual-classes"
]
}
}
// Test Logging
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events "skipped", "failed"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = ' ', endItem = ' '
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
}
tasks.register('runLceUnitTests') {
dependsOn(':lce:check')
group('verification')
description 'Run unit tests for Lce library.'
}
tasks.register('runCacheUnitTests') {
dependsOn(':cache:check')
group('verification')
description 'Run unit tests for Cache library.'
}
tasks.register('runRxUnitTests') {
dependsOn(':rx:check')
group('verification')
description 'Run unit tests for Rx library.'
}
tasks.register('runCoroutinesUnitTests') {
dependsOn(':coroutines:check')
group('verification')
description 'Run unit tests for Rx library.'
}
tasks.register('runDiskLruUnitTests') {
dependsOn(':disklrucache:check')
group('verification')
description 'Run unit tests for DiskLruCache library.'
}
tasks.register('runKserializerUnitTests') {
dependsOn(':kserializer:check')
group('verification')
description 'Run unit tests for KSerializer library.'
}
tasks.register('runViewmodelUnitTests') {
dependsOn(':viewmodel:testDebugUnitTest')
group('verification')
description 'Run unit tests for ViewModel library.'
}
tasks.register('runComposeViewUnitTests') {
dependsOn(':composeview:testDebugUnitTest')
group('verification')
description 'Run unit tests for Compose-view library.'
}
tasks.register('runSampleUnitTests') {
dependsOn(':sample:check')
group('verification')
description 'Run unit tests for Sample application.'
}
tasks.register('runUnitTests') {
dependsOn(
'runLceUnitTests',
'runCacheUnitTests',
'runRxUnitTests',
'runCoroutinesUnitTests',
'runDiskLruUnitTests',
'runKserializerUnitTests',
'runViewmodelUnitTests',
'runComposeViewUnitTests',
'runSampleUnitTests'
)
group('verification')
description 'Run unit tests for libraries.'
}
tasks.register('displayVersion') {
description 'Display application version name'
doLast {
println("Project version: ${project.version}")
}
}
dokkaGfmMultiModule.configure {
outputDirectory = new File(docDir)
includes.from("module.md")
}
dokkaHtmlMultiModule.configure {
outputDirectory = new File(docDir)
includes.from("module.md")
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = ossrhUsername
password = ossrhPassword
}
}
}