-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
325 lines (271 loc) · 11 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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask
import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL
buildscript {
repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org' }
gradlePluginPortal()
mavenLocal()
google()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
plugins {
id "org.jetbrains.dokka" version "2.0.0"
}
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
mavenCentral()
google()
}
// This allows you to "Build and run using IntelliJ IDEA", an option in IDEA's Settings.
idea {
module {
outputDir file('build/classes/java/main')
testOutputDir file('build/classes/java/test')
}
}
}
configure(subprojects/* - project(':android')*/) {
apply plugin: 'java-library'
apply plugin: 'kotlin'
sourceCompatibility = 11
targetCompatibility = 11
// From https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/
// The article can be helpful when using assets.txt in your project.
tasks.register('generateAssetList') {
inputs.dir("${project.rootDir}/assets/")
// projectFolder/assets
File assetsFolder = new File("${project.rootDir}/assets/")
// projectFolder/assets/assets.txt
File assetsFile = new File(assetsFolder, "assets.txt")
// delete that file in case we've already created it
assetsFile.delete()
// iterate through all files inside that folder
// convert it to a relative path
// and append it to the file assets.txt
fileTree(assetsFolder).collect { assetsFolder.relativePath(it) }.sort().each {
if ("node_modules" == it) return
if (it.endsWith(".lock")) return
if (it.endsWith(".DS_Store")) return
if (it.startsWith("._")) return
assetsFile.append(it + "\n")
}
}
processResources.dependsOn 'generateAssetList'
compileJava {
options.incremental = true
}
compileKotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
compileTestKotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
}
subprojects {
apply plugin: 'org.jetbrains.dokka'
version = projectVersion + (snapshot == "true" ? "-SNAPSHOT" : "")
ext.appName = 'QuantumVoxel'
group = 'dev.ultreon.quantum'
base {
archivesName = "quantum-${project.name}-v2"
}
repositories {
maven { url 'https://jitpack.io' }
mavenCentral()
maven { url 'https://s01.oss.sonatype.org' }
// You may want to remove the following line if you have errors downloading dependencies.
mavenLocal()
maven { url 'https://maven.fabricmc.net/' }
maven { url 'https://teavm.org/maven/repository/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://oss.sonatype.org/content/repositories/releases/' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
maven {
url = uri("https://maven.pkg.github.com/Ultreon/scriptic-lang")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
java {
withSourcesJar()
}
tasks.register("javadocJar", Jar) {
dependsOn tasks.dokkaJavadoc
archiveClassifier.set("javadoc")
from tasks.dokkaJavadoc
tasks.jar.finalizedBy(it)
tasks.assemble.dependsOn(it)
}
dokkaJavadoc {
outputDirectory.set(file("$buildDir/docs/javadoc"))
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
eclipse.project.name = 'QuantumVoxel' + '-parent'
// Configure dokka to include the client and server source sets
tasks.withType(DokkaTask) {
moduleName.set("Quantum Voxel")
dokkaSourceSets {
configureEach {
classpath.from(subprojects.collect { it.sourceSets.main.compileClasspath })
includeNonPublic.set(true)
skipEmptyPackages.set(true)
externalDocumentationLink {
url.set(uri("https://docs.oracle.com/en/java/javase/17/docs/api/").toURL())
packageListUrl.set(uri("https://docs.oracle.com/en/java/javase/17/docs/api/package-list").toURL())
}
externalDocumentationLink {
url.set(uri("https://javadoc.io/doc/org.lwjgl/lwjgl").toURL())
packageListUrl.set(uri("https://javadoc.io/doc/org.lwjgl/lwjgl/package-list").toURL())
}
externalDocumentationLink {
url.set(uri("https://javadoc.io/doc/org.lwjgl/lwjgl.glfw").toURL())
packageListUrl.set(uri("https://javadoc.io/doc/org.lwjgl/lwjgl.glfw/package-list").toURL())
}
externalDocumentationLink {
url.set(uri("https://javadoc.io/doc/org.lwjgl/lwjgl.opengl").toURL())
packageListUrl.set(uri("https://javadoc.io/doc/org.lwjgl/lwjgl.opengl/package-list").toURL())
}
externalDocumentationLink {
url.set(uri("https://javadoc.io/doc/com.badlogicgames.gdx/gdx").toURL())
packageListUrl.set(uri("https://javadoc.io/doc/com.badlogicgames.gdx/gdx/package-list").toURL())
}
}
create("common") {
displayName.set("Common")
sourceRoots.from("common/src/main/kotlin")
sourceRoots.from("common/src/main/java")
}
create("client") {
displayName.set("Client")
sourceRoots.from("client/src/main/kotlin")
sourceRoots.from("client/src/main/java")
}
create("server") {
displayName.set("Dedicated Server")
sourceRoots.from("server/src/main/kotlin")
sourceRoots.from("server/src/main/java")
}
create("lwjgl3") {
displayName.set("LWJGL3")
sourceRoots.from("lwjgl3/src/main/kotlin")
sourceRoots.from("lwjgl3/src/main/java")
}
create("gameprovider") {
displayName.set("Game Provider")
sourceRoots.from("gameprovider/src/main/kotlin")
sourceRoots.from("gameprovider/src/main/java")
}
}
}
tasks.register('runAnsiConsole', JavaExec) {
classpath = project(":lwjgl3").sourceSets.main.runtimeClasspath
mainClass = 'dev.ultreon.quantum.lwjgl3.ANSIConsole'
group = 'application'
description = 'Run ANSI console test'
}
def publishProjects = [
project(":client"),
project(":common"),
project(":lwjgl3"),
project(":server"),
project(":gameprovider")
]
if (System.getenv("CI") != "true") {
publishProjects.each { project ->
project.mkdir("build/jreleaser")
project.apply plugin: "maven-publish"
project.apply plugin: "java-library"
project.publishing {
repositories {
maven {
name = "Staging"
url = uri("file://${projectDir.path.replace("\\", "/")}/build/staging-deploy")
}
maven {
name = "UltreonMaven"
url = "https://maven.ultreon.dev/releases"
credentials(PasswordCredentials) {
username = findProperty("ultreonmvn.name") ?: System.getenv("ULTREON_MVN_NAME")
password = findProperty("ultreonmvn.secret") ?: System.getenv("ULTREON_MVN_SEC")
}
authentication {
basic(BasicAuthentication)
}
}
}
publications {
create(MavenPublication) { publication ->
from(project.components["java"])
artifact project.tasks["javadocJar"]
groupId = "dev.ultreon.quantum"
artifactId = "quantum-${project.name}-v2"
version = projectVersion
pom {
name = "QuantumVoxel V2"
description = "Quantum Voxel: RecƒQomputed is a voxel game that focuses on technology based survival."
url = "https://github.com/QuantumVoxel/game"
inceptionYear = "2025"
developers {
developer {
id = "XyperCode"
name = "Qubilux"
organization = "Ultreon"
organizationUrl = "https://ultreon.dev/"
roles = ["Owner", "Maintainer"]
url = "https://github.com/XyperCode"
}
}
organization {
name = "Ultreon"
url = "https://ultreon.dev/"
}
issueManagement {
system = "GitHub"
url = "https://github.com/QuantumVoxel/game/issues"
}
scm {
url = "https://github.com/QuantumVoxel/game"
connection = "scm:git:git://github.com/Ultreon/quantum.git"
}
licenses {
license {
name = "Apache-2.0"
url = "https://github.com/QuantumVoxel/game/blob/main/LICENSE"
}
}
contributors {
contributor {
name = "Qubilux"
url = "https://github.com/XyperCode"
roles = ["Author", "Developer"]
}
contributor {
name = "MincraftEinstein"
url = "https://github.com/MincraftEinstein"
roles = ["Tester", "Modeler"]
}
contributor {
name = "guinea7pig"
url = "https://github.com/guinea7pig"
}
}
}
}
}
}
}
}