2018-02-23 13:36:13 +00:00
|
|
|
apply plugin: "kotlin"
|
2017-11-21 22:09:35 +00:00
|
|
|
|
|
|
|
sourceCompatibility = 1.6
|
|
|
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
|
|
|
|
|
|
|
project.ext.mainClassName = "DesktopLauncher"
|
2018-02-23 10:57:52 +00:00
|
|
|
project.ext.assetsDir = new File("../android/assets")
|
2017-11-21 22:09:35 +00: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
|
|
|
|
}
|
|
|
|
|
|
|
|
task dist(type: Jar) {
|
2019-04-24 06:47:33 +00:00
|
|
|
from files(sourceSets.main.output.classesDirs)
|
2017-11-21 22:09:35 +00:00
|
|
|
from files(sourceSets.main.output.resourcesDir)
|
|
|
|
from {configurations.compile.collect {zipTree(it)}}
|
2018-02-23 10:57:52 +00:00
|
|
|
from files(project.assetsDir)
|
2017-11-21 22:09:35 +00:00
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes 'Main-Class': project.mainClassName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dist.dependsOn classes
|
|
|
|
|
|
|
|
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 10:57:52 +00:00
|
|
|
new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ])
|
2017-11-21 22:09:35 +00:00
|
|
|
def writer = new FileWriter(file(".classpath"))
|
|
|
|
def printer = new XmlNodePrinter(new PrintWriter(writer))
|
|
|
|
printer.setPreserveWhitespace(true)
|
|
|
|
printer.print(classpath)
|
|
|
|
}
|
|
|
|
}
|
2018-04-11 20:46:00 +00:00
|
|
|
|
|
|
|
dependencies {
|
2018-05-01 18:41:02 +00:00
|
|
|
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
2018-04-11 20:46:00 +00:00
|
|
|
compile project(path: ':core')
|
|
|
|
}
|