-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
177 lines (150 loc) · 5.74 KB
/
build.gradle.kts
File metadata and controls
177 lines (150 loc) · 5.74 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
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
/*
* Copyright 2022 Nikolai Kotchetkov.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("unused")
import groovy.lang.Closure
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.android.app) apply false
alias(libs.plugins.android.lib) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.compose) apply false
alias(libs.plugins.kotlin.dokka) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.nexus.publish)
alias(libs.plugins.git)
}
apply {
from("$rootDir/gradle/versioning.gradle")
from("$rootDir/gradle/maven-publish-config.gradle")
}
private val buildVersionName: Closure<Any> by ext
private val buildVersionCode: Closure<Any> by ext
version = buildVersionName()
group = "com.motorro.commonstatemachine"
description = "Multiplatform state machine for mobile applications"
allprojects {
val versionName by extra(buildVersionName())
val versionCode by extra(buildVersionCode())
val androidBuildToolsVersion by extra("35.0.0")
val androidMinSdkVersion by extra(24)
val androidTargetSdkVersion by extra(36)
val androidCompileSdkVersion by extra(36)
val developerId by extra("motorro")
val developerName by extra("Nikolai Kotchetkov")
val developerEmail by extra("motorro@gmail.com")
val projectScm by extra("https://github.com/motorro/CommonStateMachine.git")
val projectUrl by extra("https://github.com/motorro/CommonStateMachine")
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.addAll(listOf(
"-opt-in=kotlin.RequiresOptIn",
"-Xexpect-actual-classes"
))
}
}
tasks.withType<Test>().configureEach {
forkEvery = 100
testLogging {
events("skipped", "failed")
showExceptions = true
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
showStackTraces = true
// set options for log level DEBUG and INFO
debug {
events("started", "passed", "skipped", "failed", "standardOut", "standardError")
exceptionFormat = TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
}
}
}
tasks.register("runStateMachineTests") {
dependsOn(":commonstatemachine:allTests")
description = "Run unit tests for the common state machine layer."
}
tasks.register("runCoroutinesTests") {
dependsOn(":coroutines:allTests")
description = "Run unit tests for the coroutines extension layer."
}
tasks.register("runLifecycleTests") {
dependsOn(":lifecycle:allTests")
description = "Run unit tests for the lifecycle extension layer."
}
tasks.register("runCommonflowTests") {
dependsOn(":commonflow:commonflow-viewmodel:allTests")
description = "Run unit tests for the commonflow library."
}
tasks.register("runLceExampleUnitTests") {
dependsOn(":examples:lce:testDebugUnitTest")
description = "Run unit tests for LCE app."
}
tasks.register("runWelcomeExampleUnitTests") {
dependsOn(":examples:welcome:commonregister:allTests")
dependsOn(":examples:welcome:login:testDebugUnitTest")
dependsOn(":examples:welcome:welcome:testDebugUnitTest")
description = "Run unit tests for welcome app."
}
tasks.register("runTimerExampleUnitTests") {
dependsOn(":examples:timer:testAndroidHostTest")
description = "Run unit tests for timer library."
}
tasks.register("runDiExampleUnitTests") {
dependsOn(":examples:di:login:testDebugUnitTest")
dependsOn(":examples:di:social:testDebugUnitTest")
description = "Run unit tests for di app."
}
tasks.register("runBooksExampleUnitTests") {
dependsOn(":examples:books:book:testDebugUnitTest")
dependsOn(":examples:books:app:testDebugUnitTest")
description = "Run unit tests for books app."
}
tasks.register("displayVersion") {
description = "Display application version name"
doLast {
println("Application version: ${buildVersionName()}")
}
}
tasks.register("runUnitTests") {
dependsOn(
"runStateMachineTests",
"runCoroutinesTests",
"runLifecycleTests",
"runCommonflowTests",
"runLceExampleUnitTests",
"runWelcomeExampleUnitTests",
"runTimerExampleUnitTests",
"runDiExampleUnitTests",
"runBooksExampleUnitTests"
)
group = "verification"
description = "Run unit tests for all modules."
}
val ossrhUsername: String? by extra
val ossrhPassword: String? by extra
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username.set(ossrhUsername)
password.set(ossrhPassword)
}
}
}