Skip to content

Commit

Permalink
chore(build): Declare our Java target in one central place
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Jan 24, 2024
1 parent 7808c91 commit ed34adb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ plugins {
alias(libs.plugins.nexusPublish)
}

val javaTarget: String by project
val ap by sourceSets.registering {
compileClasspath += sourceSets.main.get().compileClasspath + sourceSets.main.get().output
}
Expand Down Expand Up @@ -127,7 +128,7 @@ dependencies {

tasks {
genEventImpl {
sourceCompatibility = "17"
sourceCompatibility = javaTarget
destinationDirectory = project.layout.buildDirectory.dir("generated/event-factory")

outputFactory = "org.spongepowered.api.event.SpongeEventFactory"
Expand Down Expand Up @@ -241,7 +242,7 @@ spongeConvention {

indra {
javaVersions {
target(17)
target(javaTarget.toInt())
}
checkstyle(libs.versions.checkstyle.get())

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version=11.0.0-SNAPSHOT
organization=SpongePowered
projectUrl=https://www.spongepowered.org
projectDescription=A plugin API for Minecraft: Java Edition
javaTarget=17

javadocPublishRoot=https://jd.spongepowered.org/

Expand Down

0 comments on commit ed34adb

Please sign in to comment.