-
Notifications
You must be signed in to change notification settings - Fork 179
/
build.gradle.kts
60 lines (52 loc) · 1.61 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
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile
import java.nio.file.Files
import java.nio.file.Paths
plugins {
id("org.ajoberstar.reckon") version "0.9.0"
}
reckon {
scopeFromProp()
stageFromProp("alpha", "rc", "final")
}
allprojects {
repositories {
jcenter()
maven ("https://dl.bintray.com/kotlin/kotlin-eap")
maven ("https://kotlin.bintray.com/kotlinx")
}
if (Files.exists(Paths.get("$rootDir/local.properties"))) {
val localProperties = java.util.Properties()
localProperties.load(java.io.FileInputStream("$rootDir/local.properties"))
localProperties.forEach { prop -> project.extra.set(prop.key as String, prop.value) }
}
var releaseMode = false
if ("$version".matches(Regex("^\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?"))) {
releaseMode = true
} else {
version = "$version-SNAPSHOT"
}
project.extra["releaseMode"] = releaseMode
afterEvaluate {
tasks.withType<KotlinCompile<*>> {
if (this is KotlinJvmCompile) {
kotlinOptions {
apiVersion = "1.4"
jvmTarget = "1.8"
}
} else {
kotlinOptions {
// KN requires 1.4
apiVersion = "1.4"
}
}
}
}
}
listOf("check", "build", "clean").forEach { taskName ->
task(taskName) {
gradle.includedBuilds.forEach { includedBuild ->
dependsOn(gradle.includedBuild(includedBuild.name).task(":$taskName"))
}
}
}