forked from klikli-dev/occultism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
286 lines (249 loc) · 9.47 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
plugins {
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version "${neogradle_version}"
}
tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.ALL
}
if (System.getenv('MOD_VERSION') != null) {
mod_version = System.getenv('MOD_VERSION')
}
version = mod_version
base {
archivesName = "${mod_id}-${minecraft_version}-neoforge"
}
//TODO: re enable source sets once mods are updated
sourceSets {
main {
java {
exclude '**/AlmostUnifiedIntegrationImpl.java'
// exclude '**/emi/**/*.java'
// exclude '**/jei/impl/**/*.java'
// exclude 'com/klikli_dev/occultism/common/item/tool/FamiliarRingItem.java'
}
}
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.withSourcesJar()
if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
minecraft.accessTransformers.file file('src/main/resources/META-INF/accesstransformer.cfg')
}
runs {
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
jvmArguments.addAll('-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions')
modSource project.sourceSets.main
}
client {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument "--username=Occultism"
}
server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
// programArgument '--nogui'
}
data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
mavenLocal()
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 { //used to be curios
// name = "Curios Maven"
// url = "https://maven.theillusivec4.top/"
// content {
// includeGroup "top.theillusivec4.curios"
// }
// }
maven {
name = "OctoStudios (Curios Api Contiunation)"
url = uri("https://maven.octo-studios.com/releases")
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"
}
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
maven {
name = "TerraformersMC (emi)"
url = "https://maven.terraformersmc.com/"
content {
includeGroup "dev.emi"
}
}
flatDir {
dirs 'lib'
}
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
//Jei
compileOnly "mezz.jei:jei-${minecraft_version_major}-common-api:${jei_version}"
compileOnly "mezz.jei:jei-${minecraft_version_major}-neoforge-api:${jei_version}"
// runtimeOnly "mezz.jei:jei-${minecraft_version_major}-neoforge:${jei_version}"
//curios
compileOnly ("top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version_major}:api") {transitive=false}
runtimeOnly ("top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version_major}") {transitive=false}
//geckolib
implementation ("software.bernie.geckolib:geckolib-neoforge-${minecraft_version}:${geckolib_version}") {transitive=false}
//smartbrainlib
implementation ("net.tslat.smartbrainlib:SmartBrainLib-neoforge-${minecraft_version}:${smartbrainlib_version}") {transitive=false}
//TODO: enable once available
//almostunified
// implementation "com.almostreliable.mods:almostunified-forge:${minecraft_version}-${almost_unified_version}"
//modonomicon
implementation ("com.klikli_dev:modonomicon-${minecraft_version}-neoforge:${modonomicon_version}") {transitive=false}
//theurgy
compileOnly ("com.klikli_dev:theurgy-${minecraft_version}-neoforge:${theurgy_version}") {transitive=false}
runtimeOnly ("com.klikli_dev:theurgy-${minecraft_version}-neoforge:${theurgy_version}") {transitive=false}
// emi
compileOnly ("dev.emi:emi-neoforge:${emi_version}:api") {transitive=false}
runtimeOnly ("dev.emi:emi-neoforge:${emi_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 "ignoredvalue:Hwyla:forge-1.10.11-B78_1.16.2"
//alltheores - for recipe testing
//enable once available for 1.20
//runtimeOnly "curse.maven:alltheores-405593:xyz" //
//PerViamInvenire - for AI integration testing
//runtimeOnly "curse.maven:perviaminvenire-449945:xyz" //
//enable once available for 1.20
//runtimeOnly "com.ldtteam:per_viam_invenire:1.19.3-XYZ-RELEASE:universal"
}
processResources {
def props = new HashMap<>(project.properties)
def keys = new ArrayList<String>(props.keySet()) //to avoid concurrent modification exception
for (String key : keys) {
if (!(props.get(key) instanceof String) && !(props.get(key) instanceof Integer)) {
props.remove(key)
}
}
if (System.getenv('MOD_VERSION') != null) {
props.put('mod_version', System.getenv('MOD_VERSION'))
}
filesMatching(['META-INF/neoforge.mods.toml', 'pack.mcmeta']) {
expand props
}
getInputs().properties(props)
}
// 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 { exclude ".cache" }
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
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}