123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- buildscript {
- repositories {
- mavenCentral()
- gradlePluginPortal()
- }
- dependencies {
- classpath 'org.jreleaser:jreleaser-gradle-plugin:1.18.0'
- }
- }
- ext {
- libgdxVersion = { ->
- def propsFile = new File(project.projectDir, 'gradle.properties')
- if (!propsFile.exists()) {
- throw new GradleException("gradle.properties file not found at ${propsFile.absolutePath}")
- }
- def lines = propsFile.readLines()
- for (line in lines) {
- if (line.startsWith('libgdx_version=')) {
- return line.split('=')[1].trim()
- }
- }
- throw new GradleException("libgdx_version property not found in gradle.properties")
- }()
- isReleaseBuild = {
- return project.hasProperty("RELEASE")
- }
- getSnapshotRepositoryUrl = {
- return project.hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
- : "https://central.sonatype.com/repository/maven-snapshots/"
- }
- getRepositoryUsername = {
- return project.hasProperty('MAVEN_USERNAME') ? MAVEN_USERNAME : ""
- }
- getRepositoryPassword = {
- return project.hasProperty('MAVEN_PASSWORD') ? MAVEN_PASSWORD : ""
- }
- }
- allprojects {
- apply plugin: "java"
- group = 'com.esotericsoftware.spine'
- version = project.getProperty('version')
- sourceSets.main.java.srcDirs = ["src"]
- repositories {
- mavenLocal()
- maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
- maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
- mavenCentral()
- }
- tasks.withType(JavaCompile).configureEach {
- sourceCompatibility = '1.8'
- targetCompatibility = '1.8'
- options.release.set(8)
- }
- }
- project("spine-libgdx") {
- 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
- }
- }
- }
- dependencies {
- implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
- }
- }
- apply from: 'publishing.gradle'
- project("spine-skeletonviewer") {
- jar {
- duplicatesStrategy = DuplicatesStrategy.INCLUDE
- manifest {
- attributes "Main-Class": "com.esotericsoftware.spine.SkeletonViewer"
- }
- from {
- configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
- }
- dependsOn(project(":spine-libgdx").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
- }
- }
- configure(subprojects - project("spine-libgdx")) {
- 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"
- }
- }
- tasks.withType(JavaCompile).configureEach {
- println "Building with sourceCompatibility = ${sourceCompatibility}, targetCompatibility = ${targetCompatibility}"
- }
|