forked from mekanism/Mekanism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
332 lines (296 loc) · 9.96 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
defaultTasks 'fullBuild'
buildscript {
repositories {
jcenter()
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:2.3-SNAPSHOT'
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.0.9"
}
}
apply plugin: 'idea'
idea {
module {
// For some reason this is necessary for IDEA 2014 workspaces to recognize assets
inheritOutputDirs = true
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.matthewprenger.cursegradle'
repositories {
maven {
name 'ForgeFS'
url 'http://files.minecraftforge.net/maven'
}
maven {
name 'amadornes'
url 'http://maven.amadornes.com/'
}
maven {
name 'prog'
url 'http://dvs1.progwml6.com/files/maven'
}
maven {
name 'tesla'
url 'http://maven.epoxide.org'
}
maven {
name 'curseforge'
url 'https://minecraft.curseforge.com/api/maven/'
}
maven {
name 'opencomputers'
url 'http://maven.cil.li/'
}
maven {
name 'hwyla'
url 'http://tehnut.info/maven'
}
maven {
name 'CoFH Maven'
url = 'http://maven.covers1624.net'
}
maven {
name 'buildcraft'
url 'https://mod-buildcraft.com/maven/'
}
maven {
name 'tterrag'
url 'http://maven.tterrag.com/'
}
maven {
name 'ic2'
url 'http://maven.ic2.player.to'
}
maven {
name 'BlameJared - Crafttweaker'
url 'http://maven.blamejared.com/'
}
maven {
name 'thiakil'
url 'http://maven.thiakil.com'
}
}
// Define properties file
ext.configFile = file "build.properties"
configFile.withReader {
// Load config. It shall from now be referenced as simply config or project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
group = "mekanism"
version = "${config.minecraft_version}-${config.mod_version}." + (System.env.BUILD_NUMBER ?: "homebaked")
archivesBaseName = "MekanismAll"
libsDirName = "../output"
distsDirName = "../output"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
minecraft {
version = config.minecraft_version + "-" + config.forge_version
mappings = "${config.mappings_version}"
runDir = "run"
useDepAts = true
replace '${version}', project.version
replaceIn "Mekanism.java"
}
dependencies {
deobfCompile "MCMultiPart2:MCMultiPart:${config.mcmp_version}"
compileOnly "mezz.jei:jei_1.12:${config.jei_version}:api"
runtime "mezz.jei:jei_1.12:${config.jei_version}"
compileOnly "net.darkhax.tesla:Tesla-1.12:${config.tesla_version}"
compileOnly "inventory-tweaks:InventoryTweaks:${config.invtweak_version}:api"
compileOnly "li.cil.oc:OpenComputers:MC1.11.2-${config.opencomputers_version}:api" // Not updated yet
deobfCompile "mcp.mobius.waila:Hwyla:${config.hwyla_version}"
deobfCompile "cofh:RedstoneFlux:1.12-${config.redstoneflux_version}:universal"
compileOnly "com.mod-buildcraft:buildcraft-api:${config.buildcraft_version}"
compileOnly "team.chisel.ctm:CTM:MC1.12-${config.ctm_version}:api"
runtime "team.chisel.ctm:CTM:MC1.12-${config.ctm_version}"
compileOnly "net.industrial-craft:industrialcraft-2:${config.ic2_version}:api"
compileOnly ("CraftTweaker2:CraftTweaker2-API:${config.crafttweaker_version}") {
exclude module: "asm-debug-all"
}
runtime ("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${config.crafttweaker_version}") {
exclude module: "asm-debug-all"
}
compileOnly "com.blamejared:MTLib:${config.mtlib_version}"
compileOnly "dan200.computercraft:ComputerCraft:${config.computercraft_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${config.top_version}:api"
}
processResources
{
inputs.property "version", project.version
inputs.property "mc_version", config.minecraft_version
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
// replace version and mcversion
expand "version": project.version, "mc_version": config.minecraft_version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude '**/*.blend*'
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
jar {
manifest {
attributes 'FMLAT': 'mekanism_at.cfg'
}
}
task coreJar(type: Jar) {
archiveName = "Mekanism-${project.version}.jar"
dependsOn 'reobfJar'
classifier "core"
from('etc/core') {
include '*.info'
expand 'version':project.version,'mc_version':config.minecraft_version,'mcmp_version':config.mcmp_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
exclude 'mekanism/tools/**', 'mekanism/generators/**', 'assets/mekanismtools/**', 'assets/mekanismgenerators/**', 'mcmod.info'
}
manifest {
attributes 'FMLAT': 'mekanism_at.cfg'
}
}
task toolsJar(type: Jar) {
archiveName = "MekanismTools-${project.version}.jar"
dependsOn 'reobfJar'
classifier "tools"
from('etc/tools') {
include '*.info'
expand 'version':project.version,'mc_version':config.minecraft_version,'mcmp_version':config.mcmp_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
include 'mekanism/tools/**', 'assets/mekanismtools/**'
}
}
task generatorsJar(type: Jar) {
archiveName = "MekanismGenerators-${project.version}.jar"
dependsOn 'reobfJar'
classifier "generators"
from('etc/generators') {
include '*.info'
expand 'version':project.version,'mc_version':config.minecraft_version,'mcmp_version':config.mcmp_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
include 'mekanism/generators/**', 'assets/mekanismgenerators/**'
}
}
task apiJar(type: Jar) {
classifier "api"
baseName "Mekanism"
dependsOn "sourceMainJava"
include 'mekanism/api/**'
from sourceSets.main.java.srcDirs
from sourceSets.main.output
}
artifacts {
archives apiJar
archives coreJar
archives toolsJar
archives generatorsJar
}
task fullBuild(type: Delete) {
delete jar
dependsOn "build"
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
uploadArchives {
if(System.getenv("LOCAL_MAVEN") != null) {
repositories {
mavenDeployer {
repository(url: "file://"+System.getenv("LOCAL_MAVEN"))
pom {
groupId = project.group
version = project.version
if (System.getenv("MAVEN_ARTIFACT") != null) {
artifactId = System.getenv("MAVEN_ARTIFACT")
} else {
artifactId = "Mekanism"
}
project {
name "Mekanism"
packaging 'jar'
description 'Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to create powerful tools, armor, and weapons.'
url 'http://aidancbrady.com/mekanism/'
scm {
url 'https://github.com/aidancbrady/Mekanism.git'
}
issueManagement {
system 'github'
url 'https://github.com/aidancbrady/Mekanism/issues'
}
licenses {
license {
name 'MIT'
distribution 'repo'
}
}
}
}
}
}
}
}
tasks.curseforge.dependsOn coreJar, toolsJar, generatorsJar, apiJar
if (System.getenv("CURSEFORGE_KEY") != null) {
curseforge {
apiKey = System.getenv("CURSEFORGE_KEY")
//Core
project {
id = '268560'
changelogType = "html"
changelog = "Please see <a href=\"http://aidancbrady.com/mekanism/download/legacy/\">http://aidancbrady.com/mekanism/download/legacy/</a> for changelog."
// A file can also be set using: changelog = file('changelog.txt')
releaseType = 'release'
mainArtifact coreJar
addArtifact apiJar
addGameVersion '1.12'
addGameVersion '1.12.1'
addGameVersion '1.12.2'
}
//Tools
project {
id = '268567'
changelogType = "html"
changelog = "Please see <a href=\"http://aidancbrady.com/mekanism/download/legacy/\">http://aidancbrady.com/mekanism/download/legacy/</a> for changelog." // A file can also be set using: changelog = file('changelog.txt')
releaseType = 'release'
mainArtifact(toolsJar){
relations {
requiredLibrary "mekanism"
}
}
addGameVersion '1.12'
addGameVersion '1.12.1'
addGameVersion '1.12.2'
}
//Generators
project {
id = '268566'
changelogType = "html"
changelog = "Please see <a href=\"http://aidancbrady.com/mekanism/download/legacy/\">http://aidancbrady.com/mekanism/download/legacy/</a> for changelog." // A file can also be set using: changelog = file('changelog.txt')
releaseType = 'release'
mainArtifact(generatorsJar) {
relations {
requiredLibrary "mekanism"
}
}
addGameVersion '1.12'
addGameVersion '1.12.1'
addGameVersion '1.12.2'
}
}
}