-
Notifications
You must be signed in to change notification settings - Fork 224
/
Copy pathbuild.gradle.kts
34 lines (28 loc) · 881 Bytes
/
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
import java.util.Properties
import groovy.lang.MissingPropertyException
plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
gradlePluginPortal()
}
// Use the same Java version for compiling the convention plugins as for the main project
// For this we need to manually load the gradle.properties, since variables from the main
// project are generally not visible from buildSrc.
val javaVersionProperty = "javaVersion"
val javaVersion = try {
project.property(javaVersionProperty) as String
} catch (e: MissingPropertyException) {
Properties().also { properties ->
File("$rootDir/../gradle.properties").inputStream().use { stream ->
properties.load(stream)
}
}[javaVersionProperty] as String
}
kotlin {
jvmToolchain(javaVersion.toInt())
}
dependencies {
implementation(libs.org.jetbrains.kotlin.gradle.plugin)
}