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 ->
|
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) {
|
project.configure(project) {
|
||||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||||
classifier = 'sources'
|
classifier = 'sources'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ description = 'Kotlin Test JUnit'
|
|||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ description = 'Kotlin Test'
|
|||||||
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ description = 'Kotlin Standard Library'
|
|||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -49,6 +49,10 @@ dependencies {
|
|||||||
testCompile project(':kotlin-test:kotlin-test-junit')
|
testCompile project(':kotlin-test:kotlin-test-junit')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
mainJar
|
||||||
|
}
|
||||||
|
|
||||||
task originalStdlibJar(type: Jar) {
|
task originalStdlibJar(type: Jar) {
|
||||||
baseName = 'original-kotlin-stdlib'
|
baseName = 'original-kotlin-stdlib'
|
||||||
from sourceSets.main.output
|
from sourceSets.main.output
|
||||||
@@ -79,6 +83,7 @@ sourcesJar {
|
|||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
archives javadocJar
|
archives javadocJar
|
||||||
|
mainJar jar
|
||||||
}
|
}
|
||||||
|
|
||||||
dist {
|
dist {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ description = 'Kotlin Standard Library JRE 7 extension'
|
|||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ description = 'Kotlin Standard Library JRE 8 extension'
|
|||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ buildscript {
|
|||||||
apply plugin: 'com.github.johnrengelman.shadow'
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
|
|
||||||
@@ -42,6 +42,7 @@ configurations {
|
|||||||
proguardDeps
|
proguardDeps
|
||||||
shadows
|
shadows
|
||||||
compileOnly.extendsFrom(shadows)
|
compileOnly.extendsFrom(shadows)
|
||||||
|
mainJar
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -174,6 +175,7 @@ task relocatedSourcesJar(type: Jar) {
|
|||||||
def artifactJar = [file: file(outputJarPath), builtBy: proguard, name: archivesBaseName]
|
def artifactJar = [file: file(outputJarPath), builtBy: proguard, name: archivesBaseName]
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
|
mainJar artifactJar
|
||||||
runtime artifactJar
|
runtime artifactJar
|
||||||
archives artifactJar
|
archives artifactJar
|
||||||
archives relocatedSourcesJar
|
archives relocatedSourcesJar
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ description 'Kotlin Runtime (deprecated, use koltin-stdlib artifact instead)'
|
|||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -2,13 +2,17 @@ description 'Kotlin Script Runtime'
|
|||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
configureJvmProject(project)
|
configureJvm6Project(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly project(':kotlin-stdlib')
|
compileOnly project(':kotlin-stdlib')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
mainJar
|
||||||
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
kotlin {
|
kotlin {
|
||||||
@@ -24,9 +28,9 @@ jar {
|
|||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
archives javadocJar
|
archives javadocJar
|
||||||
|
mainJar jar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dist {
|
dist {
|
||||||
from (jar, sourcesJar)
|
from (jar, sourcesJar)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user