[libgdx] Gradle and Maven updated to Java 16.

This commit is contained in:
Nathan Sweet 2025-03-29 18:12:27 -04:00
parent 79c832793d
commit d474e0d66a
3 changed files with 131 additions and 131 deletions

View File

@ -1,84 +1,84 @@
ext {
libgdxVersion = "1.12.2-SNAPSHOT"
libgdxVersion = "1.12.2-SNAPSHOT"
}
allprojects {
apply plugin: "java"
apply plugin: "java"
sourceSets.main.java.srcDirs = ["src"]
sourceSets.main.java.srcDirs = ["src"]
repositories {
mavenLocal()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
}
repositories {
mavenLocal()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
options.release.set(7) // Ensures Java 8 bytecode is produced
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '16'
targetCompatibility = '16'
options.release.set(16)
}
}
project("spine-libgdx") {
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "signing"
sourceSets {
main {
resources {
srcDirs = ["src"] // Add this line to include non-Java files from src directory
include "**/*.gwt.xml" // Add this to specifically include GWT module files
}
}
}
sourceSets {
main {
resources {
srcDirs = ["src"] // Add this line to include non-Java files from src directory
include "**/*.gwt.xml" // Add this to specifically include GWT module files
}
}
}
dependencies {
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
}
dependencies {
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
}
}
apply from: 'publishing.gradle'
project("spine-skeletonviewer") {
jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes "Main-Class": "com.esotericsoftware.spine.SkeletonViewer"
}
manifest {
attributes "Main-Class": "com.esotericsoftware.spine.SkeletonViewer"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
dependsOn(project(":spine-libgdx").tasks.named('jar'))
}
dependsOn(project(":spine-libgdx").tasks.named('jar'))
}
tasks.named('build').configure {
dependsOn(tasks.named('jar'))
}
tasks.named('build').configure {
dependsOn(tasks.named('jar'))
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.release.set(8) // Ensures Java 8 bytecode is produced
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '16'
targetCompatibility = '16'
options.release.set(16)
}
}
configure(subprojects - project("spine-libgdx")) {
sourceSets.main.resources.srcDirs = ["assets"]
sourceSets.main.resources.srcDirs = ["assets"]
dependencies {
implementation project(":spine-libgdx")
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$libgdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$libgdxVersion"
implementation "com.badlogicgames.gdx:gdx-box2d:$libgdxVersion"
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$libgdxVersion:natives-desktop"
}
dependencies {
implementation project(":spine-libgdx")
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$libgdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$libgdxVersion"
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}"
println "Building with sourceCompatibility = ${sourceCompatibility}, targetCompatibility = ${targetCompatibility}"
}

View File

@ -1,89 +1,89 @@
ext {
libraryVersion = "4.2.9-SNAPSHOT"
libraryVersion = "4.2.9-SNAPSHOT"
}
project("spine-libgdx") {
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "signing"
dependencies {
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
}
dependencies {
implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
}
tasks.register("sourceJar", Jar) {
archiveClassifier.set("sources")
from(sourceSets.main.allJava)
}
tasks.register("sourceJar", Jar) {
archiveClassifier.set("sources")
from(sourceSets.main.allJava)
}
tasks.javadoc {
failOnError = false
}
tasks.javadoc {
failOnError = false
}
tasks.register("javadocJar", Jar) {
dependsOn javadoc
archiveClassifier.set("javadoc")
from(javadoc.destinationDir)
}
tasks.register("javadocJar", Jar) {
dependsOn javadoc
archiveClassifier.set("javadoc")
from(javadoc.destinationDir)
}
afterEvaluate {
publishing {
publications {
create("release", MavenPublication) {
from(components.java)
artifact(tasks.getByName("sourceJar"))
artifact(tasks.getByName("javadocJar"))
afterEvaluate {
publishing {
publications {
create("release", MavenPublication) {
from(components.java)
artifact(tasks.getByName("sourceJar"))
artifact(tasks.getByName("javadocJar"))
groupId = "com.esotericsoftware.spine"
artifactId = "spine-libgdx"
version = libraryVersion
groupId = "com.esotericsoftware.spine"
artifactId = "spine-libgdx"
version = libraryVersion
pom {
packaging = "jar"
name.set("spine-libgdx")
description.set("Spine Runtime for libGDX")
url.set("https://github.com/esotericsoftware/spine-runtimes")
licenses {
license {
name.set("Spine Runtimes License")
url.set("https://esotericsoftware.com/spine-runtimes-license")
}
}
developers {
developer {
name.set("Esoteric Software")
email.set("contact@esotericsoftware.com")
}
}
scm {
url.set(pom.url.get())
connection.set("scm:git:${url.get()}.git")
developerConnection.set("scm:git:${url.get()}.git")
}
}
}
}
pom {
packaging = "jar"
name.set("spine-libgdx")
description.set("Spine Runtime for libGDX")
url.set("https://github.com/esotericsoftware/spine-runtimes")
licenses {
license {
name.set("Spine Runtimes License")
url.set("https://esotericsoftware.com/spine-runtimes-license")
}
}
developers {
developer {
name.set("Esoteric Software")
email.set("contact@esotericsoftware.com")
}
}
scm {
url.set(pom.url.get())
connection.set("scm:git:${url.get()}.git")
developerConnection.set("scm:git:${url.get()}.git")
}
}
}
}
repositories {
maven {
name = "SonaType"
url = uri(libraryVersion.endsWith("-SNAPSHOT") ?
"https://oss.sonatype.org/content/repositories/snapshots" :
"https://oss.sonatype.org/service/local/staging/deploy/maven2")
repositories {
maven {
name = "SonaType"
url = uri(libraryVersion.endsWith("-SNAPSHOT") ?
"https://oss.sonatype.org/content/repositories/snapshots" :
"https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = project.findProperty("ossrhUsername")
password = project.findProperty("ossrhPassword")
}
}
}
}
credentials {
username = project.findProperty("ossrhUsername")
password = project.findProperty("ossrhPassword")
}
}
}
}
if (!libraryVersion.endsWith("-SNAPSHOT")) {
signing {
useGpgCmd()
sign(publishing.publications["release"])
}
}
}
if (!libraryVersion.endsWith("-SNAPSHOT")) {
signing {
useGpgCmd()
sign(publishing.publications["release"])
}
}
}
}

View File

@ -76,8 +76,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>16</source>
<target>16</target>
<fork>true</fork>
<showWarnings>true</showWarnings>
</configuration>