forked from FlansMods/FlansMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
200 lines (168 loc) · 5.27 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
buildscript {
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
repositories {
jcenter()
maven {
// location of the maven that hosts the forge files
name = "Forge maven"
url = "http://files.minecraftforge.net/maven"
}
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
version = version_major + "." + version_minor + "." + version_patch + version_extra
group = "com.flansmod"
archivesBaseName = "Flan's Mod"
project.ext.set("apocalypseVersion", "1.0")
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
dependencies {
compile "io.vavr:vavr:0.10.2"
shadow "io.vavr:vavr:0.10.2"
}
minecraft {
version = minecraft_version + "-" + forge_version
runDir = "run"
replace "@ALLOWED_VERSIONS@", "[5.6.0-beta, 5.7)"
replace "@VERSION@", project.version
replaceIn "FlansMod.java"
replace "@ALLOWED_VERSIONS_APOCALYPSE@", "[1.0, 1.1)"
replace "@VERSION_APOCALYPSE@", project.apocalypseVersion
replaceIn "FlansModApocalypse.java"
mappings = "stable_39"
//if this is required, it should be enabled locally for selected runs. These runs will take about 10 seconds longer
makeObfSourceJar = false
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "apocalypseversion", project.apocalypseVersion
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, 'apocalypseversion': project.apocalypseVersion,
'mcversion': project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
version = "${project.minecraft.version}-${project.version}"
task mechaParts(type: Jar) {
from 'run/Flan/Mecha Parts Pack'
baseName = 'Mecha Parts'
appendix = 'Content Pack'
}
task modernWeapons(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/mw/' }
from 'run/Flan/Modern Weapons Pack'
baseName = 'Modern Warfare'
appendix = 'Content Pack'
}
task nerf(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/nerf/' }
from 'run/Flan/Nerf Pack'
baseName = 'Nerf'
appendix = 'Content Pack'
}
task simpleParts(type: Jar) {
from 'run/Flan/Parts Pack'
baseName = 'Simple Parts'
appendix = 'Content Pack'
}
task titan(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/titan/' }
from 'run/Flan/Titan Pack'
baseName = 'Titan'
appendix = 'Content Pack'
}
task utility(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/utility/' }
from 'run/Flan/Utility Pack'
baseName = 'Utility'
appendix = 'Content Pack'
}
task ww2(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/ww2/' }
from 'run/Flan/WW2 Pack'
baseName = 'WW2'
appendix = 'Content Pack'
}
task yeOlde(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/yeolde/' }
from 'run/Flan/Ye Olde Pack'
baseName = 'Ye Olde'
appendix = 'Content Pack'
}
task zombie(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/zombie/' }
from 'run/Flan/Zombie Pack'
baseName = 'Zombie'
appendix = 'Content Pack'
}
task apoc(type: Jar) {
from(zipTree("${destinationDir}/${archiveName}")) { include 'com/flansmod/client/model/apocalypse/' }
from 'run/Flan/Apocalypse Pack'
baseName = 'Apocalypse'
appendix = 'Content Pack'
}
task contentPacks() {
dependsOn mechaParts
dependsOn modernWeapons
dependsOn nerf
dependsOn simpleParts
dependsOn titan
dependsOn utility
dependsOn ww2
dependsOn yeOlde
dependsOn zombie
dependsOn apoc
}
task clearOutput(type: Delete) {
delete 'build/output/'
}
task outputJar(type: Jar) {
destinationDir = new File("build/output/mods/")
from(zipTree("build/libs/${archivesBaseName}-${version}-all.jar")) {
exclude '**/apocalypse/'
exclude '**/mw/'
exclude '**/nerf/'
exclude '**/titan/'
exclude '**/utility/'
exclude '**/ww2/'
exclude '**/yeolde/'
exclude '**/zombie/'
}
}
task outputPacks(type: Copy) {
from('build/libs/') {
include "**/*${version}.jar"
exclude "**/Flan's Mod*.jar"
}
into 'build/output/Flan/'
}
shadowJar {
configurations = [project.configurations.shadow]
}
reobf {
shadowJar {
mappingType = "SEARGE"
}
}
tasks.reobfShadowJar.mustRunAfter shadowJar
build {
dependsOn reobfShadowJar
dependsOn contentPacks
dependsOn clearOutput
dependsOn outputJar
dependsOn outputPacks
}