forked from klikli-dev/occultism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
283 lines (237 loc) · 9.88 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
plugins {
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
if (System.getenv('MOD_VERSION') != null) {
mod_version = System.getenv('MOD_VERSION')
}
version = mod_version
base {
archivesName = mod_id + "-" + minecraft_version
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: mapping_channel, version: mapping_version
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
args '--username', 'Occultism'
// 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'
//Fix for patchouli mixin crash
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
// enable using JBR to hotswap MOAR
// also ignore the option if someone isnt using JBR
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
clientalt {
parent runs.client
//somehow doesnt replace the name but adds a new one, so we manually need remove
args '--username', 'Occultism2' //#s get replaced with random numbers when starting
}
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'
//Workaround for patchouli mixin crash
property 'mixin.env.disableRefMap', 'true'
// enable using JBR to hotswap MOAR
// also ignore the option if someone isnt using JBR
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions'
mods {
"${mod_id}" {
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'
//Workaround for patchouli mixin crash
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', 'occultism', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven {
url "https://dl.cloudsmith.io/public/klikli-dev/mods/maven/"
content {
includeGroup "com.klikli_dev"
}
}
maven {
name = "JEI and AlmostUnified"
url = 'https://maven.blamejared.com/'
content {
includeGroup "mezz.jei"
includeGroup "com.almostreliable.mods"
}
}
maven {
name = "Curios Maven"
url = "https://maven.theillusivec4.top/"
content {
includeGroup "top.theillusivec4.curios"
}
}
maven {
name = "Geckolib Maven"
url = "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/"
content {
includeGroup "software.bernie.geckolib"
}
}
maven {
name 'LDTTeam - Modding - PerViamInvenire (MineColonies)'
url 'https://ldtteam.jfrog.io/ldtteam/modding/'
content {
includeGroup "com.ldtteam"
}
}
maven {
name = "SBL Maven"
url "https://dl.cloudsmith.io/public/tslat/sbl/maven/"
content {
includeGroup "net.tslat.smartbrainlib"
}
}
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
flatDir {
dirs 'lib'
}
}
dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.minecraftforge:forge:${forge_version}"
//Jei
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
//curios
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${minecraft_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${minecraft_version}")
//geckolib
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_minecraft_version}:${geckolib_version}")
//smartbrainlib
implementation fg.deobf("net.tslat.smartbrainlib:SmartBrainLib-forge-${smartbrainlib_minecraft_version}:${smartbrainlib_version}")
//almostunified
implementation fg.deobf("com.almostreliable.mods:almostunified-forge:${minecraft_version}-${almost_unified_version}")
//modonomicon
implementation fg.deobf("com.klikli_dev:modonomicon-${minecraft_version}-forge:${modonomicon_version}")
//theurgy
compileOnly fg.deobf("com.klikli_dev:theurgy-${minecraft_version}:${theurgy_version}"){transitive=false}
runtimeOnly fg.deobf("com.klikli_dev:theurgy-${minecraft_version}:${theurgy_version}"){transitive=false}
//runtime only helper mods for dev env, placed in ./runtime-mods, example: Hwyla-forge-1.10.11-B78_1.16.2.jar
//runtimeOnly fg.deobf("ignoredvalue:Hwyla:forge-1.10.11-B78_1.16.2")
//alltheores - for recipe testing
//enable once available for 1.20
//runtimeOnly fg.deobf("curse.maven:alltheores-405593:xyz") //
//Ma for crafting issue testing
// runtimeOnly fg.deobf("curse.maven:mysticalagriculture-246640:4399151") //MysticalAgriculture-1.19.3-6.1.4.jar
// runtimeOnly fg.deobf("curse.maven:cucumber-272335:4395466") //Cucumber-1.19.3-6.1.2.jar
//PerViamInvenire - for AI integration testing
//runtimeOnly fg.deobf("curse.maven:perviaminvenire-449945:xyz") //
//enable once available for 1.20
//runtimeOnly fg.deobf("com.ldtteam:per_viam_invenire:1.19.3-XYZ-RELEASE:universal")
}
processResources {
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand project.properties
}
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title" : mod_id,
"Specification-Vendor" : mod_authors,
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : mod_version,
"Implementation-Vendor" : mod_authors,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
jar.finalizedBy('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
pom {
name = mod_name
description = 'A magic mod inspired by the world of Jonathan Stroud\'s Bartimaeus. With the help of occult rituals players can summon entities from the "Other Side" to perform magic.'
url = 'https://github.com/klikli-dev/occultism'
licenses {
license {
name = 'MIT AND CC-BY-4.0'
url = 'https://github.com/klikli-dev/occultism#licensing'
}
}
scm {
connection = 'scm:git:ssh:[email protected]:klikli-dev/occultism.git'
url = 'https://github.com/klikli-dev/occultism'
}
}
}
}
repositories {
maven {
name = "cloudsmith"
url = "https://maven.cloudsmith.io/klikli-dev/mods/"
def releasesRepoUrl = "https://maven.cloudsmith.io/klikli-dev/mods/"
def snapshotsRepoUrl = "https://maven.cloudsmith.io/klikli-dev/mods/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('MAVEN_USER')
password = System.getenv('MAVEN_PASS')
}
}
}
}
//increase max errors from 100 to 2000
afterEvaluate {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "2000"
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}