forked from GTNewHorizons/NewHorizonsCoreMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
262 lines (233 loc) · 8.34 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
259
260
261
262
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
//maven {
// name = "forge"
// url = "http://files.minecraftforge.net/maven"
//}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath "de.undercouch:gradle-download-task:3.1.2"
}
}
import de.undercouch.gradle.tasks.download.Download
apply plugin: 'forge'
apply plugin: 'signing'
allprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
file "build.properties" withReader {
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
version = "${config.coremod.version}"
group= "com.dreammaster" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "GTNewHorizonsCoreMod"
minecraft {
version = "${config.minecraft.version}-${config.forge.version}-${config.minecraft.version}"
runDir = "eclipse"
replaceIn "src/main/java/com/dreammaster/lib/Refstrings.java"
replace "GRADLETOKEN_VERSION", project.version.split('-')[1]
}
repositories {
maven {
name 'Forge' // Applied Energistics
url 'http://files.minecraftforge.net/maven'
}
maven { // GalacticGreg, YAMCore,..
name 'UsrvDE'
url "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/"
}
maven { // Baubles
name 'UsrvDE_3rdParty'
url "http://jenkins.usrv.eu:8081/nexus/content/repositories/thirdparty/"
}
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
maven {
name = "ic2, forestry"
url = "http://maven.ic2.player.to/"
}
maven { // AppleCore
url "http://www.ryanliptak.com/maven/"
}
maven {
name = "tterrag"
url = "http://maven.tterrag.com/"
}
maven { // WAILA
name "Mobius Repo"
url "http://mobiusstrip.eu/maven"
}
maven { // OpenComputers
name "OpenComputers"
url "http://maven.cil.li"
}
ivy {
name 'gtnh_download_source_stupid_underscore_typo'
artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]"
}
ivy {
name 'gtnh_download_source'
artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]"
}
}
dependencies {
compile "eu.usrv:YAMCore:${config.minecraft.version}-${config.yamcore.version}:deobf"
compile "com.azanor.baubles:Baubles:${config.baubles.version}:deobf"
compile ("appeng:appliedenergistics2:${config.ae2.version}:api") {
exclude module: '*'
}
compile "applecore:AppleCore:${config.applecore.version}:deobf"
compile "codechicken:CodeChickenLib:${config.minecraft.version}-${config.codechickenlib.version}:dev"
compile "codechicken:CodeChickenCore:${config.minecraft.version}-${config.codechickencore.version}:dev"
compile "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev"
compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev"
compile ("com.enderio:EnderIO:${config.minecraft.version}-${config.enderio.version}:dev") {
exclude group: "mcp.mobius.waila"
}
compile "com.enderio.core:EnderCore:${config.minecraft.version}-${config.endercore.version}:dev"
compile "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
compile fileTree(dir: 'libs', include: '*.jar')
}
task getForestryAPI(type: Download) {
onlyIf {
!file("libs/forestry_1.7.10-4.2.16.64-api.jar").exists()
}
src "https://gregtech.overminddl1.com/net/sengir/forestry/forestry_1.7.10/4.2.16.64/forestry_1.7.10-4.2.16.64-api.jar"
dest file("libs/forestry_1.7.10-4.2.16.64-api.jar")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
task getGalacticGreg(type: Download, dependsOn: "getForestryAPI") {
onlyIf {
!file("libs/GalacticGreg-${config.minecraft.version}-${config.ggreg.version}-deobf.jar").exists()
}
src "http://jenkins.usrv.eu:8080/job/GalacticGreg/${config.ggreg.jenkinsbuild}/artifact/build/libs/GalacticGreg-${config.minecraft.version}-${config.ggreg.version}-deobf.jar"
dest file("libs/GalacticGreg-${config.minecraft.version}-${config.ggreg.version}-deobf.jar")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
task getGregTech(type: Download, dependsOn: "getGalacticGreg") {
onlyIf {
!file("libs/gregtech-${config.gregtech.version}-dev.jar").exists()
}
src "http://jenkins.usrv.eu:8080/job/Gregtech-5-Unofficial/${config.gregtech.jenkinsbuild}/artifact/build/libs/gregtech-${config.gregtech.version}-dev.jar"
dest file("libs/gregtech-${config.gregtech.version}-dev.jar")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
task getHEE(type: Download, dependsOn: "getGregTech") {
onlyIf {
!file("libs/HardcoreEnderExpansion MC-1.7.10 v1.8.6.jar").exists()
}
src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/HardcoreEnderExpansion_MC-1.7.10_v1.8.6.jar'
dest file("libs/HardcoreEnderExpansion MC-1.7.10 v1.8.6.jar")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
task getRailCraft(type: Download, dependsOn: "getHEE") {
onlyIf {
!file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar").exists()
}
src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/Railcraft_1.7.10-9.12.2.0-dev.jar'
dest file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
task getBartworks(type: Download, dependsOn: "getRailCraft") {
onlyIf {
!file("libs/bartworks%5B1.7.10%5D-0.5.13_pre10-dev.jar").exists()
}
src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/bartworks%5B1.7.10%5D-0.5.13_pre10-dev.jar'
dest file("libs/bartworks%5B1.7.10%5D-0.5.13_pre10-dev.jar")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
task getGtPlusPlus(type: Download, dependsOn: "getBartworks") {
onlyIf {
!file("libs/GT-PlusPlus-1.7.05.53.jar").exists()
}
src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/GT-PlusPlus-1.7.05.53.jar'
dest file("libs/GT-PlusPlus-1.7.05.53.jar")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
tasks.setupCIWorkspace.dependsOn getGtPlusPlus
tasks.setupDevWorkspace.dependsOn getGtPlusPlus
tasks.setupDecompWorkspace.dependsOn getGtPlusPlus
tasks.compileJava.dependsOn getGtPlusPlus
processResources
{
def cleanVersion = project.version.split('-')[1]
// this will ensure that this task is redone when the versions change.
inputs.property "version", cleanVersion
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':cleanVersion, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
idea {
module {
inheritOutputDirs = true
}
}
task devJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
manifest {
attributes 'FMLCorePlugin': 'com.dreammaster.coremod.DepLoader','FMLCorePluginContainsFMLMod': 'true'
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives devJar
archives sourceJar
}
task signJar(dependsOn: 'reobf'){
doLast {
ant.signjar(
destDir: jar.destinationDir,
jar: jar.getArchivePath(),
alias: findProperty('keyStoreAlias') ?: '',
keystore: findProperty('keyStore') ?: '',
storepass: findProperty('keyStorePass') ?: '',
digestalg: findProperty('signDigestAlg') ?: '',
tsaurl: findProperty('signTSAurl') ?: '',
verbose: true
)
}
}
jar {
manifest {
attributes 'FMLCorePlugin': 'com.dreammaster.coremod.DreamCoreMod','FMLCorePluginContainsFMLMod': 'true'
}
}