-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
227 lines (189 loc) · 7.42 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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.+'
id 'net.neoforged.gradle.mixin' version '7.0.+'
}
evaluationDependsOn(':Phosphophyllite')
evaluationDependsOn(':Quartz')
version = "${majorVersion}.${minorVersion}.${patchVersion}"
if (!"${postfixVersion}".isEmpty()) {
version += "-${postfixVersion}"
}
group = "net.roguelogix.${mod_id}"
base {
archivesName = "${mod_id}-${mc_version}"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
//accessTransformers {
// file 'src/main/resources/META-INF/accesstransformer.cfg'
//}
runs {
configureEach {
workingDirectory project.file("run/${it.name}")
systemProperty 'forge.logging.markers', 'SCAN,REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
modSource project(':Quartz').sourceSets.main
modSource project(':Phosphophyllite').sourceSets.main
dependencies {
runtime("org.lwjgl:lwjgl-opencl:3.3.1") {
transitive(false)
}
runtime("org.lwjgl:lwjgl-vulkan:3.3.1"){
transitive(false)
}
}
}
client {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven {
url = "https://www.cursemaven.com"
}
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
maven {
// mekanism
url 'https://modmaven.dev/'
}
maven {
// computer craft
url 'https://squiddev.cc/maven/'
content {
includeGroup("cc.tweaked")
includeModule("org.squiddev", "Cobalt")
}
}
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
compileOnly project(':Phosphophyllite')
compileOnly project(':Quartz')
compileOnly("cc.tweaked:cc-tweaked-${cc_mc_version}-core-api:${cc_version}")
compileOnly("cc.tweaked:cc-tweaked-${cc_mc_version}-forge-api:${cc_version}")
// runtimeOnly("cc.tweaked:cc-tweaked-${cc_mc_version}-forge:${cc_version}")
compileOnly("mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}")
compileOnly("mezz.jei:jei-${jei_mc_version}-forge-api:${jei_version}")
// at runtime, use the full JEI jar for Forge
// runtimeOnly("mezz.jei:jei-${jei_mc_version}-forge:${jei_version}")
compileOnly "mekanism:Mekanism:1.19.2-10.3.5.474:api"
// runtimeOnly 'curse.maven:MEK-268560:4041164'
// runtimeOnly 'curse.maven:MEKG-268566:4041168'
// runtimeOnly 'curse.maven:COFHCore-69162:4385216'
// runtimeOnly 'curse.maven:ThermalFoundation-222880:4382373'
// runtimeOnly 'curse.maven:ThermalExpansion-69163:4382371'
// runtimeOnly 'curse.maven:ThermalDynamics-227443:4391160'
// runtimeOnly 'curse.maven:Rubidium-574856:4448157'
// runtimeOnly 'curse.maven:Oculus-581495:4578741'
// runtimeOnly 'curse.maven:WorldStripper-250603:3545856')
// runtimeOnly 'curse.maven:CW-399558:3926815')
compileOnly("org.lwjgl:lwjgl-opencl:3.3.1") {
transitive(false)
}
compileOnly("org.lwjgl:lwjgl-vulkan:3.3.1"){
transitive(false)
}
}
gradle.projectsEvaluated {
var phosVersionRange = project.project(":Phosphophyllite").property("compatibility").toString().split(',')
var phosMinVersion = phosVersionRange[0].substring(1)
var phosMaxVersion = phosVersionRange[1].substring(1, phosVersionRange[1].length() - 1)
var phosRequirementString = "Requires [Phosphophyllite](https://www.curseforge.com/minecraft/mc-mods/phosphophyllite) version of at least " + phosMinVersion + " but less than " + phosMaxVersion
var quartzVersionRange = project.project(":Quartz").property("compatibility").toString().split(',')
var quartzMinVersion = quartzVersionRange[0].substring(1)
var quartzMaxVersion = quartzVersionRange[1].substring(1, quartzVersionRange[1].length() - 1)
var quartzRequirementString = "Requires [Quartz](https://www.curseforge.com/minecraft/mc-mods/quartz) version of at least " + quartzMinVersion + " but less than " + quartzMaxVersion
println(phosRequirementString)
println(quartzRequirementString)
println("::set-output name=phos_version_range::" + phosRequirementString)
println("::set-output name=quartz_version_range::" + quartzRequirementString)
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
minecraft_version : mc_version,
neo_version : neo_version,
loader_version : loader_version,
version : version,
phos_version_range : project.project(":Phosphophyllite").property("compatibility").toString(),
quartz_version_range: project.project(":Quartz").property("compatibility").toString(),
]
inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}
}
tasks.named('jar', Jar).configure {
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : "BiggerSeries",
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : "BiggerSeries",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.named('publish').configure {
dependsOn 'reobfJar'
mustRunAfter 'reobfJar'
}
tasks.register('sourcesJar', Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives sourcesJar
}
publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
artifact sourcesJar
}
}
repositories {
maven {
url "file://${project.projectDir}/publishlocal"
}
}
}
// NeoGradle bug, this works around it
gradle.projectsEvaluated {
var subProjects = List.of(project.project(':Quartz'), project.project(':Phosphophyllite'))
var neoFormJoinDownloadAssetsTaskName = null
for (final def taskName in project.tasks.getNames()) {
if (taskName.contains("neoFormJoined") && taskName.contains("DownloadAssets")) {
neoFormJoinDownloadAssetsTaskName = taskName
break
}
}
var lastTask = project.tasks.getByPath(neoFormJoinDownloadAssetsTaskName)
for (final def subProject in subProjects) {
var nextTask = subProject.tasks.getByPath(neoFormJoinDownloadAssetsTaskName);
lastTask.mustRunAfter(nextTask)
lastTask = nextTask
}
}