Skip to content

Commit

Permalink
Use a variable for the java version
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Jul 24, 2024
1 parent 2cf946f commit 0da7187
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ group = "net.slqmy.template_paper_plugin"
version = "1.0.0-SNAPSHOT"
description = "Test plugin for paperweight-userdev"

val javaVersion = 21

java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 21 on systems that only have JDK 11 installed for example.
toolchain.languageVersion = JavaLanguageVersion.of(21)
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
}

// 1)
Expand All @@ -39,7 +41,7 @@ tasks {
compileJava {
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release = 21
options.release = javaVersion
}
javadoc {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
Expand Down

0 comments on commit 0da7187

Please sign in to comment.