-
Notifications
You must be signed in to change notification settings - Fork 51
/
build.gradle
242 lines (211 loc) · 10.8 KB
/
build.gradle
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven { url 'https://s01.oss.sonatype.org' }
mavenLocal()
google()
}
dependencies {
classpath "io.github.fourlastor:construo:1.5.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0"
}
}
plugins {
id "application"
}
apply plugin: 'io.github.fourlastor.construo'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'kotlin'
apply plugin: 'java-library'
apply plugin: 'application'
apply plugin: 'org.jlleitschuh.gradle.ktlint'
import io.github.fourlastor.construo.Target
version = "$liftoffVersion"
mainClassName = 'gdx.liftoff.Main'
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
kotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8)
def appName = "gdx-liftoff"
def jarName = "$appName-${version}.jar"
jar {
manifest {
attributes 'Main-Class': mainClassName
}
archiveFileName.set(jarName)
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/freebsd/**', 'gdx.dll')
dependencies {
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**', 'META-INF/freebsd/**',
'windows/x86/**', 'META-INF/windows/x86/**')
}
doLast {
file(archiveFile).setExecutable(true, false)
}
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://s01.oss.sonatype.org" }
maven { url 'https://jitpack.io' }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation "org.apache.commons:commons-exec:$commonsExecVersion"
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
implementation ("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"){
exclude group: "org.jcraft", module: "jorbis"
exclude group: "org.lwjgl", module: "lwjgl-openal"
// exclude group: 'org.lwjgl', module: 'lwjgl-glfw'
// exclude group: 'org.lwjgl', module: 'lwjgl-opengl'
// exclude group: 'org.lwjgl', module: 'lwjgl-stb'
// exclude group: 'org.lwjgl', module: 'lwjgl'
// exclude group: 'org.lwjgl', module: 'lwjgl-jemalloc'
}
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation "com.crashinvaders.lml:gdx-kiwi:$lmlVersion"
implementation "com.crashinvaders.lml:gdx-lml:$lmlVersion"
implementation("com.crashinvaders.lml:gdx-lml-vis:$lmlVersion"){ exclude group: "com.kotcrab.vis", module: "vis-ui" }
implementation "com.crashinvaders.lml:gdx-autumn:$lmlVersion"
implementation "com.crashinvaders.lml:gdx-autumn-mvc:$lmlVersion"
implementation "com.crashinvaders.lml:gdx-autumn-desktop-fcs:$lmlVersion"
// implementation "com.kotcrab.vis:vis-ui:$visUiVersion"
implementation "com.github.kotcrab.vis-ui:vis-ui:$visUiVersion"
implementation "com.github.raeleus.TenPatch:tenpatch:5.2.3"
implementation "com.github.raeleus.stripe:stripe:2.0.0"
implementation "com.rafaskoberg.gdx:typing-label:1.4.0"
implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version"
implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version"
implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version"
implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version"
implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version"
implementation "org.lwjgl:lwjgl:$lwjgl3Version"
// Linux //
implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version:natives-linux"
implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version:natives-linux-arm32"
implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version:natives-linux-arm64"
implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version:natives-linux"
implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version:natives-linux-arm32"
implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version:natives-linux-arm64"
implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version:natives-linux"
implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version:natives-linux-arm32"
implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version:natives-linux-arm64"
implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version:natives-linux"
implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version:natives-linux-arm32"
implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version:natives-linux-arm64"
implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-linux"
implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-linux-arm32"
implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-linux-arm64"
implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-linux"
implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-linux-arm32"
implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-linux-arm64"
// MacOS //
implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version:natives-macos"
implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version:natives-macos-arm64"
implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version:natives-macos"
implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version:natives-macos-arm64"
implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version:natives-macos"
implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version:natives-macos-arm64"
implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version:natives-macos"
implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version:natives-macos-arm64"
implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-macos"
implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-macos-arm64"
implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-macos"
implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-macos-arm64"
// Windows //
implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version:natives-windows"
implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version:natives-windows"
implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version:natives-windows"
implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version:natives-windows"
implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-windows"
implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-windows"
// implementation "org.lwjgl:lwjgl-jemalloc:$lwjgl3Version:natives-windows-x86"
// implementation "org.lwjgl:lwjgl-glfw:$lwjgl3Version:natives-windows-x86"
// implementation "org.lwjgl:lwjgl-openal:$lwjgl3Version:natives-windows-x86"
// implementation "org.lwjgl:lwjgl-opengl:$lwjgl3Version:natives-windows-x86"
// implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-windows-x86"
// implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-windows-x86"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows"
// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows-x86"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm32"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm64"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos-arm64"
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows-x86"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm32"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm64"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos-arm64"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
// necessary because the current gdx-autumn-desktop-fcs has an implementation dep on this, and we need it here.
implementation "io.github.lukehutch:fast-classpath-scanner:2.21"
// for some network requests, such as checking the versions of dependencies
implementation "com.github.kittinunf.fuel:fuel:2.3.1"
implementation "org.slf4j:slf4j-nop:2.0.5"
implementation "com.github.tommyettinger:iconizer-gdx:$iconizerVersion"
}
construo {
// name of the executable
name.set(appName)
// human-readable name, used for example in the `.app` name for macOS
humanName.set(appName)
// Optional, defaults to project version
version.set("$project.version")
targets.configure {
create("linuxX64", Target.Linux) {
architecture.set(Target.Architecture.X86_64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz")
}
create("macM1", Target.MacOs) {
architecture.set(Target.Architecture.AARCH64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.12_7.tar.gz")
// macOS needs an identifier
identifier.set("com.libgdx.liftoff." + appName)
// Optional: icon for macOS
macIcon.set(project.file("icons/logo.icns"))
}
create("macX64", Target.MacOs) {
architecture.set(Target.Architecture.X86_64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_mac_hotspot_17.0.12_7.tar.gz")
// macOS needs an identifier
identifier.set("com.libgdx.liftoff." + appName)
// Optional: icon for macOS
macIcon.set(project.file("icons/logo.icns"))
}
create("winX64", Target.Windows) {
architecture.set(Target.Architecture.X86_64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_windows_hotspot_17.0.12_7.zip")
}
}
}
distributions {
main {
contents {
into('lib') {
project.configurations.runtimeClasspath.files.findAll { file ->
file.getName() != project.tasks.jar.outputs.files.singleFile.name
}.each { file ->
exclude file.name
}
}
}
}
}
startScripts.dependsOn('jar')
startScripts.classpath = project.tasks.jar.outputs.files
tasks.register('sample', JavaExec) {
dependsOn classes
setDescription("Generates a sample libGDX project into build/dist/sample")
mainClass.set("gdx.liftoff.Sample")
setClasspath(sourceSets.main.runtimeClasspath)
}
jar.dependsOn('ktlintFormat')