Gradle build fixes & improvements:
* Fix Java not compiled in kotlin-gradle-plugin Kotlin source set * Fix the integration tests running under Java 6 * Fix kotlin-gradle-subplugin-example not being installed -- needed for a test * Fix Android tests being always excluded * Move versions out of `build.gradle` (x2) to a common `versions.gradle` * Move JDK, dist and bootstrap to `commonConfiguration.gradle` * Build `kotlin-gradle-plugin` with JDK_18
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
ext.jdkPath = { String version ->
|
||||
String jdkPath(String version) {
|
||||
String varName = "JDK_${version.replace('.', '')}"
|
||||
String path = System.getenv(varName)
|
||||
if (path == null) throw new GradleException("Please set environment variable $varName to point to JDK $version installation")
|
||||
return path
|
||||
}
|
||||
|
||||
ext {
|
||||
JDK_16 = jdkPath("1.6")
|
||||
JDK_17 = jdkPath("1.7")
|
||||
JDK_18 = jdkPath("1.8")
|
||||
distDir = file("${rootDir}/../dist")
|
||||
distLibDir = file("${rootDir}/../dist/kotlinc/lib")
|
||||
bootstrapCompilerFile = file("$distDir/kotlin-compiler-for-maven.jar")
|
||||
}
|
||||
|
||||
ext.configureJvmProject = { Project project ->
|
||||
project.configure(project) {
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
@@ -16,7 +25,7 @@ ext.configureJvmProject = { Project project ->
|
||||
sourceCompatibility = 1.6
|
||||
targetCompatibility = 1.6
|
||||
options.fork = true
|
||||
options.forkOptions.executable = "${JDK_16}/bin/javac"
|
||||
options.forkOptions.javaHome = file(JDK_16)
|
||||
}
|
||||
|
||||
tasks.withType(project.compileKotlin.class) {
|
||||
|
||||
Reference in New Issue
Block a user