-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
build.gradle
339 lines (288 loc) · 11.2 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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url = "https://files.minecraftforge.net/maven" }
maven {
url "https://plugins.gradle.org/m2/"
}
}
configurations {
classpath.resolutionStrategy {
cacheDynamicVersionsFor 10, 'seconds'
cacheChangingModulesFor 0, 'seconds'
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
}
}
plugins {
id "com.github.hierynomus.license" version "0.16.1"
id 'java'
id 'maven-publish'
id "com.matthewprenger.cursegradle" version "1.4.0"
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.64"
id "com.modrinth.minotaur" version "2.+"
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
def isReleaseBranch = System.getenv("BRANCH") == "release-1.20";
group = "com.buuz135"
archivesBaseName = "industrial-foregoing"
version = "${minecraftVersion}-${project.api_version}"
if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: 'official', version: '1.20.1'
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
property 'mixin.env.disableRefMap', 'true'
property 'legacyClassPath', '{minecraft_classpath}'
mods {
industrialforegoing {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
property 'mixin.env.disableRefMap', 'true'
mods {
industrialforegoing {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
property 'mixin.env.disableRefMap', 'true'
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', 'industrialforegoing', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
industrialforegoing {
source sourceSets.main
}
}
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://maven.tterrag.com/"
}
maven {
url 'https://cdn.hrzn.studio/maven/'
}
maven {
name 'jared maven'
url "https://maven.blamejared.com/"
}
maven {
url 'https://www.dogforce-games.com/maven/'
}
maven {
url = "https://www.cursemaven.com"
}
maven { url "https://maven.theillusivec4.top/" }
maven { url "https://maven.saps.dev/minecraft/"}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
maven {
url "https://maven.architectury.dev/"
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.20.1-47.1.1'
//compileOnly fg.deobf("mezz.jei:jei-1.18.2:9.5.5.174")
// at runtime, use the full JEI jar
compileOnly fg.deobf("mezz.jei:jei-1.20.1-common-api:15.2.0.23")
compileOnly fg.deobf("mezz.jei:jei-1.20.1-forge-api:15.2.0.23")
// at runtime, use the full JEI jar for Forge
runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:15.2.0.23")
implementation fg.deobf(project.dependencies.create('com.hrznstudio:titanium:1.20.1-3.8.32'))
implementation fg.deobf("curse.maven:curios-309927:5086821")
implementation fg.deobf("curse.maven:patchouli-306770:4636277")
implementation fg.deobf("curse.maven:placebo-283644:4913663")
implementation fg.deobf("curse.maven:apothic-attributes-898963:4954000")
implementation fg.deobf("curse.maven:apotheosis-313970:4960128")
//runtimeOnly fg.deobf("curse.maven:immersive-engineering-231951:3755665")
//runtimeOnly fg.deobf("mekanism:Mekanism:${mekanism_version}")// core
// compiled from github
//compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.17.1-56-SNAPSHOT:api")
//runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.17.1-56-SNAPSHOT")
//if (findProject(':workspace') == null) {
// compileOnly fg.deobf("mezz.jei:jei-1.16.4:7.6.1.71:api")
// // at runtime, use the full JEI jar
// runtimeOnly fg.deobf("mezz.jei:jei-1.16.4:7.6.1.71")
// //}
// compileOnly fg.deobf("curse.maven:astral-sorcery-241721:3156477")
// compileOnly fg.deobf("blusunrize.immersiveengineering:ImmersiveEngineering:1.16.3-4.1.0-+")
// compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.4-53.1:api")
// runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.4-53.1")
// //runtimeOnly fg.deobf("curse.maven:zycraft:3099577")
// compileOnly fg.deobf("curse.maven:farmers-delight-398521:3091999")
// compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.5-4.0.5.2:api")
// runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.5-4.0.5.2")
// compileOnly fg.deobf("dev.ftb.mods:ftb-chunks-forge:1605.3.1-build.25")
// compileOnly fg.deobf("me.shedaniel:architectury-forge:1.19.27")
// compileOnly fg.deobf("dev.ftb.mods:ftb-library-forge:1605.3.1-build.48")
// compileOnly fg.deobf("dev.ftb.mods:ftb-teams-forge:1605.2.1-build.17")
// compileOnly fg.deobf("dev.ftb.mods:ftb-ranks-forge:1605.1.4-build.6")
}
afterEvaluate {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "2000"
}
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property 'version', project.version
inputs.property 'mcversion', '1.20.1'
duplicatesStrategy = DuplicatesStrategy.WARN
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'META_INF/mods.toml'
// replace version and mcversion
expand 'version':project.version, 'mcversion': '1.17.1'
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'META_INF/mods.toml'
}
}
task apiJar(type: Jar, dependsOn: 'classes') {
classifier = 'api'
from(sourceSets.main.output) {
include 'com/buuz135/industrial/api/**'
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task deobfJar(type:Jar) {
from sourceSets.main.output
classifier 'deobf'
}
artifacts {
archives sourcesJar
archives deobfJar
archives apiJar
}
publish.dependsOn(project.tasks.getByName("assemble"))
publish.mustRunAfter(project.tasks.getByName("build"))
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourcesJar
artifact deobfJar
artifact apiJar
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
license {
header rootProject.file('HEADER')
include "**/*.java"
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'Buuz135'
ext.project = "Industrial Foregoing"
ignoreFailures = true
mapping {
java='SLASHSTAR_STYLE'
}
}
jar {
manifest {
attributes([
"Specification-Title": "Industrial Foregoing",
"Specification-Vendor": "Buuz135",
"Specification-Version": "2.0", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${project.api_version + "." + System.getenv('BUILD_NUMBER')}",
"Implementation-Vendor" :"Buuz135",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.curseforge.enabled = System.env["CURSE_API"] != null
curseforge {
if (System.env["CURSE_API"] != null){
apiKey = System.env["CURSE_API"]
}
project {
id = '266515'
changelog = "https://github.com/InnovativeOnlineIndustries/Industrial-Foregoing/blob/release-1.20/CHANGELOG.md"
changelogType = 'markdown'
releaseType = 'beta'
addGameVersion '1.20.1'
mainArtifact(jar){
relations {
requiredDependency 'titanium'
requiredDependency 'patchouli'
optionalDependency 'curios'
optionalDependency 'jei'
}
}
addArtifact sourcesJar
addArtifact deobfJar
}
}
tasks.modrinth.enabled = System.env["MODRINTH_TOKEN"] != null
modrinth {
token = System.getenv("MODRINTH_TOKEN")
// This is the default. Remember to have the MODRINTH_TOKEN environment variable set or else this will fail, or set it to whatever you want - just make sure it stays private!
projectId = "lWxpUd04" // This can be the project ID or the slug. Either will work!
versionType = "beta" // This is the default -- can also be `beta` or `alpha`
uploadFile = jar // With Loom, this MUST be set to `remapJar` instead of `jar`!
gameVersions = ["1.20.1"] // Must be an array, even with only one version
loaders = ["forge"] // Must also be an array - no need to specify this if you're using Loom or ForgeGradle
dependencies { // A special DSL for creating dependencies
required.project "titanium"
}
changelog = "https://github.com/InnovativeOnlineIndustries/Industrial-Foregoing/blob/release-1.20/CHANGELOG.md"
}
task makeChangelog(type: GitChangelogTask) {
file = new File("CHANGELOG.md")
untaggedName = "Version ${project.version}"
//fromCommit = "6a5a3df3665643ea181873312e3801db7c662686"
fromRef = "refs/tags/2.3.0"
toRef = "release-1.20"
templateContent = file("changelog.mustache").getText("UTF-8")
}
tasks.withType(Jar).all {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}