-
Notifications
You must be signed in to change notification settings - Fork 0
/
mixin.gradle
80 lines (61 loc) · 1.98 KB
/
mixin.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
// === === === === === === Mixin Path Start === === === === === ===
def mixinConfig = "mixins.${modId}.json"
def refMap = "mixins.${modId}.refmap.json"
if (!project.embedMixin.toBoolean()) {
version += "-mixinless"
}
runClient {
args("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
}
runServer {
args("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
}
repositories {
maven {
url 'https://jitpack.io'
}
}
dependencies {
if (project.embedMixin.toBoolean()) {
includeCompile("com.github.LegacyModdingMC.UniMixins:unimixins-all-1.7.10:0.1.15:dev")
} else {
implementation("com.github.LegacyModdingMC.UniMixins:unimixins-all-1.7.10:0.1.15:dev")
}
}
configurations.implementation.dependencies.each {
if (it instanceof ExternalModuleDependency) {
it.exclude module: "SpongeMixins"
it.exclude module: "SpongePoweredMixin"
it.exclude module: "00gasstation-mc1.7.10"
it.exclude module: "gtnhmixins"
}
}
def srgFile = "${tasks.compileJava.temporaryDir}/mcpSrg.srg"
def refMapFile = "${tasks.compileJava.temporaryDir}/$refMap"
def srgFileF = new File(srgFile)
if (!srgFileF.exists()) {
srgFileF.createNewFile()
}
jar {
manifest {
attributes (
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'MixinConfigs': "$mixinConfig",
'FMLCorePlugin': 'io.github.legacymoddingmc.unimixins.example.ExampleCore',
'ForceLoadAsMod': 'true',
'FMLCorePluginContainsFMLMod': 'true',
)
}
from refMapFile;
}
tasks.compileJava.options.compilerArgs += ["-AreobfSrgFile=${tasks.reobf.srg}", "-AsrgFile=${srgFile}", "-ArefMapFile=${refMapFile}"];
reobf {
addExtraSrgFile srgFile
}
processResources {
inputs.property "mixin_refmap", project.version
filesMatching("$mixinConfig") {
expand 'mixin_refmap': refMap
}
}
// === === === === === === Mixin Path End === === === === === ===