-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.gradle
205 lines (178 loc) · 6.56 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
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
buildscript {
repositories {
gradlePluginPortal()
maven { url "https://maven.minecraftforge.net" }
maven { url "https://repo.spongepowered.org/repository/maven-public/" }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
classpath "org.spongepowered:mixingradle:0.6-SNAPSHOT"
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "org.spongepowered.mixin"
version = project.mod_version
group = "stevekung.mods.moreplanets"
archivesBaseName = "More-Planets-All"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = 1.8
minecraft {
version = "${forge_version}"
runDir = "run"
mappings = "${mcp_mapping}"
makeObfSourceJar = false
def jvms = "-Dfml.coreMods.load=micdoodle8.mods.miccore.MicdoodlePlugin -Dmixin.checks.interfaces=true -Dmixin.hotSwap=true -Dmixin.debug.export=true -Dmixin.debug.verbose=true";
def runArgs = "--mixin mixins.more_planets.json"
clientJvmArgs += jvms
clientRunArgs += runArgs
serverJvmArgs += jvms
serverRunArgs += runArgs
serverRunArgs += "nogui"
if (project.hasProperty("username") && project.hasProperty("uuid")) {
clientRunArgs += "--username ${username} --uuid ${uuid}"
}
replace "4.0.1.-1", project.gc_require_version
replaceIn "MorePlanetsMod.java"
}
repositories {
maven {
name "SpongePowered"
url "https://repo.spongepowered.org/repository/maven-public/"
}
maven {
name "CurseMaven"
url "https://www.cursemaven.com"
}
maven {
name "CurseForge"
url "https://minecraft.curseforge.com/api/maven/"
}
maven {
name "JEI"
url "https://dvs1.progwml6.com/files/maven"
}
maven {
name "Buildcraft"
url "https://mod-buildcraft.com/maven/"
}
maven {
name "AA"
url "https://maven.ellpeck.de/"
}
maven {
name "Modmaven"
url "https://modmaven.dev/"
}
maven {
name "MixinBooter"
url "https://maven.cleanroommc.com/"
}
maven {
name "Galacticraft Legacy"
url "https://maven.galacticraft.net/repository/legacy/"
}
flatDir {
dirs "libs"
}
mavenLocal()
}
dependencies {
// Galacticraft deps
compile "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
compile "mekanism:Mekanism-1.12.2:9.7.5.376:api"
compile "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.12.2-7.0.1.2441:api"
compile "com.mod-buildcraft:buildcraft-api:7.99.24.6"
compile "curse.maven:redstoneflux-1.1.1-270789:2920436"
compile "industrial-craft:industrialcraft-2-2.8.157:ex112:api"
compile "curse.maven:playerapi-1.1-449521:3212872"
compile "de.ellpeck.actuallyadditions:ActuallyAdditions_1.12.2:1.12.2-r151:api"
deobfCompile ("dev.galacticraft:galacticraft-legacy:${gc_require_version}") {
exclude group: "mod.dependency", module: "mekanism"
exclude group: "mod.dependency", module: "industrialcraft-2"
exclude group: "mod.dependency", module: "buildcraft-api"
}
// More Planets deps
String libs = "stevekung's-lib-mc${minecraft_version}-v${stevekung_lib_version}-deobf"
if (file("libs/${libs}.jar").exists()) {
// Don't forget to copy deobf jar into mods folder, all mixins and classes are loaded when running in dev but an actual "mod" doesn't. Weird -.-
deobfCompile ":${libs}"
}
else {
deobfCompile "curse.maven:stevekungs-lib-296019:4429451"
}
deobfCompile "zone.rong:mixinbooter:${mixinbooter_version}"
deobfCompile "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
deobfCompile "curse.maven:codechicken-lib-1-8-242818:2779848"
deobfCompile "curse.maven:hwyla-253449:2568751"
deobfCompile "curse.maven:baubles-227083:2518667"
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
runtime "ctm:CTM:MC${minecraft_version}:${ctm_version}"
compile "org.spongepowered:mixin:${mixin_version}"
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
}
sourceSets {
main {
ext.refMap = "mixins.more_planets.refmap.json"
}
}
jar {
manifest {
attributes("FMLAT": "moreplanets_at.cfg",
"FMLCorePluginContainsFMLMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs": "mixins.more_planets.json",
"ForceLoadAsMod": "true"
)
}
baseName = "More-Planets-" + project.minecraft_version
}
curseforge {
apiKey = project.hasProperty("curseforge_api_token") ? project.curseforge_api_token : ""
project {
id = "261990"
changelog = file("CHANGE_LOG.md")
changelogType = "markdown"
releaseType = "release"
addGameVersion project.minecraft_version
mainArtifact(jar) {
displayName = "More-Planets-" + project.minecraft_version + "-" + project.mod_version
relations {
requiredLibrary "galacticraft-legacy"
requiredLibrary "stevekungs-lib"
requiredLibrary "mixin-booter"
optionalLibrary "jei"
optionalLibrary "ctm"
optionalLibrary "hwyla"
optionalLibrary "jeid"
}
}
}
}
tasks.curseforge.dependsOn(build)
jar.finalizedBy("reobfJar")
if (project.hasProperty("version_lib_dir")) {
tasks.register("updateVersionLib") {
group "upload"
def versionFile = file("${version_lib_dir}/more_planets_version.json")
def jsonBuilder = new JsonBuilder(new JsonSlurper().parseText(versionFile.text))
def jsonElement = jsonBuilder.content
def formattedList = []
def modVersion = project.mod_version.substring(0, 5)
jsonElement.promos."${minecraft_version}-latest" = modVersion
jsonElement.promos."${minecraft_version}-recommended" = modVersion
def reader = new BufferedReader(new FileReader(rootProject.file("CHANGE_LOG.md")));
def line;
for (int ln = 0; (line = reader.readLine()) != null; ln++) {
if (ln >= 2) {
formattedList.add(line)
}
}
jsonElement."${minecraft_version}"."${modVersion}" = formattedList.join("\n")
versionFile.text = jsonBuilder.toPrettyString()
}
}