riiablo/desktop/build.gradle

57 lines
2.0 KiB
Groovy
Raw Normal View History

apply plugin: 'java'
2020-11-18 16:26:57 +07:00
apply plugin: 'application'
2020-11-18 16:26:57 +07:00
import org.gradle.internal.os.OperatingSystem
2019-01-12 16:04:56 +07:00
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
dependencies {
implementation project(':core')
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
2019-01-12 16:04:56 +07:00
implementation "commons-cli:commons-cli:$cliVersion"
}
2019-01-12 16:04:56 +07:00
2020-11-18 16:26:57 +07:00
application {
mainClass = 'com.riiablo.DesktopLauncher'
}
run {
workingDir = rootProject.file('assets').path
2020-11-18 16:26:57 +07:00
setIgnoreExitValue(true)
2020-11-18 16:26:57 +07:00
// Required to run LWJGL3 java apps on MacOS
2020-11-24 07:37:02 +07:00
if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
jvmArgs += "-XstartOnFirstThread"
}
2019-01-12 16:04:56 +07:00
}
2020-11-18 16:26:57 +07:00
jar {
archiveBaseName = appName
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
2020-11-24 07:37:02 +07:00
// These can be excluded because they add to the jar size but libGDX 1.9.11 can't use them.
// If your libGDX version is 1.9.10 or earlier, or is 1.9.12-SNAPSHOT or later, you can leave
// the following line commented; if you use 1.9.11 exactly, or if you use 1.9.12-SNAPSHOT but
// don't need ARM Linux support, you can uncomment it safely.
// It's always safe to keep that line commented out; it only affects JAR size.
// exclude('linux/arm32/**', 'linux/arm64/**')
exclude('data/global/excel/*.bin') // generated bins
exclude('data/*.ods') // source files for excel tables
exclude('lang/*.txt') // source files for i18n tables
exclude('test/**') // test resources
2020-11-24 07:37:02 +07:00
dependsOn configurations.runtimeClasspath
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
manifest {
attributes 'Main-Class': application.mainClass
}
doLast {
file(archiveFile).setExecutable(true, false)
}
2019-01-12 16:04:56 +07:00
}