-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
258 lines (217 loc) · 7.38 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
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath "com.wynprice.cursemaven:CurseMaven:1.1.0"
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.wynprice.cursemaven'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "0.2.1-preview1"
group = "com.aranairra.arcanearchives"
archivesBaseName = "arcanearchives"
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
minecraft {
version = "${minecraft_version}-${forge_version}"
mappings = "${forge_mappings}"
if (file('../run').exists()) {
runDir = "../run"
} else {
runDir = "run"
}
useDepAts = true
coreMod = "com.aranaira.arcanearchives.core.AALoadingPlugin"
replace "GRADLE:VERSION", project.version
}
configurations {
shade
compile.extendsFrom shade
}
configurations {
embed
embed.transitive = false
}
repositories {
maven {
name = "JEI"
url = "http://dvs1.progwml6.com/files/maven"
}
maven {
name = "HWYLA"
url = "http://tehnut.info/maven"
}
maven { // The One Probe
name 'tterrag maven'
url "https://maven.tterrag.com/"
}
maven { // Quark and autorreglib
name = "BlameJared"
url = "https://maven.blamejared.com"
}
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
maven { // guidebook common dep
name = "guidebook"
url = "http://dogforce-games.com/maven"
}
maven { // guidebook transitive deps and baubles
name = "mcmoddev"
url = "https://maven.mcmoddev.com"
}
flatDir {
name = "local jars"
dirs 'embed'
}
flatDir {
name = "thaumcraft jars"
dirs 'thaumcraft'
}
maven {
name = "HellfirePVP"
url = "https://maven.hellfiredev.net"
}
maven {
name = "sponge"
url = "http://repo.spongepowered.org/maven/"
}
maven {
url = "http://maven.tterrag.com"
}
}
dependencies {
deobfProvided "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
// at runtime, use the full JEI jar
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
compileOnly "mcp.mobius.waila:Hwyla:${project.hwyla_version}"
compileOnly "mcjty.theoneprobe:TheOneProbe-${top_version}"
compileOnly "vazkii.quark:Quark:${quark_version}:api"
deobfCompile "com.azanor:Baubles:${version_baubles}"
compileOnly "hellfirepvp.astralsorcery:astralsorcery:1.12.2-1.10.17-v124"
compileOnly 'mouse-tweaks:MouseTweaks:2.10:mc1.12.2'
compileOnly 'inventory-tweaks:InventoryTweaks:1.64+dev.146'
compileOnly "vazkii.patchouli:Patchouli:${patchouli_version}"
// guidebook dependencies
deobfCompile "gigaherz.commons:gigaherz.commons-1.12.1:0.6.4"
shade ("gigaherz.commons:gigaherz.commons-1.12.1:0.6.4") {
transitive = false
}
deobfCompile("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${ct_version}") {
exclude group: 'mezz.jei'
}
//deobfCompile "epicsquid.mysticallib:mysticallib:1.12.2-1.3.1-11"
// modified guidebook, note "lirelent" package
deobfCompile "gigaherz.lirelent.guidebook:Guidebook-1.12.2:2.9.1.s5"
embed "gigaherz.lirelent.guidebook:Guidebook-1.12.2:2.9.1.s5"
compileOnly 'thaumcraft:Thaumcraft:1.12.2:6.1.BETA26'
compileOnly curse.resolve("electroblobs-wizardry", "2656626")
compileOnly curse.resolve("potion-core", "2736248")
shade("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
transitive = false
}
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
into('/META-INF/libraries') {
from configurations.embed
}
manifest {
attributes([
"FMLCorePluginContainsFMLMod": "true",
"FMLCorePlugin" : "com.aranaira.arcanearchives.core.AALoadingPlugin",
"MixinConfigs" : "mixins.arcanearchives.json",
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
"ForceLoadAsMod" : "true",
"FMLAT" : "aa_at.cfg",
"ContainedDeps" : configurations.embed.collect { it.getName() }.join(' ')
])
}
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
rename 'LICENSE.txt', 'org/spongepowered/LICENSE.txt'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.MF'
exclude '**/*.html'
}
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
task deobfJar(type: Jar) {
from(sourceSets.main.output)
archiveName = "${baseName}-${version}-deobf.${extension}"
}
task apiJar(type: Jar) {
from (sourceSets.main.allJava)
from (sourceSets.main.output)
include 'com/aranaira/arcanearchives/api/**'
classifier = 'api'
archiveName = "${baseName}-${version}-api.${extension}"
}
task srcJar(type: Jar) {
from (sourceSets.main.output)
classifier = 'sources'
archiveName = "${baseName}-${version}-sources.${extension}"
}
artifacts {
archives srcJar, apiJar, deobfJar
}
mixin {
add sourceSets.main, "mixins.arcanearchives.refmap.json"
}
String getCN() {
def firsts = ['Donald', 'Lex', 'Mike', 'Arthur', 'Bridget', 'Dorian', 'Ford', 'Guy', 'James', 'Jessica', 'John', 'Michael', 'Robinson', 'Zaphod', 'Bell', 'Penelope']
def lasts = ['Duck', 'Luthor', 'Meyers', 'Dent', 'Jones', 'Gray', 'Prefect', 'Montag', 'Moriarty', 'Rabbit', 'Watson', 'Smith', 'Corleone', 'Crusoe', 'Beeblebrox', 'Cranel', 'Akk']
def rand = new Random()
return firsts[rand.nextInt(firsts.size())] + ' ' + lasts[rand.nextInt(lasts.size())]
}
task mkKeyStore(type:Exec) {
workingDir projectDir
commandLine 'keytool', '-genkey', '-alias', 'signFiles', '-keystore', 'kstore.jks', '-storepass', '123456', '-noprompt', '-dname', 'CN='+getCN(), '-keypass', '123456'
}
task signJar(type: SignJar, dependsOn: reobfJar) {
inputFile = jar.archivePath
outputFile = jar.archivePath
keyStore = 'kstore.jks'
alias = 'signFiles'
storePass = '123456'
keyPass = '123456'
}
task rmKeyStore(type: Delete) {
delete 'kstore.jks'
}
build.dependsOn rmKeyStore
rmKeyStore.dependsOn signJar
signJar.dependsOn mkKeyStore