2024-04-20 17:30:56 +01:00
|
|
|
sourceCompatibility = 1.20
|
2024-04-20 12:58:06 +01:00
|
|
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
|
|
|
sourceSets.main.resources.srcDirs = ["../assets"]
|
|
|
|
|
|
|
|
project.ext.mainClassName = "com.monjaro.gamejam.DesktopLauncher"
|
|
|
|
project.ext.assetsDir = new File("../assets")
|
|
|
|
|
|
|
|
import org.gradle.internal.os.OperatingSystem
|
|
|
|
|
|
|
|
tasks.register('run', JavaExec) {
|
|
|
|
dependsOn classes
|
|
|
|
mainClass = project.mainClassName
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
standardInput = System.in
|
|
|
|
workingDir = project.assetsDir
|
|
|
|
ignoreExitValue = true
|
|
|
|
|
|
|
|
if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
|
|
|
|
// Required to run on macOS
|
|
|
|
jvmArgs += "-XstartOnFirstThread"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register('debug', JavaExec) {
|
|
|
|
dependsOn classes
|
|
|
|
mainClass = project.mainClassName
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
standardInput = System.in
|
|
|
|
workingDir = project.assetsDir
|
|
|
|
ignoreExitValue = true
|
|
|
|
debug = true
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register('dist', Jar) {
|
|
|
|
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
|
|
|
manifest {
|
|
|
|
attributes 'Main-Class': project.mainClassName
|
|
|
|
}
|
|
|
|
dependsOn configurations.runtimeClasspath
|
|
|
|
from {
|
|
|
|
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
|
|
|
}
|
|
|
|
with jar
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dist.dependsOn classes
|
|
|
|
|
|
|
|
eclipse.project.name = appName + "-desktop"
|