-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
50 lines (39 loc) · 1.11 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
val releasableProjects = listOf(":core", ":core-error")
val releaseVersion = "$version"
val buildVersion by lazy { project.file("version").readLines().first() }
allprojects {
group = "io.github.andriesfc.resultk"
version = buildVersion
}
//<editor-fold desc="Tasks">
tasks.register("build") {
description = "Builds all modules, including running test verification tasks."
doFirstOnSubProjects()
}
tasks.register("clean") {
description = "Cleans projects"
doFirstOnSubProjects()
}
tasks.register("assemble") {
description = "Assemble all projects"
doFirstOnSubProjects()
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
//</editor-fold>
//<editor-fold desc="Supporting functions">
fun Task.doFirstOnSubProjects(taskName: String? = null) {
group = "Project"
val todo = taskName ?: name
doFirst {
subprojects {
tasks.findByName(todo)?.also { todoOnSubProject ->
todoOnSubProject.actions.forEach { action ->
action.execute(todoOnSubProject)
}
}
}
}
}
//</editor-fold>