Switching library projects to java 8 compilation with exceptions for stdlib/runtime/reflect/test
This commit is contained in:
@@ -15,6 +15,33 @@ String jdkPath(String version) {
|
||||
//}
|
||||
|
||||
ext.configureJvmProject = { Project project ->
|
||||
project.configure(project) {
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.kotlin
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
// sourceCompatibility = 1.6
|
||||
// targetCompatibility = 1.6
|
||||
options.fork = true
|
||||
options.forkOptions.javaHome = file(JDK_18)
|
||||
}
|
||||
|
||||
tasks.withType(project.compileKotlin.class) {
|
||||
kotlinOptions.jdkHome = JDK_18
|
||||
doFirst {
|
||||
System.setProperty("kotlin.colors.enabled", "false")
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
executable = "$JDK_16/bin/java"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext.configureJvm6Project = { Project project ->
|
||||
project.configure(project) {
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
|
||||
@@ -2,7 +2,7 @@ description = 'Kotlin Test JUnit'
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ description = 'Kotlin Test'
|
||||
|
||||
apply plugin: 'kotlin-platform-jvm'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -2,7 +2,7 @@ description = 'Kotlin Standard Library'
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
sourceSets {
|
||||
@@ -49,6 +49,10 @@ dependencies {
|
||||
testCompile project(':kotlin-test:kotlin-test-junit')
|
||||
}
|
||||
|
||||
configurations {
|
||||
mainJar
|
||||
}
|
||||
|
||||
task originalStdlibJar(type: Jar) {
|
||||
baseName = 'original-kotlin-stdlib'
|
||||
from sourceSets.main.output
|
||||
@@ -79,6 +83,7 @@ sourcesJar {
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
mainJar jar
|
||||
}
|
||||
|
||||
dist {
|
||||
|
||||
@@ -2,7 +2,7 @@ description = 'Kotlin Standard Library JRE 7 extension'
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -2,7 +2,7 @@ description = 'Kotlin Standard Library JRE 8 extension'
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -15,7 +15,7 @@ buildscript {
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ configurations {
|
||||
proguardDeps
|
||||
shadows
|
||||
compileOnly.extendsFrom(shadows)
|
||||
mainJar
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -174,6 +175,7 @@ task relocatedSourcesJar(type: Jar) {
|
||||
def artifactJar = [file: file(outputJarPath), builtBy: proguard, name: archivesBaseName]
|
||||
|
||||
artifacts {
|
||||
mainJar artifactJar
|
||||
runtime artifactJar
|
||||
archives artifactJar
|
||||
archives relocatedSourcesJar
|
||||
|
||||
@@ -2,7 +2,7 @@ description 'Kotlin Runtime (deprecated, use koltin-stdlib artifact instead)'
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -2,13 +2,17 @@ description 'Kotlin Script Runtime'
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvmProject(project)
|
||||
configureJvm6Project(project)
|
||||
configurePublishing(project)
|
||||
|
||||
dependencies {
|
||||
compileOnly project(':kotlin-stdlib')
|
||||
}
|
||||
|
||||
configurations {
|
||||
mainJar
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
kotlin {
|
||||
@@ -24,9 +28,9 @@ jar {
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
mainJar jar
|
||||
}
|
||||
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user