-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
41 lines (36 loc) · 1.48 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
import io.appmetrica.analytics.gradle.AppMetricaPushModulePlugin
plugins {
id("appmetrica-update-push-version")
}
val modules by lazy { subprojects.filter { it.plugins.hasPlugin(AppMetricaPushModulePlugin::class.java) } }
val buildTypes = listOf("release", "snapshot", "debug")
fun createTaskName(
prefix: String,
buildType: String = "",
suffix: String = ""
): String {
return "${prefix}${buildType.capitalize()}${suffix.capitalize()}"
}
buildTypes.forEach { buildType ->
tasks.register("assemble${buildType.capitalize()}") {
dependsOn(modules.map { it.tasks.named(createTaskName("assemble", buildType)) })
}
tasks.register("publish${buildType.capitalize()}PublicationToMavenLocal") {
dependsOn(modules.map { it.tasks.named(createTaskName("publish", buildType, "publicationToMavenLocal")) })
}
tasks.register("test${buildType.capitalize()}UnitTest") {
dependsOn(modules.map { it.tasks.named(createTaskName("test", buildType, "unitTest")) })
}
tasks.register("generate${buildType.capitalize()}JacocoReport") {
dependsOn(modules.map { it.tasks.named(createTaskName("generate", buildType, "jacocoReport")) })
}
}
tasks.register("codequality") {
dependsOn(modules.map { it.tasks.named(createTaskName("codequality")) })
}
tasks.register("aarCheck") {
dependsOn(modules.map { it.tasks.named(createTaskName("aarCheck")) })
}
tasks.register("aarDump") {
dependsOn(modules.map { it.tasks.named(createTaskName("aarDump")) })
}