forked from Unknown025/Flans-Mod-Plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
253 lines (214 loc) · 6.52 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url = "https://repo1.maven.org/maven2/"
}
dependencies {
// Requires Gradle 4+
classpath('com.anatawa12.forge:ForgeGradle:1.2-1.1.+') {
changing = true
}
}
}
}
apply plugin: 'forge'
apply plugin: 'maven-publish'
version = "1.60"
group = "com.flansmod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Flan's Mod Ultimate Stability Edition"
sourceCompatibility = 1.7
targetCompatibility = 1.7
minecraft {
version = "1.7.10-10.13.4.1614-1.7.10"
runDir = "eclipse"
replace "@VERSION@", project.version
replaceIn "FlansMod.java"
replaceIn "MechaPartsPackMod.java"
replaceIn "ModernWeaponsPackMod.java"
replaceIn "NerfPackMod.java"
replaceIn "SimplePartsPackMod.java"
replaceIn "TitanPackMod.java"
replaceIn "UtilityPackMod.java"
replaceIn "WW2PackMod.java"
replaceIn "YeOldePackMod.java"
replaceIn "ZombiePackMod.java"
}
dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
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': project.version, '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 clearOutput(type: Delete) {
delete 'build/output/'
}
task outputJar(type: Jar) {
destinationDir = new File("build/output/mods/")
from(zipTree("build/libs/${archiveName}")) {
exclude '**/mechaparts/'
exclude '**/modernweapons/'
exclude '**/mw/'
exclude '**/nerf/'
exclude '**/simpleparts/'
exclude '**/titan/'
exclude '**/utility/'
exclude '**/ww2/'
exclude '**/yeolde/'
exclude '**/zombie/'
}
// archiveName = "${archivesBaseName} ${version} [1.7.10].jar"
}
task srcJar(type: Jar) {
classifier = 'sources'
from(sourceSets.main.allSource) {
exclude '**/mechaparts/'
exclude '**/modernweapons/'
exclude '**/mw/'
exclude '**/nerf/'
exclude '**/simpleparts/'
exclude '**/titan/'
exclude '**/utility/'
exclude '**/ww2/'
exclude '**/yeolde/'
exclude '**/zombie/'
}
}
task outputPacks(type: Copy) {
from('build/libs/') {
include "**/*${version}.jar"
exclude "**/${archivesBaseName}*.jar"
}
into 'build/output/mods/'
}
task deobfJar(type: Jar) {
classifier = 'deobf'
from sourceSets.main.output
exclude '**/mechaparts/'
exclude '**/modernweapons/'
exclude '**/mw/'
exclude '**/nerf/'
exclude '**/simpleparts/'
exclude '**/titan/'
exclude '**/utility/'
exclude '**/ww2/'
exclude '**/yeolde/'
exclude '**/zombie/'
}
task mechaParts(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/mechaparts/' }
from 'eclipse/Flan/Mecha Parts Pack'
baseName = 'Mecha Parts'
appendix = 'Content Pack'
}
task modernWeapons(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/modernweapons/' }
from 'eclipse/Flan/Modern Weapons Pack'
baseName = 'Modern Warfare'
appendix = 'Content Pack'
}
task nerf(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/nerf/' }
from 'eclipse/Flan/Nerf Pack'
baseName = 'Nerf'
appendix = 'Content Pack'
}
task simpleParts(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/simpleparts/' }
from 'eclipse/Flan/Parts Pack'
baseName = 'Simple Parts'
appendix = 'Content Pack'
}
task titan(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/titan/' }
from 'eclipse/Flan/Titan Pack'
baseName = 'Titan'
appendix = 'Content Pack'
}
task utility(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/utility/' }
from 'eclipse/Flan/Utility Pack'
baseName = 'Utility'
appendix = 'Content Pack'
}
task ww2(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/ww2/' }
from 'eclipse/Flan/WW2 Pack'
baseName = 'WW2'
appendix = 'Content Pack'
}
task yeOlde(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/yeolde/' }
from 'eclipse/Flan/Ye Olde Pack'
baseName = 'Ye Olde'
appendix = 'Content Pack'
}
task zombie(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/zombie/' }
from 'eclipse/Flan/Zombie Pack'
baseName = 'Zombie'
appendix = 'Content Pack'
}
task contentPacks() {
dependsOn mechaParts
dependsOn modernWeapons
dependsOn nerf
dependsOn simpleParts
dependsOn titan
dependsOn utility
dependsOn ww2
dependsOn yeOlde
dependsOn zombie
}
build {
dependsOn contentPacks
dependsOn clearOutput
dependsOn outputJar
dependsOn deobfJar
dependsOn outputPacks
}
runClient {
jvmArgs "-Xmx2G", "-Xms2G"
}
runServer {
jvmArgs "-Xmx2G", "-Xms2G"
}
def customGradle = rootProject.file('custom.gradle');
if (customGradle.exists()) {
apply from: customGradle;
}