forked from mirrorcult/NormalASM
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
202 lines (183 loc) · 6.31 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
import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar
import org.jetbrains.gradle.ext.Gradle
plugins {
id 'java'
id 'java-library'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.9'
id 'com.matthewprenger.cursegradle' version '1.4.0'
}
version = project.mod_version
group = project.maven_group
archivesBaseName = project.archives_base_name
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
vendor.set(org.gradle.jvm.toolchain.JvmVendorSpec.AZUL)
}
// Generate sources and javadocs jars when building and publishing
withSourcesJar()
// withJavadocJar()
}
minecraft {
mcVersion = '1.12.2'
def args = [
"-ea:${project.group}",
'-Dfml.coreMods.load=mirror.normalasm.core.NormalLoadingPlugin',
'-Dmixin.hotSwap=true',
'-Dmixin.checks.interfaces=true',
'-Dmixin.debug.export=true'
]
extraRunJvmArguments.addAll(args)
}
configurations {
embed
implementation.extendsFrom(embed)
}
repositories {
jcenter()
maven {
url 'https://repo.spongepowered.org/maven'
}
maven {
url 'https://maven.cleanroommc.com'
}
maven {
url 'http://chickenbones.net/maven'
allowInsecureProtocol = true
}
maven {
url 'http://maven.covers1624.net'
allowInsecureProtocol = true
}
maven {
url 'https://www.cursemaven.com'
}
maven {
url 'https://dvs1.progwml6.com/files/maven/'
}
maven {
url 'https://modmaven.k-4u.nl/'
}
maven {
url 'https://maven.blamejared.com'
}
maven {
url 'https://maven.thiakil.com'
}
maven {
url 'https://repo.codemc.io/repository/maven-public/'
}
maven {
url 'http://maven.tterrag.com'
allowInsecureProtocol = true
}
// maven {
// url = 'http://maven.bluexin.be/repository/snapshots/'
// }
}
dependencies {
embed 'me.nallar.whocalled:WhoCalled:1.1'
implementation 'zone.rong:mixinbooter:7.1'
implementation files('./etc/spark-forge-deobf.jar')
compileOnly 'com.enderio.core:EnderCore:1.12.2-+'
compileOnly ('com.enderio:EnderIO:1.12.2-+') {
transitive = false
}
compileOnly 'codechicken:ChickenASM:1.12-1.0.2.9'
compileOnly 'epicsquid.mysticallib:mysticallib:1.12.2-+'
compileOnly 'mezz.jei:jei_1.12.2:4.15.0.293'
compileOnly 'slimeknights.mantle:Mantle:1.12-1.3.3.55'
compileOnly 'slimeknights:TConstruct:1.12.2-2.13.0.183'
compileOnly 'betterwithmods:BetterWithMods:1.12-2.3.20-1030'
compileOnly rfg.deobf('codechicken:CodeChickenLib:1.12.2-3.2.3.358:universal')
compileOnly rfg.deobf('com.azanor.baubles:Baubles:1.12-1.5.2')
compileOnly rfg.deobf('blusunrize:ImmersiveEngineering:0.12-92-+')
compileOnly rfg.deobf('curse.maven:astral-sorcery-241721:3044416')
compileOnly rfg.deobf('curse.maven:tfcraft-302973:3268988')
compileOnly rfg.deobf('curse.maven:foamfix-optimization-mod-278494:3327893')
compileOnly rfg.deobf('curse.maven:electroblobs-wizardry-265642:3189062')
// deobfCompile 'curse.maven:qmd-362056:3474533'
// deobfCompile 'cofh:CoFHCore:1.12.2-+:universal'
// compile 'com.teamwizardry.librarianlib:librarianlib-1.12:4.0-SNAPSHOT:deobf'
compileOnly rfg.deobf('curse.maven:extra-utilities-225561:2678374')
compileOnly rfg.deobf('curse.maven:gottschcore-272450:3748293')
compileOnly rfg.deobf('curse.maven:treasure2-289760:3758107')
compileOnly rfg.deobf('curse.maven:time-speed-mod-221053:2991593')
compileOnly rfg.deobf('curse.maven:gregtech-ce-unofficial-557242:3745499')
api ('org.spongepowered:mixin:0.8.3') {
transitive = false
}
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
annotationProcessor 'com.google.guava:guava:24.1.1-jre'
annotationProcessor 'com.google.code.gson:gson:2.8.6'
annotationProcessor ('org.spongepowered:mixin:0.8.3') {
transitive = false
}
}
def mixinConfigRefMap = 'mixins.' + project.archives_base_name + '.refmap.json'
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins'
def refMap = "${mixinTmpDir}" + File.separator + mixinConfigRefMap
def mixinSrg = "${mixinTmpDir}" + File.separator + 'mixins.srg'
tasks.named('reobfJar', ReobfuscatedJar).configure {
extraSrgFiles.from(mixinSrg)
}
tasks.named('compileJava', JavaCompile).configure {
doFirst {
new File(mixinTmpDir).mkdirs()
}
options.compilerArgs += ["-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}", "-AoutSrgFile=${mixinSrg}", "-AoutRefMapFile=${refMap}",]
}
processResources {
inputs.property 'version', project.version
inputs.property 'mcversion', project.minecraft.version
filesMatching('mcmod.info') { fcd ->
include 'mcmod.info'
// replace version and mcversion
fcd.expand ('version': project.version, 'mcversion': project.minecraft.version)
}
from refMap
dependsOn 'compileJava'
}
jar {
from provider {
configurations.embed.collect {it.isDirectory() ? it : zipTree(it)}
}
manifest {
attributes([
'FMLCorePluginContainsFMLMod': true,
'FMLCorePlugin': 'mirror.normalasm.core.NormalLoadingPlugin',
'ForceLoadAsMod': project.gradle.startParameter.taskNames[0] == 'build',
'FMLAT': 'normalasm_at.cfg'
])
}
}
idea {
module {
inheritOutputDirs = true
}
project {
settings {
runConfigurations {
'1. Run Client'(Gradle) {
taskNames = ['runClient']
}
'2. Run Server'(Gradle) {
taskNames = ['runServer']
}
'3. Run Obfuscated Client'(Gradle) {
taskNames = ['runObfClient']
}
'4. Run Obfuscated Server'(Gradle) {
taskNames = ['runObfServer']
}
}
compiler.javac {
afterEvaluate {
javacAdditionalOptions = '-encoding utf8'
moduleJavacAdditionalOptions = [(project.name + '.main'): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')]
}
}
}
}
}