Fix the build against JDK 20 (#3323)

When using JDK 20, the following error would occur when attempting to
build or run tests:

```
Execution failed for task ':codegen-client:compileKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileJava' (20) and 'compileKotlin' (11).
```

This PR explicitly sets the Java source and target versions to fix this
error.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This commit is contained in:
John DiSanti 2023-12-15 08:18:36 -08:00 committed by GitHub
parent e7e2419ff8
commit 952b7d8943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 50 additions and 0 deletions

View File

@ -12,6 +12,11 @@ group = "software.amazon.aws.rustruntime"
version = "0.0.3"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.jar {
from("./") {
include("aws-inlineable/src/*.rs")

View File

@ -12,6 +12,11 @@ plugins {
id("software.amazon.smithy")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
val smithyVersion: String by project
val defaultRustDocFlags: String by project
val properties = PropertyRetriever(rootProject, project)

View File

@ -30,6 +30,11 @@ dependencies {
implementation("software.amazon.smithy:smithy-aws-endpoints:$smithyVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.compileKotlin {
kotlinOptions.jvmTarget = "11"
}

View File

@ -18,6 +18,11 @@ plugins {
id("software.amazon.smithy")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
configure<software.amazon.smithy.gradle.SmithyExtension> {
smithyBuildConfigs = files(layout.buildDirectory.file("smithy-build.json"))
allowUnknownTraits = true

View File

@ -34,6 +34,11 @@ dependencies {
testImplementation("software.amazon.smithy:smithy-validation-model:$smithyVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.compileKotlin {
kotlinOptions.jvmTarget = "11"
}

View File

@ -97,6 +97,11 @@ val generateSmithyRuntimeCrateVersion by tasks.registering {
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.compileKotlin {
kotlinOptions.jvmTarget = "11"
dependsOn(generateSmithyRuntimeCrateVersion)

View File

@ -32,6 +32,11 @@ dependencies {
testImplementation("software.amazon.smithy:smithy-validation-model:$smithyVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.compileKotlin { kotlinOptions.jvmTarget = "11" }
// Reusable license copySpec

View File

@ -32,6 +32,11 @@ dependencies {
testImplementation("software.amazon.smithy:smithy-validation-model:$smithyVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.compileKotlin { kotlinOptions.jvmTarget = "11" }
// Reusable license copySpec

View File

@ -29,6 +29,11 @@ dependencies {
implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.compileKotlin { kotlinOptions.jvmTarget = "11" }
// Reusable license copySpec

View File

@ -13,6 +13,11 @@ group = "software.amazon.rustruntime"
version = "0.0.3"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.jar {
from("./") {
include("inlineable/src/")