mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-08 14:26:17 +07:00
Upgraded ds1viewer to application plugin
This commit is contained in:
parent
0ad7a44f16
commit
f6afbd165f
@ -1,13 +1,13 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'application'
|
||||||
import org.apache.tools.ant.taskdefs.condition.Os
|
|
||||||
|
|
||||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||||
|
|
||||||
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
|
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
|
||||||
|
|
||||||
project.ext.mainClassName = 'com.riiablo.map.DS1Viewer'
|
project.ext {
|
||||||
project.ext.visuiVersion = '1.4.0'
|
visuiVersion = '1.4.0'
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':core')
|
implementation project(':core')
|
||||||
@ -18,24 +18,35 @@ dependencies {
|
|||||||
implementation "com.kotcrab.vis:vis-ui:$visuiVersion"
|
implementation "com.kotcrab.vis:vis-ui:$visuiVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
task run(dependsOn: classes, type: JavaExec) {
|
application {
|
||||||
main = project.mainClassName
|
mainClass = 'com.riiablo.map.DS1Viewer'
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
|
||||||
standardInput = System.in
|
|
||||||
workingDir = rootProject.file('assets').path
|
|
||||||
ignoreExitValue = true
|
|
||||||
|
|
||||||
if(Os.isFamily(Os.FAMILY_MAC))
|
|
||||||
jvmArgs += "-XstartOnFirstThread"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task dist(dependsOn: classes, type: Jar) {
|
run {
|
||||||
from files(sourceSets.main.output.classesDirs)
|
workingDir = rootProject.file('assets').path
|
||||||
from files(sourceSets.main.output.resourcesDir)
|
setIgnoreExitValue(true)
|
||||||
from { configurations.compile.collect { zipTree(it) } }
|
|
||||||
from files(rootProject.file('assets').path);
|
|
||||||
|
|
||||||
manifest {
|
// Required to run LWJGL3 java apps on MacOS
|
||||||
attributes 'Main-Class': project.mainClassName
|
if (org.gradle.internal.os.OperatingSystem.current() == org.gradle.internal.os.OperatingSystem.MAC_OS) {
|
||||||
|
jvmArgs += "-XstartOnFirstThread"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
archiveBaseName = project.name
|
||||||
|
// 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/**')
|
||||||
|
dependsOn configurations.runtimeClasspath
|
||||||
|
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||||
|
manifest {
|
||||||
|
attributes 'Main-Class': application.mainClass
|
||||||
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
file(archiveFile).setExecutable(true, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user