Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting jvm-1.8 for plugin jar #123

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ version = providers
.exec { commandLine("git", "describe", "--tags", "--always") }
.standardOutput.asText.get().trim().removePrefix("v")

java.toolchain.languageVersion = JavaLanguageVersion.of(libs.versions.java.get())
// Stay at Java 8 to workaround the Gradle when compiling buildscripts and using our `inline` functions:
// `Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8` issue
// https://github.com/gmazzo/gradle-buildconfig-plugin/issues/120
java.toolchain.languageVersion = JavaLanguageVersion.of(8)

kotlin {
compilerOptions {
freeCompilerArgs.add("-Xjvm-default=all",)
freeCompilerArgs.add("-Xjvm-default=all")
}
}

Expand Down Expand Up @@ -61,6 +64,7 @@ tasks.withType<Test> {
dependsOn("publishAllPublicationsToLocalRepository")
workingDir = temporaryDir
useJUnitPlatform()
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(libs.versions.java.get()) }
doLast { Thread.sleep(5000) } // allows GradleRunner to store JaCoCo data before computing task outputs
}

Expand Down