-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
261 lines (198 loc) · 7.41 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
import java.nio.file.Files
import java.nio.file.Paths
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'maven-publish'
evaluationDependsOn(":ZeroCore2-master")
file('build.properties').withReader {
def properties = new Properties()
properties.load(it)
project.ext.config = new ConfigSlurper().parse properties
}
version = "${config.minecraft_version}-${config.mod_version_major}.${config.mod_version_minor}.${config.mod_version_patch}"
group = 'it.zerono.mods.extremereactors'
archivesBaseName = 'ExtremeReactors2'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
minecraft {
mappings channel: 'official', version: config.minecraft_mappings
def runPath = Paths.get(System.getenv('mc_runs'), "forge")
if (!Files.exists(runPath)) {
runPath = Paths.get("${rootProject.projectDir}", "runs")
if (!Files.exists(runPath)) {
Files.createDirectories(runPath)
}
}
def clientRunDir = runPath.resolve("client-${config.minecraft_version}").toFile();
def serverRunDir = runPath.resolve("server-${config.minecraft_version}").toFile();
if (!clientRunDir.exists()) {
clientRunDir.mkdirs();
}
if (!serverRunDir.exists()) {
serverRunDir.mkdirs();
}
runs {
client {
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
workingDirectory clientRunDir
ideaModule "${rootProject.name}.${project.name}.main".replace(' ', '_')
mods {
zerocore {
source project(':ZeroCore2-master').sourceSets.main
}
bigreactors {
source sourceSets.main
}
bigreactorstest {
source sourceSets.test
}
}
}
server {
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
workingDirectory serverRunDir
ideaModule "${rootProject.name}.${project.name}.main".replace(' ', '_')
mods {
zerocore {
source project(':ZeroCore2-master').sourceSets.main
}
bigreactors {
source sourceSets.main
}
bigreactorstest {
source sourceSets.test
}
}
}
data {
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
workingDirectory clientRunDir
ideaModule "${rootProject.name}.${project.name}.main".replace(' ', '_')
args '--mod', 'bigreactors', '--all',
'--existing', file('src/main/resources/'),
'--existing', file('src/generated/resources/'),
'--output', file('src/generated/resources/')
mods {
zerocore {
source project(':ZeroCore2-master').sourceSets.main
}
bigreactors {
source sourceSets.main
}
bigreactorstest {
source sourceSets.test
}
}
}
}
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
processResources {
inputs.property "mod_version", version
inputs.property "mod_name", config.mod_name
inputs.property "minecraft_versionrange", config.minecraft_versionrange
inputs.property "forge_versionrange", config.forge_versionrange
inputs.property "loader_versionrange", config.loader_versionrange
inputs.property "zerocore_versionrange", config.zerocore_versionrange
from(sourceSets.main.resources.srcDirs) {
include 'ExtremeReactors2-master/src/main/resources/META-INF/mods.toml'
expand 'mod_version': version,
'mod_name': config.mod_name,
'minecraft_versionrange': config.minecraft_versionrange,
'forge_versionrange': config.forge_versionrange,
'loader_versionrange': config.loader_versionrange,
'zerocore_versionrange': config.zerocore_versionrange
}
}
repositories {
// jei
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
name = "ModMaven"
url = "https://modmaven.dev"
}
// cc-tweaked
maven {
url 'https://squiddev.cc/maven/'
}
// patchouli
maven {
url 'https://maven.blamejared.com'
}
// cursemaven
maven {
url 'https://www.cursemaven.com'
}
}
dependencies {
minecraft "net.minecraftforge:forge:${config.minecraft_version}-${config.forge_version}"
implementation project(':ZeroCore2-master')
// compile against the JEI API but do not include it at runtime
compileOnly fg.deobf("mezz.jei:jei-${config.minecraft_version}:${config.jei_version}:api")
// at runtime, use the full JEI jar
runtimeOnly fg.deobf("mezz.jei:jei-${config.minecraft_version}:${config.jei_version}")
implementation fg.deobf("org.squiddev:cc-tweaked-${config.minecraft_version}:${config.cctweaked_version}")
// patchouli
compileOnly fg.deobf("vazkii.patchouli:Patchouli:${config.patchouli_version}:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${config.patchouli_version}")
// mekanism
compileOnly "mekanism:Mekanism:${config.mekanism_version}:api"
runtimeOnly fg.deobf("mekanism:Mekanism:${config.mekanism_version}")
runtimeOnly fg.deobf("mekanism:Mekanism:${config.mekanism_version}:additions")
runtimeOnly fg.deobf("mekanism:Mekanism:${config.mekanism_version}:generators")
runtimeOnly fg.deobf("mekanism:Mekanism:${config.mekanism_version}:tools")
// implementation fg.deobf("curse.maven:constructionwand-399558:3562328")
}
task extremereactors_apiJar(type: Jar) {
from(sourceSets.main.allJava) {
include 'it/zerono/mods/extremereactors/api/**'
}
from (sourceSets.main.output) {
include 'it/zerono/mods/extremereactors/api/**'
}
classifier = 'api'
}
jar {
manifest {
attributes 'Specification-Title': config.mod_name
attributes 'Specification-Vendor': 'ZeroNoRyouki'
attributes 'Specification-Version': "2"
attributes 'Implementation-Title': config.mod_name
attributes 'Implementation-Vendor': 'ZeroNoRyouki'
attributes 'Implementation-Version': version
attributes 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
}
finalizedBy('reobfJar')
}
publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
artifact jar
artifact extremereactors_apiJar
}
}
repositories {
maven {
url 'file://' + System.getenv('mc_maven')
}
}
}