Skip to content

Commit

Permalink
[libgdx] Ensure compatibility with Java 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Aug 19, 2024
1 parent e0796bf commit dffc448
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
22 changes: 14 additions & 8 deletions spine-libgdx/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
group = "com.esotericsoftware.spine"
version = "4.2.0"

ext {
libgdxVersion = "1.12.2-SNAPSHOT"
javaVersion = 8
}

allprojects {
Expand All @@ -17,9 +13,11 @@ allprojects {
mavenCentral()
}

tasks.withType(JavaCompile) {
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
// Set Java 8 compatibility using JDK 17
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
options.release.set(7) // Ensures Java 8 bytecode is produced
}
}

Expand All @@ -46,6 +44,10 @@ project("spine-skeletonviewer") {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}

tasks.named('jar').configure {
dependsOn(project(":spine-libgdx").tasks.named('jar'))
}
}

configure(subprojects - project("spine-libgdx")) {
Expand All @@ -60,4 +62,8 @@ configure(subprojects - project("spine-libgdx")) {
implementation "com.badlogicgames.gdx:gdx-box2d:$libgdxVersion"
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$libgdxVersion:natives-desktop"
}
}
}

tasks.withType(JavaCompile).configureEach {
println "Building with sourceCompatibility = ${sourceCompatibility}, targetCompatibility = ${targetCompatibility}"
}
2 changes: 1 addition & 1 deletion spine-libgdx/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# After publishing via this script, log into https://oss.sonatype.org and release it manually after
# checks pass ("Close -> Release & Drop").
set -e
./gradlew publishReleasePublicationToSonaTypeRepository --info
./gradlew publishReleasePublicationToSonaTypeRepository
6 changes: 4 additions & 2 deletions spine-libgdx/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
ext {
libraryVersion = "4.2.7-SNAPSHOT"
}

project("spine-libgdx") {
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "signing"

def libraryVersion = "4.2.7-SNAPSHOT"

dependencies {
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
}
Expand Down

0 comments on commit dffc448

Please sign in to comment.