-
Notifications
You must be signed in to change notification settings - Fork 47
/
build.gradle
161 lines (142 loc) · 5.81 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven { url 'https://s01.oss.sonatype.org' }
mavenLocal()
google()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0"
}
}
plugins {
id "io.github.fourlastor.construo" version "1.3.0"
id "application"
}
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')
dependencies {
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
}
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"
}
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"
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 "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-macos"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos-arm64"
// 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.11%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz")
}
create("macM1", Target.MacOs) {
architecture.set(Target.Architecture.AARCH64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.11_9.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.11%2B9/OpenJDK17U-jdk_x64_mac_hotspot_17.0.11_9.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.11%2B9/OpenJDK17U-jdk_x64_windows_hotspot_17.0.11_9.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')