blob: 45e239fbf885f8a84ca2244485ab785c9b51af52 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
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 "com.badlogicgames.gdx:gdx-freetype-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
|