Only use Kotlin 1.6 API and language versions in docs project
To preserve our existing Kotlin 1.3 baseline, we should compile our Kotlin code with Kotlin 1.3 API and language versions. At the same time, we want our documentation to use modern Kotlin. This commit restores the 1.3 convention and overrides it to 1.6 in the docs project. This maintains our Kotlin 1.3 baseline while also allowing the Kotlin code examples to use 1.6 API and language features. Closes gh-29654
This commit is contained in:
@@ -49,8 +49,8 @@ class KotlinConventions {
|
||||
|
||||
private void configure(KotlinCompile compile) {
|
||||
KotlinJvmOptions kotlinOptions = compile.getKotlinOptions();
|
||||
kotlinOptions.setApiVersion("1.6");
|
||||
kotlinOptions.setLanguageVersion("1.6");
|
||||
kotlinOptions.setApiVersion("1.3");
|
||||
kotlinOptions.setLanguageVersion("1.3");
|
||||
kotlinOptions.setJvmTarget("1.8");
|
||||
kotlinOptions.setAllWarningsAsErrors(true);
|
||||
List<String> freeCompilerArgs = new ArrayList<>(compile.getKotlinOptions().getFreeCompilerArgs());
|
||||
|
||||
@@ -40,6 +40,11 @@ plugins.withType(EclipsePlugin) {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.apiVersion = '1.6'
|
||||
kotlinOptions.languageVersion = '1.6'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
actuatorApiDocumentation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure", configuration: "documentation"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user