-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle
More file actions
271 lines (217 loc) · 7.6 KB
/
build.gradle
File metadata and controls
271 lines (217 loc) · 7.6 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
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
plugins {
id 'java-library'
id 'idea'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.78'
id "me.modmuss50.mod-publish-plugin" version "0.8.3"
}
tasks.named('wrapper', Wrapper).configure {
distributionType = Wrapper.DistributionType.BIN
}
def mcMinorAndPatch = getMinorAndPatchFromMc()
version = "${mcMinorAndPatch}.${mod_version}"
group = project.maven_group
base {
archivesName = project.archives_base_name
}
apply from: 'https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/changelog.gradle'
apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/publishing.gradle"
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
neoForge {
version = "${mcMinorAndPatch}.${neo_version}"
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version.replace("\${mc_version}", minecraft_version)
}
runs {
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
logLevel = org.slf4j.event.Level.DEBUG
}
client {
client()
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
server {
server()
programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
gameTestServer {
type = "gameTestServer"
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
data {
data()
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.extendsFrom localRuntime
}
repositories {
maven {
url = "https://maven.ftb.dev/releases"
content {
includeGroup("dev.ftb.mods")
}
}
maven {
url = "https://maven.ftb.dev/snapshots"
content {
includeGroup("dev.ftb.mods")
}
}
maven {
url = "https://cursemaven.com"
content {
includeGroup("curse.maven")
}
}
maven {
url = "https://maven.architectury.dev/"
content {
includeGroup("dev.architectury")
}
}
maven {
url "https://maven.latvian.dev/releases"
content {
includeGroup "dev.latvian.mods"
includeGroup "dev.latvian.apps"
}
}
maven {
url 'https://jitpack.io'
content {
includeGroup "com.github.rtyley"
}
}
maven {
name = "Illusive Soulworks maven"
url = "https://maven.theillusivec4.top/"
}
}
dependencies {
implementation("dev.ftb.mods:ftb-library-neoforge:${ftb_library_version}")
implementation "curse.maven:fancymenu-367706:6408877"
runtimeOnly "curse.maven:konkrete-410295:5453385"
runtimeOnly "curse.maven:melody-938643:5453382"
compileOnly "curse.maven:irisshaders-455508:6661598"
compileOnly "curse.maven:embeddium-908741:6118392"
compileOnly "dev.ftb.mods:ftb-teams-neoforge:${ftb_teams_version}"
localRuntime "dev.ftb.mods:ftb-teams-neoforge:${ftb_teams_version}"
compileOnly "dev.ftb.mods:ftb-chunks-neoforge:${ftb_chunks_version}"
localRuntime "dev.ftb.mods:ftb-chunks-neoforge:${ftb_chunks_version}"
compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api"
runtimeOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}"
runtimeOnly "curse.maven:ftb-essentials-410811:6979622"
// api("dev.latvian.mods:kubejs-neoforge:2101.7.2-build.261")
// interfaceInjectionData("dev.latvian.mods:kubejs-neoforge:2101.7.2-build.261") // optional
compileOnly "curse.maven:reliquified-twilight-forest-1186617:6880511"
runtimeOnly "curse.maven:the-twilight-forest-227639:7398100"
runtimeOnly "curse.maven:octo-lib-916747:6932487"
runtimeOnly "curse.maven:relics-mod-445274:7533442"
runtimeOnly "curse.maven:architectury-api-419699:5786327"
}
tasks.register("sourcesJar", Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allJava
}
// Uncomment this if you want to create an API jar
// tasks.register("apiJar", Jar) {
// archiveClassifier.set("api")
// from sourceSets.main.output
// include 'dev/ftb/mods/{package_name}/api/**'
// }
tasks.named("jar") {
dependsOn("sourcesJar")
// Uncomment this if you want to create an API jar
// dependsOn("apiJar")
}
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
version: version,
mod_id: mod_id,
mod_name: mod_name,
pack_format: pack_format,
loader_version_range: loader_version_range,
ftblibraryversion: ftb_library_version,
// 99.9% of the time we're only going to target a very vague version of neoforge so this is fine.
mod_loader_range: mod_loader_range.replace("\${mc_base}", mcMinorAndPatch), // Replace the version in the mod loader range
]
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml', 'pack.mcmeta']) {
expand replaceProperties
}
// Copy in the repos license file
from(project.rootDir) {
include 'LICENSE.md'
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
def getMinorAndPatchFromMc() {
String mcVersion = project.minecraft_version
String[] split = mcVersion.split("\\.")
return split[1] + "." + (split[2] ?: "0")
}
publishMods {
def CFToken = providers.environmentVariable("CURSEFORGE_KEY");
dryRun = !CFToken.isPresent()
displayName = "[NEOFORGE] ${mod_name} ${project.version}"
modLoaders.add("neoforge")
changelog = createChangelog(project)
file = jar.archiveFile
version = project.version // Pretty sure it defaults to this
def tag = providers.environmentVariable("TAG").getOrElse("release")
type = tag.endsWith("-beta") ? BETA : (tag.endsWith("-alpha") ? ALPHA : STABLE)
curseforge {
accessToken = CFToken.orElse("missing")
projectId = project.curseforge_id
minecraftVersions.add(project.minecraft_version)
javaVersions.add(JavaVersion.VERSION_21)
requires("ftb-library-forge")
}
}
publishing {
publications {
register('mavenJava', MavenPublication) {
version = ftbPublishing.mavenVersion
from components.java
artifact sourcesJar
// Uncomment this if you want to create an API jar
// artifact apiJar
}
}
repositories {
if (ftbPublishing.ftbToken) {
maven {
url ftbPublishing.ftbURL
credentials {
username = ftbPublishing.ftbUser
password = ftbPublishing.ftbToken
}
}
}
}
}