Skip to content

Commit

Permalink
Configure release for Groovy compilation tasks as well
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Jun 20, 2021
1 parent ae607de commit 931ecaa
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions buildSrc/src/main/kotlin/java-library-conventions.gradle.kts
Expand Up @@ -279,12 +279,20 @@ afterEvaluate {
}
pluginManager.withPlugin("groovy") {
tasks.named<GroovyCompile>("compileGroovy").configure {
sourceCompatibility = extension.mainJavaVersion.majorVersion
targetCompatibility = extension.mainJavaVersion.majorVersion
if (extension.configureRelease) {
options.release.set(extension.mainJavaVersion.majorVersion.toInt())
} else {
sourceCompatibility = extension.mainJavaVersion.majorVersion
targetCompatibility = extension.mainJavaVersion.majorVersion
}
}
tasks.named<GroovyCompile>("compileTestGroovy").configure {
sourceCompatibility = extension.testJavaVersion.majorVersion
targetCompatibility = extension.testJavaVersion.majorVersion
if (extension.configureRelease) {
options.release.set(extension.testJavaVersion.majorVersion.toInt())
} else {
sourceCompatibility = extension.testJavaVersion.majorVersion
targetCompatibility = extension.testJavaVersion.majorVersion
}
}
}
}
Expand Down

0 comments on commit 931ecaa

Please sign in to comment.