forked from rikka0w0/SimElectricity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
220 lines (182 loc) · 4.73 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
dependencies {
runtime fileTree(dir: 'libs', include: '*.jar')
}
version = "1.0.0"
group = "simelectricity" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "SimElectricity"
sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = "1.8"
}
minecraft {
version = "1.11.2-13.20.1.2425"
runDir = "run"
mappings = "stable_32"
}
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 except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
// configure the source folders
sourceSets {
main {
java {
srcDir "src/main/java"
srcDir "librikka/src"
}
resources {
srcDir "src/main/resources"
exclude "**/.md" // exclude readme from localization repo
}
}
}
jar.classifier = 'full'
ext.jarFile = zipTree(jar.archivePath)
def libsDir = new File(System.getenv("LIBS_DIR") ?: "build/libs/")
sourceJar.excludes.addAll(["rikka/**"])
task deobfJar(type: Jar) {
destinationDir = libsDir
doFirst {
from(sourceSets.main.output) {
excludes.addAll(["rikka/**"])
}
}
classifier = 'dev'
}
task standaloneJar(type: Jar, dependsOn: reobfJar) {
destinationDir = libsDir
doFirst {
from(project.ext.jarFile) {
excludes.addAll(["rikka/**"])
}
}
}
task apiSrcJar(type: Jar) {
destinationDir = libsDir
appendix = "api"
classifier = 'sources'
doFirst {
from (sourceSets.main.allSource) {
includes.addAll(["simelectricity/api/**", "simelectricity/essential/api/**"])
}
}
}
task apiDevJar(type: Jar, dependsOn: reobfJar) {
destinationDir = libsDir
appendix = 'api'
classifier = 'dev'
doFirst {
from(sourceSets.main.output) {
includes.addAll(["simelectricity/api/**", "simelectricity/essential/api/**"])
}
}
}
task apiJar(type: Jar, dependsOn: reobfJar) {
destinationDir = libsDir
appendix = 'api'
doFirst {
from(project.ext.jarFile) {
includes.addAll(["simelectricity/api/**", "simelectricity/essential/api/**"])
}
}
}
task energyNetDevJar(type: Jar, dependsOn: reobfJar) {
destinationDir = libsDir
appendix = 'energyNet'
classifier = 'dev'
doFirst {
from(sourceSets.main.output) {
includes.addAll(["simelectricity/**"])
excludes.addAll(["simelectricity/essential/**"])
}
}
}
task energyNetJar(type: Jar, dependsOn: reobfJar) {
destinationDir = libsDir
appendix = 'energyNet'
doFirst {
from(project.ext.jarFile) {
includes.addAll(["simelectricity/**"])
excludes.addAll(["simelectricity/essential/**"])
}
}
}
build.dependsOn deobfJar, standaloneJar, apiJar, apiDevJar, apiSrcJar, energyNetDevJar, energyNetJar
dependencies {
}
task clearMOD << {
println 'clear mods'
delete "run/mods"
mkdir 'run/mods'
}
task copyIC << {
println 'copying ic'
copy{
into 'run/mods'
from('archive/devLibs'){
include 'industrialcraft-2-2.7.83-ex111-dev.jar'
}
}
}
task copyBC << {
println 'copying bc'
copy{
into 'run/mods'
from('archive/devLibs'){
include 'buildcraft-7.99.7.jar'
}
}
}
task runWithBC {
doFirst {
clearMOD.execute()
copyBC.execute()
}
group = 'forgegradle'
finalizedBy runClient
}
task runWithIC {
doFirst {
clearMOD.execute()
copyIC.execute()
}
group = 'forgegradle'
finalizedBy runClient
}
task runWithALL {
doFirst {
clearMOD.execute()
copyIC.execute()
copyBC.execute()
}
group = 'forgegradle'
finalizedBy runClient
}