apply plugin: "kotlin" sourceCompatibility = 1.6 sourceSets.main.java.srcDirs = [ "src/" ] project.ext.mainClassName = "com.unciv.app.desktop.DesktopLauncher" project.ext.assetsDir = new File("../android/assets") 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) { from files(sourceSets.main.output.resourcesDir) 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) }} from files(project.assetsDir) archiveFileName = "${appName}.jar" 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")) new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]) def writer = new FileWriter(file(".classpath")) def printer = new XmlNodePrinter(new PrintWriter(writer)) printer.setPreserveWhitespace(true) printer.print(classpath) } } dependencies { implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" implementation project(path: ':core') }