-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
108 lines (87 loc) · 2.5 KB
/
build.gradle.kts
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
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
plugins {
id("net.neoforged.moddev") version "2.0.1-beta"
}
// Toolchain versions
val minecraftVersion: String = "1.21"
val neoForgeVersion: String = "21.0.167"
val parchmentVersion: String = "2024.07.07"
val parchmentMinecraftVersion: String = "1.21"
val modId: String = "betterfoliage"
val modVersion: String = System.getenv("VERSION") ?: "0.0.0-indev"
val modJavaVersion: String = "21"
val modIsInCI: Boolean = !modVersion.contains("-indev")
val generateModMetadata = tasks.register<ProcessResources>("generateModMetadata") {
val modReplacementProperties = mapOf(
"modId" to modId,
"modVersion" to modVersion,
"minecraftVersionRange" to "[$minecraftVersion,)",
"neoForgeVersionRange" to "[$neoForgeVersion,)"
)
inputs.properties(modReplacementProperties)
expand(modReplacementProperties)
from("src/main/templates")
into(layout.buildDirectory.dir("generated/sources/modMetadata"))
}
base {
archivesName.set("BetterFoliageRenewed-NeoForge-$minecraftVersion")
group = "com.eerussianguy.betterfoliage"
version = modVersion
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(modJavaVersion))
}
repositories {
mavenLocal()
exclusiveContent {
forRepository { maven("https://www.cursemaven.com") }
filter { includeGroup("curse.maven") }
}
}
sourceSets {
main {
resources {
srcDir(generateModMetadata)
}
}
}
dependencies {
}
neoForge {
version.set(neoForgeVersion)
validateAccessTransformers = true
parchment {
minecraftVersion.set(parchmentMinecraftVersion)
mappingsVersion.set(parchmentVersion)
}
runs {
configureEach {
// Only JBR allows enhanced class redefinition, so ignore the option for any other JDKs
jvmArguments.addAll("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition", "-ea")
systemProperty("betterfoliage.enableDebugSelfTests", "true")
}
register("client") {
client()
gameDirectory = file("run/client")
}
}
mods {
create(modId) {
sourceSet(sourceSets.main.get())
}
}
ideSyncTask(generateModMetadata)
}
tasks {
processResources {
}
jar {
manifest {
attributes["Implementation-Version"] = project.version
}
}
named("neoForgeIdeSync") {
dependsOn(generateModMetadata)
}
}