diff --git a/src/main/kotlin/gdx/liftoff/data/platforms/Headless.kt b/src/main/kotlin/gdx/liftoff/data/platforms/Headless.kt index de0b2f2c..b4dd4e35 100644 --- a/src/main/kotlin/gdx/liftoff/data/platforms/Headless.kt +++ b/src/main/kotlin/gdx/liftoff/data/platforms/Headless.kt @@ -50,7 +50,7 @@ java.targetCompatibility = ${project.advanced.serverJavaVersion} if (JavaVersion.current().isJava9Compatible()) { compileJava.options.release.set(${project.advanced.serverJavaVersion}) } -${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if(project.advanced.serverJavaVersion == "8") "1_8" else project.advanced.serverJavaVersion) + ")\n" else ""} +${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if (project.advanced.serverJavaVersion == "8") "1_8" else project.advanced.serverJavaVersion) + ")\n" else ""} mainClassName = '${project.basic.rootPackage}.headless.HeadlessLauncher' application.setMainClass(mainClassName) eclipse.project.name = appName + '-headless' diff --git a/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl2.kt b/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl2.kt index 2287b243..4cb67d04 100644 --- a/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl2.kt +++ b/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl2.kt @@ -63,7 +63,7 @@ java.targetCompatibility = ${project.advanced.desktopJavaVersion} if (JavaVersion.current().isJava9Compatible()) { compileJava.options.release.set(${project.advanced.desktopJavaVersion}) } -${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if(project.advanced.desktopJavaVersion == "8") "1_8" else project.advanced.desktopJavaVersion) + ")\n" else ""} +${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if (project.advanced.desktopJavaVersion == "8") "1_8" else project.advanced.desktopJavaVersion) + ")\n" else ""} dependencies { ${joinDependencies(dependencies)}} diff --git a/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl3.kt b/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl3.kt index 85ddd3bd..7f3cf862 100644 --- a/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl3.kt +++ b/src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl3.kt @@ -51,7 +51,7 @@ class Lwjgl3 : Platform { addGradleTaskDescription( project, "jar", - "builds application's runnable jar, which can be found at `$id/build/lib`." + "builds application's runnable jar, which can be found at `$id/build/libs`." ) project.properties["graalHelperVersion"] = "2.0.1" project.properties["enableGraalNative"] = "false" @@ -173,11 +173,10 @@ java.targetCompatibility = ${project.advanced.desktopJavaVersion} if (JavaVersion.current().isJava9Compatible()) { compileJava.options.release.set(${project.advanced.desktopJavaVersion}) } -${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if(project.advanced.desktopJavaVersion == "8") "1_8" else project.advanced.desktopJavaVersion) + ")\n" else ""} +${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if (project.advanced.desktopJavaVersion == "8") "1_8" else project.advanced.desktopJavaVersion) + ")\n" else ""} dependencies { ${joinDependencies(dependencies)}} -def jarName = "${'$'}{appName}-${'$'}{version}.jar" def os = System.properties['os.name'].toLowerCase() run { @@ -188,10 +187,8 @@ run { } jar { -// sets the name of the .jar file this produces to the name of the game or app. - archiveFileName.set(jarName) -// using 'lib' instead of the default 'libs' appears to be needed by jpackageimage. - destinationDirectory = file("${'$'}{project.layout.buildDirectory.asFile.get().absolutePath}/lib") +// sets the name of the .jar file this produces to the name of the game or app, with the version after. + archiveFileName.set("${'$'}{appName}-${'$'}{projectVersion}.jar") // the duplicatesStrategy matters starting in Gradle 7.0; this setting works. duplicatesStrategy(DuplicatesStrategy.EXCLUDE) dependsOn configurations.runtimeClasspath @@ -255,7 +252,7 @@ tasks.register('dist') { distributions { main { contents { - into('lib') { + into('libs') { project.configurations.runtimeClasspath.files.findAll { file -> file.getName() != project.tasks.jar.outputs.files.singleFile.name }.each { file -> diff --git a/src/main/kotlin/gdx/liftoff/data/platforms/Server.kt b/src/main/kotlin/gdx/liftoff/data/platforms/Server.kt index 910be03c..b91fa41b 100644 --- a/src/main/kotlin/gdx/liftoff/data/platforms/Server.kt +++ b/src/main/kotlin/gdx/liftoff/data/platforms/Server.kt @@ -41,7 +41,7 @@ java.targetCompatibility = ${project.advanced.serverJavaVersion} if (JavaVersion.current().isJava9Compatible()) { compileJava.options.release.set(${project.advanced.serverJavaVersion}) } -${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if(project.advanced.serverJavaVersion == "8") "1_8" else project.advanced.serverJavaVersion) + ")\n" else ""} +${if (project.rootGradle.plugins.contains("kotlin")) "kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_" + (if (project.advanced.serverJavaVersion == "8") "1_8" else project.advanced.serverJavaVersion) + ")\n" else ""} mainClassName = '${project.basic.rootPackage}.server.ServerLauncher' application.setMainClass(mainClassName) eclipse.project.name = appName + '-server'