Эх сурвалжийг харах

[libgdx] Ensure compatibility with Java 7.

Mario Zechner 1 жил өмнө
parent
commit
dffc4484f1

+ 14 - 8
spine-libgdx/build.gradle

@@ -1,9 +1,5 @@
-group = "com.esotericsoftware.spine"
-version = "4.2.0"
-
 ext {
     libgdxVersion = "1.12.2-SNAPSHOT"
-    javaVersion = 8
 }
 
 allprojects {
@@ -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
     }
 }
 
@@ -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")) {
@@ -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}"
+}

+ 1 - 1
spine-libgdx/publish.sh

@@ -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

+ 4 - 2
spine-libgdx/publishing.gradle

@@ -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"
     }