forked from GTNewHorizons/Hodgepodge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dependencies.gradle
176 lines (148 loc) · 7.88 KB
/
dependencies.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
configurations {
transformedMod // Mods that can be transformed - used for compiling hodgepodge, but not necessary at runtime
transformedMod.canBeConsumed = false
transformedModCompileOnly
transformedModCompileOnly.canBeConsumed = false
// Add the transformed mod dependencies to the compilation and runtime classpaths, but don't publish them in the Maven metadata
compileClasspath.extendsFrom(transformedMod, transformedModCompileOnly)
runtimeClasspath.extendsFrom(transformedMod)
testCompileClasspath.extendsFrom(transformedMod, transformedModCompileOnly)
testRuntimeClasspath.extendsFrom(transformedMod)
}
dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.3.2:dev")
compileOnly("com.gtnewhorizons.retrofuturabootstrap:RetroFuturaBootstrap:1.0.2") { transitive = false }
transformedMod("com.github.GTNewHorizons:NotEnoughItems:2.6.14-GTNH:dev") // force a more up-to-date NEI version
transformedModCompileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-405-GTNH")
transformedModCompileOnly("com.github.GTNewHorizons:Baubles:1.0.4:dev")
// Transitive updates to make runClient17 work
transformedModCompileOnly("com.github.GTNewHorizons:ForgeMultipart:1.5.0:dev")
transformedModCompileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.48.64:dev")
transformedModCompileOnly("com.github.GTNewHorizons:harvestcraft:1.2.1-GTNH:dev")
transformedModCompileOnly("com.github.GTNewHorizons:HungerOverhaul:1.1.0-GTNH:dev")
transformedModCompileOnly("com.github.GTNewHorizons:MrTJPCore:1.2.1:dev") // Do not update, fixed afterwards
transformedModCompileOnly("com.github.GTNewHorizons:Railcraft:9.15.8:dev") { exclude group: "thaumcraft", module: "Thaumcraft" }
transformedModCompileOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.4-GTNH:dev")
transformedModCompileOnly(rfg.deobf("curse.maven:bibliocraft-228027:2423369"))
transformedModCompileOnly("curse.maven:biomes-o-plenty-220318:2499612")
transformedModCompileOnly("curse.maven:cofh-core-69162:2388751")
transformedModCompileOnly("curse.maven:minefactory-reloaded-66672:2277486")
transformedModCompileOnly(rfg.deobf('curse.maven:damage-indicators-mod-59489:2692129'))
transformedModCompileOnly("curse.maven:extra-utilities-225561:2264384")
transformedModCompileOnly(rfg.deobf("curse.maven:extratic-72728:2299292"))
transformedModCompileOnly(rfg.deobf("curse.maven:journeymap-32274:4500658"))
transformedModCompileOnly(deobf('https://dist.creeper.host/ichun/filespg/PortalGun-4.0.0-beta-6.jar'))
transformedModCompileOnly("curse.maven:travellers-gear-224440:2262113")
transformedModCompileOnly(rfg.deobf("curse.maven:witchery-69673:2234410"))
transformedModCompileOnly(rfg.deobf("curse.maven:ztones-224369:2223720"))
transformedModCompileOnly("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
transformedModCompileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
transformedModCompileOnly(rfg.deobf("curse.maven:glibys-voice-chat-225110:2301492"))
transformedModCompileOnly(rfg.deobf("curse.maven:automagy-222153:2285272"))
transformedModCompileOnly("com.github.GTNewHorizons:Galacticraft:3.1.7-GTNH:dev")
transformedModCompileOnly("curse.maven:minechem-368422:2905830")
transformedModCompileOnly("curse.maven:thermal-dynamics-227443:2388756")
transformedModCompileOnly("curse.maven:thermal-expansion-69163:2388759")
transformedModCompileOnly(rfg.deobf("curse.maven:projecte-226410:2340786"))
transformedModCompileOnly(rfg.deobf("curse.maven:better-hud-286066:2523840"))
transformedModCompileOnly("curse.maven:immersive-engineering-231951:2299019")
// Contains an outdated copy of thaumcraft api that breaks class loading at runtime
transformedModCompileOnly(rfg.deobf("curse.maven:pams-harvest-the-nether-231262:2241397"))
transformedModCompileOnly(rfg.deobf("curse.maven:the-lord-of-the-rings-mod-legacy-423748:4091561"))
transformedModCompileOnly(deobfNotch("https://mediafiles.forgecdn.net/files/2462/146/mod_voxelMap_1.7.0b_for_1.7.10.litemod"))
transformedModCompileOnly(rfg.deobf("curse.maven:xaeros-world-map-317780:4716737"))
transformedModCompileOnly(deobf("https://forum.industrial-craft.net/core/attachment/4316-advancedsolarpanel-1-7-10-3-5-1-jar/"))
runtimeOnly(deobf("https://github.com/makamys/CoreTweaks/releases/download/0.3.3.2/CoreTweaks-1.7.10-0.3.3.2+nomixin.jar"))
}
// Replace when RFG support deobfuscation from notch mappings
import java.nio.file.Files
import java.nio.file.Paths
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
def deobfNotch(String sourceURL) {
try {
URL url = new URL(sourceURL)
String fileName = url.getFile()
//get rid of directories:
int lastSlash = fileName.lastIndexOf("/")
if (lastSlash > 0) {
fileName = fileName.substring(lastSlash + 1)
}
//get rid of extension:
if (fileName.endsWith(".jar") || fileName.endsWith(".litemod")) {
fileName = fileName.substring(0, fileName.lastIndexOf("."))
}
String hostName = url.getHost()
if (hostName.startsWith("www.")) {
hostName = hostName.substring(4)
}
List parts = Arrays.asList(hostName.split("\\."))
Collections.reverse(parts)
hostName = String.join(".", parts)
return deobfNotch(sourceURL, "$hostName/$fileName")
} catch (Exception ignored) {
return deobfNotch(sourceURL, "deobf/${sourceURL.hashCode()}")
}
}
def deobfNotch(String sourceURL, String rawFileName) {
String bon2Version = "2.5.1"
String fileName = URLDecoder.decode(rawFileName, "UTF-8")
String cacheDir = "$project.gradle.gradleUserHomeDir/caches"
String bon2Dir = "$cacheDir/forge_gradle/deobf"
String bon2File = "$bon2Dir/BON2-${bon2Version}.jar"
String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar"
String deobfFile = "$cacheDir/modules-2/files-2.1/${fileName}-deobf.jar"
if (file(deobfFile).exists()) {
return files(deobfFile)
}
String mappingsVer
String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/'
if (remoteMappings) {
String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion"
String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip"
zipMappings(mappingsZIP, remoteMappings, bon2Dir)
mappingsVer = "snapshot_$id"
} else {
mappingsVer = "${channel}_$mappingsVersion"
}
download.run {
src "https://github.com/GTNewHorizons/BON2/releases/download/$bon2Version/BON2-$bon2Version-CUSTOM-all.jar"
dest bon2File
overwrite false
}
download.run {
src sourceURL
dest obfFile
overwrite false
}
exec {
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
workingDir bon2Dir
}
return files(deobfFile)
}
def zipMappings(String zipPath, String url, String bon2Dir) {
File zipFile = new File(zipPath)
if (zipFile.exists()) {
return
}
String fieldsCache = "$bon2Dir/data/fields.csv"
String methodsCache = "$bon2Dir/data/methods.csv"
download.run {
src "${url}fields.csv"
dest fieldsCache
}
download.run {
src "${url}methods.csv"
dest methodsCache
}
zipFile.getParentFile().mkdirs()
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))
zos.putNextEntry(new ZipEntry("fields.csv"))
Files.copy(Paths.get(fieldsCache), zos)
zos.closeEntry()
zos.putNextEntry(new ZipEntry("methods.csv"))
Files.copy(Paths.get(methodsCache), zos)
zos.closeEntry()
zos.close()
}