-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
246 lines (199 loc) · 7.05 KB
/
build.gradle
File metadata and controls
246 lines (199 loc) · 7.05 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
import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.7.0'
}
}
plugins {
id 'idea'
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.91'
id 'org.jetbrains.kotlin.jvm' version '2.0.20'
}
tasks.named('wrapper', Wrapper).configure {
distributionType = Wrapper.DistributionType.BIN
}
tasks.named('jar', Jar).configure {
exclude('src/main/resources/assets/theaurorian/lang_extra/**')
exclude('cn/teampancake/theaurorian/common/data/datagen/loot/**')
exclude('cn/teampancake/theaurorian/common/data/datagen/provider/**')
exclude('cn/teampancake/theaurorian/common/data/datagen/recipes/**')
exclude('cn/teampancake/theaurorian/common/data/datagen/RegistryDataGenerator.class')
exclude('cn/teampancake/theaurorian/common/data/datagen/TADataGenerator.class')
}
version = mod_version
group = mod_group_id
repositories {
flatDir(dirs: "libs")
mavenLocal()
}
base {
archivesName = mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
kotlin {
jvmToolchain(21)
}
neoForge {
version = project.neo_version
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}
accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
client()
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()
}
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
logLevel = org.slf4j.event.Level.DEBUG
}
}
mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
configurations {
runtimeClasspath.extendsFrom localRuntime
}
repositories {
maven {
url = "https://maven.ithundxr.dev/snapshots"
}
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
}
maven {
url "https://maven.shedaniel.me/"
}
maven {
name = 'Curse Maven'
url = "https://www.cursemaven.com"
}
maven {
name = "Jared\'s Maven" // JEI
url "https://maven.blamejared.com/"
}
maven {
name = "Illusive Soulworks maven"
url = "https://maven.theillusivec4.top/"
}
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
implementation "software.bernie.geckolib:geckolib-neoforge-1.21.1:4.7.3"
implementation "me.shedaniel.cloth:cloth-config-neoforge:15.0.140"
implementation "curse.maven:thirst-was-taken-679270:5568715"
implementation "curse.maven:configured-457570:5873783"
implementation "curse.maven:modern-ui-352491:6200236"
implementation "curse.maven:auth-me-356643:6177873"
implementation "curse.maven:spark-361579:6225208"
implementation "curse.maven:neat-238372:5838045"
jarJar(implementation("com.tterrag.registrate:Registrate:$registrate_version"))
// compile against the JEI API but do not include it at runtime
compileOnly("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
compileOnly("mezz.jei:jei-${minecraft_version}-neoforge-api:${jei_version}")
// at runtime, use the full JEI jar for NeoForge
runtimeOnly("mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}")
// Compile against only the API artifact
compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api"
// Use the full Curios API jar at runtime
implementation "top.theillusivec4.curios:curios-neoforge:${curios_version}"
}
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
neo_version : neo_version,
neo_version_range : neo_version_range,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
mod_description : mod_description
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
sourceSets.main.resources.srcDir generateModMetadata
neoForge.ideSyncTask generateModMetadata
tasks.register('proguard', ProGuardTask) {
dependsOn tasks.jar
keep(["allowobfuscation": true], "public class ${project.group}.** { *; }")
keep(["allowobfuscation": false], "public class ${project.group}.mixin.** { *; }")
optimizationpasses(10)
keepattributes("*Annotation*")
repackageclasses()
ignorewarnings()
verbose()
obfuscationdictionary("dic.txt")
classobfuscationdictionary("dic.txt")
packageobfuscationdictionary("dic.txt")
printmapping(project.layout.buildDirectory.file("proguard/mappings.map"))
configurations.runtimeClasspath.getResolvedConfiguration().getFiles().each { File file ->
if (file.isFile() && file.getName().endsWith('.jar')) {
libraryjars(file.getPath())
}
}
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
injars tasks.jar.outputs.files.singleFile
outjars(layout.buildDirectory.file("libs/${archivesBaseName}-minified.jar"))
}
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/repo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}