-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
293 lines (260 loc) · 9 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
plugins {
id 'eclipse'
id 'java-library'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
id 'net.darkhax.curseforgegradle' version '1.1.15'
}
version = "1.19.2-"+new Date().format("dd")+"-"+Math.abs(new Random().nextInt())
group = "uniquee"
archivesBaseName = "Unique Enchantments"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
repositories {
maven {
url = "https://www.cursemaven.com"
}
}
minecraft {
mappings channel: 'official', version: '1.19.2'
runs {
client {
workingDirectory project.file('run')
arg "-mixin.config=uniquebase.mixins.json"
}
server {
workingDirectory project.file('run')
arg "-mixin.config=uniquebase.mixins.json"
}
data {
workingDirectory project.file('run')
arg "-mixin.config=uniquebase.mixins.json"
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
sourceSets {
tools {
java {
compileClasspath += main.output
runtimeClasspath += main.output
}
}
}
configurations {
toolsImplementation.extendsFrom implementation;
}
dependencies {
minecraft 'net.minecraftforge:forge:1.19.2-43.3.0'
implementation fg.deobf("curse.maven:carbon-config-898104:4952985")
implementation fg.deobf("curse.maven:jei-238222:4434397")
implementation fg.deobf("curse.maven:patchouli-306770:4031402")
implementation fg.deobf("curse.maven:embeddium-908741:4984830")
implementation fg.deobf("curse.maven:enchantment-descriptions-250419:4277356")
implementation fg.deobf("curse.maven:apotheosis-313970:5322410")
implementation fg.deobf("curse.maven:placebo-283644:5180198")
implementation fg.deobf("curse.maven:bookshelf-228525:4354814")
implementation fg.deobf("curse.maven:curios-309927:4418021")
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
mixin {
add sourceSets.main, "mixins.uniquebase.refmap.json"
}
task runAutomatedIconGen(type: JavaExec) {
group = 'internal'
description = 'Generates the Icon Uniquecodes automatically'
classpath = sourceSets.tools.runtimeClasspath
main = 'automation.AutomatedIconGen'
args file('src/main/resources').absolutePath, file('src/tools/resources/icons.json')
}
jar {
manifest {
attributes([
"Specification-Title": "uniquee",
"Specification-Vendor": "uniquee",
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"uniquee",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": "uniquebase.mixins.json"
])
}
includeEmptyDirs = false
}
jar.finalizedBy('reobfJar')
task baseJar(type: Jar, dependsOn: reobf) {
baseName = BASE_NAME
version = MC_VERSION+"-"+BASE_VERSION
from(zipTree(jar.archivePath)) {
include 'META_INF/MANIFEST.MF'
include '**/uniquebase/**/*'
include '**/assets/uniquebase/**/*'
include '**/assets/mc/**/*'
include 'pack.mcmeta'
include 'uniquebase.mixins.json'
include 'mixins.uniquebase.refmap.json'
}
manifest {
attributes([
"MixinConfigs": "uniquebase.mixins.json"
])
}
from(zipTree(jar.archivePath)) {
include 'META-INF/unique_base_mods.toml'
rename 'unique_base_mods.toml', 'mods.toml'
expand 'version': BASE_VERSION
}
includeEmptyDirs = false
}
task mainJar(type: Jar, dependsOn: reobf) {
baseName = UE_NAME
version = MC_VERSION+"-"+UE_VERSION
from(zipTree(jar.archivePath)) {
include 'META_INF/MANIFEST.MF'
include '**/uniquee/**/*'
include '**/assets/uniquee/**/*'
include '**/data/uniquee/**/*'
include '**/data/forge/**/*'
include 'pack.mcmeta'
}
from(zipTree(jar.archivePath)) {
include 'META-INF/uniquee_mods.toml'
rename 'uniquee_mods.toml', 'mods.toml'
expand 'version': UE_VERSION, 'base_version': BASE_VERSION
}
includeEmptyDirs = false
}
task utilsJar(type: Jar, dependsOn: reobf) {
baseName = UTILS_NAME
version = MC_VERSION+"-"+UTILS_VERSION
from(zipTree(jar.archivePath)) {
include 'META_INF/MANIFEST.MF'
include '**/uniqueeutils/**/*'
include '**/assets/uniqueutil/**/*'
include 'pack.mcmeta'
}
from(zipTree(jar.archivePath)) {
include 'META-INF/unique_utils_mods.toml'
rename 'unique_utils_mods.toml', 'mods.toml'
expand 'version': UTILS_VERSION, 'base_version': BASE_VERSION
}
includeEmptyDirs = false
}
task battleJar(type: Jar, dependsOn: reobf) {
baseName = BATTLE_NAME
version = MC_VERSION+"-"+BATTLE_VERSION
from(zipTree(jar.archivePath)) {
include 'META_INF/MANIFEST.MF'
include '**/uniqueebattle/**/*'
include '**/assets/uniquebattle/**/*'
include '**/data/uniquebattle/**/*'
include 'pack.mcmeta'
}
from(zipTree(jar.archivePath)) {
include 'META-INF/unique_battle_mods.toml'
rename 'unique_battle_mods.toml', 'mods.toml'
expand 'version': BATTLE_VERSION, 'base_version': BASE_VERSION
}
includeEmptyDirs = false
}
task apexJar(type: Jar, dependsOn: reobf) {
baseName = APEX_NAME
version = MC_VERSION+"-"+APEX_VERSION
from(zipTree(jar.archivePath)) {
include 'META_INF/MANIFEST.MF'
include '**/uniqueapex/**/*'
include '**/assets/uniqueapex/**/*'
include '**/data/uniqueapex/**/*'
include 'pack.mcmeta'
}
from(zipTree(jar.archivePath)) {
include 'META-INF/unique_apex_mods.toml'
rename 'unique_apex_mods.toml', 'mods.toml'
expand 'version': APEX_VERSION, 'base_version': BASE_VERSION
}
includeEmptyDirs = false
}
artifacts {
archives baseJar
archives mainJar
archives utilsJar
archives battleJar
archives apexJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
def props = new Properties()
file("publish.cfg").withInputStream { props.load(it) }
System.out.println("Props: "+props);
task curseforge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
mustRunAfter assemble
dependsOn assemble
group 'publishing'
description 'Publishes the mod to Curseforge'
apiToken = System.getenv("Curseforge_API_Token")
if(Boolean.parseBoolean(props.get("BASE"))) {
def mainFile = upload(515658, baseJar)
mainFile.releaseType = RELEASE_TYPE
mainFile.displayName = BASE_NAME+"-"+MC_VERSION+"-"+BASE_VERSION
def change = new File(projectDir, "/changelogs/base/"+BASE_VERSION.replace(".", "")+".md");
mainFile.changelog = change.exists() ? change.getText('UTF-8') : "";
mainFile.changelogType = 'markdown'
mainFile.addGameVersion(MC_VERSION, 'Server', 'Client')
mainFile.addJavaVersion('Java 17')
}
if(Boolean.parseBoolean(props.get("UE"))) {
def mainFile = upload(348891, mainJar)
mainFile.releaseType = RELEASE_TYPE
mainFile.displayName = UE_NAME+"-"+MC_VERSION+"-"+UE_VERSION
def change = new File(projectDir, "/changelogs/ue/"+UE_VERSION.replace(".", "")+".md");
mainFile.changelog = change.exists() ? change.getText('UTF-8') : "";
mainFile.changelogType = 'markdown'
mainFile.addGameVersion(MC_VERSION, 'Server', 'Client')
mainFile.addJavaVersion('Java 17')
mainFile.addRequirement('unique-enchantments-base')
}
if(Boolean.parseBoolean(props.get("UTILS"))) {
def mainFile = upload(382138, utilsJar)
mainFile.releaseType = RELEASE_TYPE
mainFile.displayName = UTILS_NAME+"-"+MC_VERSION+"-"+UTILS_VERSION
def change = new File(projectDir, "/changelogs/utils/"+UTILS_VERSION.replace(".", "")+".md");
mainFile.changelog = change.exists() ? change.getText('UTF-8') : "";
mainFile.changelogType = 'markdown'
mainFile.addGameVersion(MC_VERSION, 'Server', 'Client')
mainFile.addJavaVersion('Java 17')
mainFile.addRequirement('unique-enchantments-base')
}
if(Boolean.parseBoolean(props.get("BATTLE"))) {
def mainFile = upload(491806, battleJar)
mainFile.releaseType = RELEASE_TYPE
mainFile.displayName = BATTLE_NAME+"-"+MC_VERSION+"-"+BATTLE_VERSION
def change = new File(projectDir, "/changelogs/battle/"+BATTLE_VERSION.replace(".", "")+".md");
mainFile.changelog = change.exists() ? change.getText('UTF-8') : "";
mainFile.changelogType = 'markdown'
mainFile.addGameVersion(MC_VERSION, 'Server', 'Client')
mainFile.addJavaVersion('Java 17')
mainFile.addRequirement('unique-enchantments-base')
}
if(Boolean.parseBoolean(props.get("APEX"))) {
def mainFile = upload(596310, apexJar)
mainFile.releaseType = RELEASE_TYPE
mainFile.displayName = APEX_NAME+"-"+MC_VERSION+"-"+APEX_VERSION
def change = new File(projectDir, "/changelogs/apex/"+APEX_VERSION.replace(".", "")+".md");
mainFile.changelog = change.exists() ? change.getText('UTF-8') : "";
mainFile.changelogType = 'markdown'
mainFile.addGameVersion(MC_VERSION, 'Server', 'Client')
mainFile.addJavaVersion('Java 17')
mainFile.addRequirement('unique-enchantments-base')
}
}