2018-02-23 20:36:13 +07:00
|
|
|
apply plugin: "kotlin"
|
2017-11-22 05:09:35 +07:00
|
|
|
|
|
|
|
sourceCompatibility = 1.6
|
|
|
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
|
|
|
|
2019-11-15 04:54:52 +07:00
|
|
|
project.ext.mainClassName = "com.unciv.app.desktop.DesktopLauncher"
|
2018-02-23 17:57:52 +07:00
|
|
|
project.ext.assetsDir = new File("../android/assets")
|
2019-11-22 04:01:38 +07:00
|
|
|
project.ext.discordDir = new File("discord_rpc")
|
2017-11-22 05:09:35 +07:00
|
|
|
|
|
|
|
task run(dependsOn: classes, type: JavaExec) {
|
|
|
|
main = project.mainClassName
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
standardInput = System.in
|
|
|
|
workingDir = project.assetsDir
|
|
|
|
ignoreExitValue = true
|
|
|
|
}
|
|
|
|
|
|
|
|
task debug(dependsOn: classes, type: JavaExec) {
|
|
|
|
main = project.mainClassName
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
standardInput = System.in
|
|
|
|
workingDir = project.assetsDir
|
|
|
|
ignoreExitValue = true
|
|
|
|
debug = true
|
|
|
|
}
|
|
|
|
|
2019-11-24 02:35:03 +07:00
|
|
|
task dist(dependsOn: classes, type: Jar) {
|
2017-11-22 05:09:35 +07:00
|
|
|
from files(sourceSets.main.output.resourcesDir)
|
2019-11-12 04:17:12 +07:00
|
|
|
from files(sourceSets.main.output.classesDirs)
|
|
|
|
// see Laurent1967's comment on https://github.com/libgdx/libgdx/issues/5491
|
|
|
|
from {configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }}
|
2018-02-23 17:57:52 +07:00
|
|
|
from files(project.assetsDir)
|
2019-11-22 04:01:38 +07:00
|
|
|
// This is for the .dll and .so files to ake the Discord RPC work on all desktops
|
|
|
|
from files(project.discordDir)
|
2019-11-15 14:27:13 +07:00
|
|
|
archiveFileName = "${appName}.jar"
|
2017-11-22 05:09:35 +07:00
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes 'Main-Class': project.mainClassName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-24 02:35:03 +07:00
|
|
|
//task packrWindows(){
|
|
|
|
// PackrConfig config = new PackrConfig();
|
|
|
|
// config.platform = PackrConfig.Platform.Windows32;
|
|
|
|
// config.jdk = "/User/badlogic/Downloads/openjdk-for-mac.zip";
|
|
|
|
// config.executable = "myapp";
|
|
|
|
// config.classpath = Arrays.asList("myjar.jar");
|
|
|
|
// config.removePlatformLibs = config.classpath;
|
|
|
|
// config.mainClass = "com.my.app.MainClass";
|
|
|
|
// config.vmArgs = Arrays.asList("Xmx1G");
|
|
|
|
// config.minimizeJre = "soft";
|
|
|
|
// config.outDir = new File("out-mac");
|
|
|
|
//
|
|
|
|
// new Packr().pack(config);
|
|
|
|
//}
|
2017-11-22 05:09:35 +07:00
|
|
|
|
|
|
|
eclipse {
|
|
|
|
project {
|
|
|
|
name = appName + "-desktop"
|
|
|
|
linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
|
|
|
|
doLast {
|
|
|
|
def classpath = new XmlParser().parse(file(".classpath"))
|
2018-02-23 17:57:52 +07:00
|
|
|
new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ])
|
2017-11-22 05:09:35 +07:00
|
|
|
def writer = new FileWriter(file(".classpath"))
|
|
|
|
def printer = new XmlNodePrinter(new PrintWriter(writer))
|
|
|
|
printer.setPreserveWhitespace(true)
|
|
|
|
printer.print(classpath)
|
|
|
|
}
|
|
|
|
}
|
2019-11-24 02:35:03 +07:00
|
|
|
//
|
|
|
|
//dependencies {
|
|
|
|
// implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
|
|
|
// implementation project(path: ':core')
|
|
|
|
//}
|