aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/build.gradle.kts
blob: f687f808185eb39ed60a5ea804ba8007fc9135fd (plain)
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
plugins {
    `kotlin-dsl`
}

group = "com.pitchedapps"

repositories {
    jcenter()
    maven("https://jitpack.io")
}

var isRoot = false
// Currently can't read properties from root project
// Reading it manually since it's simple
val rootProps =
    File(
        project.rootDir.let {
            if (it.name == "buildSrc") {
                it.parent
            } else {
                isRoot = true
                it.absolutePath
            }
        },
        "gradle.properties"
    )
val kau = rootProps.useLines {
    it.first { s -> s.startsWith("KAU=") }
}.substring(4).trim()

if (isRoot) {
    println("Using kau $kau")
}

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
}

dependencies {
    implementation("ca.allanwang.kau:gradle-plugin:$kau")
}