-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
87 lines (75 loc) · 2.45 KB
/
build.gradle
File metadata and controls
87 lines (75 loc) · 2.45 KB
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
plugins {
id 'java'
id("io.freefair.lombok") version "9.2.0"
id("com.osmerion.lwjgl3") version "0.6.0"
}
group = 'com.james090500.client'
version = project.version
java {
toolchain { languageVersion = JavaLanguageVersion.of(25) }
}
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
implementation 'org.cloudburstmc.fastutil.maps:object-object-maps:8.5.15'
implementation 'org.cloudburstmc.fastutil.maps:object-int-maps:8.5.15'
implementation 'org.cloudburstmc.fastutil.maps:int-object-maps:8.5.15'
implementation 'org.cloudburstmc.fastutil.maps:int-int-maps:8.5.15'
implementation "org.joml:joml:1.10.8"
implementation 'at.yawk.lz4:lz4-java:1.10.4'
implementation 'io.netty:netty-all:4.2.10.Final'
}
lwjgl3 {
targets.named("main") {
// Modules
modules.add("lwjgl")
modules.add("lwjgl-glfw")
modules.add("lwjgl-opengl")
modules.add("lwjgl-stb")
modules.add("lwjgl-nanovg")
modules.add("lwjgl-openal")
// Platforms (includes natives for each target)
macosARM64()
macosX64()
windowsX64()
linuxX64()
}
}
// Builds the JAr
tasks.withType(Jar).configureEach {
archiveBaseName.set(project.findProperty("archivesBaseName") ?: project.name)
archiveVersion.set(project.version) // already includes -<sha> when dev=true
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}
tasks.register("generateAssetManifest") {
def inputDir = file("src/main/resources/assets")
def outputFile = file("src/main/resources/assets.txt")
doLast {
if (!inputDir.exists()) return
def lines = []
inputDir.eachFileRecurse { file ->
if (file.isFile()) {
def relativePath = file.path - inputDir.path - File.separator
lines << relativePath.replace(File.separator, "/")
}
}
outputFile.text = lines.join("\n")
println "Generated files.txt with ${lines.size()} entries"
}
}
tasks.register("publishToWorld", Exec) {
executable = 'powershell'
args = ['-File', 'scripts/PublishBuild.ps1']
}
// Make sure this runs before processing resources
processResources.dependsOn(tasks.generateAssetManifest)