-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle.kts
166 lines (146 loc) · 4.88 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
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
import me.modmuss50.mpp.ReleaseType
import java.time.LocalDateTime
plugins {
`maven-publish`
id("net.neoforged.moddev") version "2.0.1-beta"
id("me.modmuss50.mod-publish-plugin") version "0.5.+"
id("wtf.gofancy.git-changelog") version "1.1.+"
id("org.moddedmc.wiki.toolkit") version "0.2.4"
}
group = "dev.su5ed.mffs"
version = changelog.getVersionFromTag()
val curseForgeId: String by project
val modrinthId: String by project
val versionJei: String by project
val versionTOP: String by project
val versionPatchouli: String by project
val versionStreamex: String by project
val versionMc: String by project
val neoVersion: String by project
val parchmentVersion: String by project
val modId: String by project
val CI: Provider<String> = providers.environmentVariable("CI")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(21))
println("Configured version: $version, Java: ${System.getProperty("java.version")}, JVM: ${System.getProperty("java.vm.version")} (${System.getProperty("java.vendor")}), Arch: ${System.getProperty("os.arch")}")
neoForge {
version = neoVersion
accessTransformers {
from(project.file("src/main/resources/META-INF/accesstransformer.cfg"))
}
parchment {
mappingsVersion = parchmentVersion
minecraftVersion = versionMc
}
runs {
configureEach {
systemProperty("forge.logging.markers", "REGISTRIES")
systemProperty("forge.logging.console.level", "debug")
}
create("client") {
client()
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty("forge.enabledGameTestNamespaces", modId)
}
create("server") {
server()
systemProperty("forge.enabledGameTestNamespaces", modId)
programArgument("--nogui")
}
create("data") {
data()
programArguments.addAll(
"--mod",
modId,
"--all",
"--output",
file("src/generated/resources/").absolutePath,
"--existing",
file("src/main/resources/").absolutePath
)
}
}
mods {
create("mffs") {
sourceSet(sourceSets.main.get())
}
}
}
wiki {
docs {
register("mffs") {
exportedAssetNamespaces.add("mffs")
root = file("docs/mffs")
}
}
}
sourceSets.main {
resources {
srcDir("src/generated/resources")
}
}
repositories {
maven {
name = "Jared"
url = uri("https://maven.blamejared.com/")
}
maven {
name = "Modmaven"
url = uri("https://modmaven.dev/")
}
maven {
name = "TOP"
url = uri("https://maven.k-4u.nl")
}
mavenCentral()
}
dependencies {
additionalRuntimeClasspath(implementation(jarJar(group = "one.util", name = "streamex", version = versionStreamex))!!)
// compile against the JEI API but do not include it at runtime
compileOnly("mezz.jei:jei-$versionMc-common-api:$versionJei")
compileOnly("mezz.jei:jei-$versionMc-neoforge-api:$versionJei")
// at runtime, use the full JEI jar for NeoForge
runtimeOnly("mezz.jei:jei-$versionMc-neoforge:$versionJei")
compileOnly(group = "mcjty.theoneprobe", name = "theoneprobe", version = versionTOP) { isTransitive = false }
runtimeOnly("org.sinytra:item-asset-export-neoforge:1.0.2+1.21")
}
tasks {
withType<Jar> {
manifest {
attributes(
"Specification-Title" to project.name,
"Specification-Vendor" to "Built Broken Modding",
"Specification-Version" to project.version,
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Implementation-Vendor" to "Su5eD",
"Implementation-Timestamp" to LocalDateTime.now()
)
}
}
}
publishMods {
file.set(tasks.jar.flatMap { it.archiveFile })
changelog.set(provider { project.changelog.generateChangelog(1, true) })
type.set(providers.environmentVariable("PUBLISH_RELEASE_TYPE").map(ReleaseType::of).orElse(ReleaseType.STABLE))
modLoaders.add("neoforge")
dryRun.set(!CI.isPresent)
curseforge {
accessToken.set(providers.environmentVariable("CURSEFORGE_TOKEN"))
projectId.set(curseForgeId)
minecraftVersions.add(versionMc)
displayName.set("MFFS $versionMc-${project.version}")
}
modrinth {
accessToken.set(providers.environmentVariable("MODRINTH_TOKEN"))
projectId.set(modrinthId)
minecraftVersions.add(versionMc)
displayName.set("MFFS $versionMc-${project.version}")
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}