forked from OpenDevEd/Voice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
executable file
·75 lines (67 loc) · 1.88 KB
/
build.gradle.kts
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
@file:Suppress("UnstableApiUsage")
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
classpath(libs.androidPluginForGradle)
classpath(libs.kotlin.pluginForGradle)
}
}
plugins {
alias(libs.plugins.ktlint)
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
allprojects {
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf(
"-progressive",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlin.time.ExperimentalTime",
"-Xopt-in=kotlinx.coroutines.FlowPreview",
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xopt-in=androidx.compose.material.ExperimentalMaterialApi",
"-Xopt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
)
}
}
}
subprojects {
fun addCoreDependencies() {
if (path != ":core") {
dependencies.add("implementation", projects.core)
if (path != ":logging:core") {
dependencies.add("implementation", projects.logging.core)
}
}
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
plugins.withId("kotlin") {
addCoreDependencies()
}
plugins.withId("kotlin-android") {
addCoreDependencies()
}
}
tasks {
register<Exec>("importStrings") {
executable = "sh"
args("-c", "tx pull -af --minimum-perc=5")
finalizedBy(":app:lintDebug")
}
register<TestReport>("allUnitTests") {
val tests = subprojects.mapNotNull { subProject ->
val tasks = subProject.tasks
(
tasks.findByName("testDebugUnitTest")
?: tasks.findByName("test")
) as? Test
}
val artifactFolder = File("${rootDir.absolutePath}/artifacts")
destinationDir = File(artifactFolder, "testResults")
reportOn(tests)
}
}