buildscript { repositories { gradlePluginPortal() } dependencies { } } plugins { id "application" } sourceSets.main.resources.srcDirs += [rootProject.file('assets').path] mainClassName = 'org.snoopdesigns.endless.desktop.DesktopLauncher' application.setMainClass(mainClassName) eclipse.project.name = appName + '-desktop' java.sourceCompatibility = 21 java.targetCompatibility = 21 if (JavaVersion.current().isJava9Compatible()) { compileJava.options.release.set(21) } dependencies { implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" implementation project(':core') } def os = System.properties['os.name'].toLowerCase() run { workingDir = rootProject.file('assets').path setIgnoreExitValue(true) } jar { archiveFileName.set("${appName}-${projectVersion}.jar") duplicatesStrategy(DuplicatesStrategy.EXCLUDE) dependsOn configurations.runtimeClasspath from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') dependencies { exclude('META-INF/INDEX.LIST', 'META-INF/maven/**') } manifest { attributes 'Main-Class': project.mainClassName } doLast { file(archiveFile).setExecutable(true, false) } } // Equivalent to the jar task; here for compatibility with gdx-setup. tasks.register('dist') { dependsOn 'jar' } distributions { main { contents { into('libs') { project.configurations.runtimeClasspath.files.findAll { file -> file.getName() != project.tasks.jar.outputs.files.singleFile.name }.each { file -> exclude file.name } } } } } startScripts.dependsOn(':desktop:jar') startScripts.classpath = project.tasks.jar.outputs.files