-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
246 lines (205 loc) · 6.58 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
plugins {
id("net.neoforged.moddev") version "2.0.30-beta"
id("com.matthewprenger.cursegradle") version "1.4.0"
id("com.diffplug.spotless") version "6.23.3"
id("com.modrinth.minotaur") version "2.8.7"
}
group = "me.ramidzkh"
version = System.getenv("MOD_VERSION") ?: "0.0.0"
repositories {
maven {
name = "Modmaven"
url = uri("https://modmaven.dev/")
content {
includeGroup("appeng")
includeGroup("blusunrize.immersiveengineering")
includeGroup("mekanism")
}
}
exclusiveContent {
forRepository {
maven {
name = "Jared maven"
url = uri("https://maven.blamejared.com")
}
}
filter {
includeGroup("mezz.jei")
includeGroup("mezz.jei")
}
}
exclusiveContent {
forRepository {
maven {
name = "CurseForge"
url = uri("https://www.cursemaven.com")
}
}
filter {
includeGroup("curse.maven")
}
}
maven {
url "https://maven.terraformersmc.com"
content {
includeGroup "dev.emi"
}
}
mavenLocal()
}
neoForge {
version = project.neoforge_version
}
dependencies {
//implementation("blusunrize.immersiveengineering:ImmersiveEngineering:${minecraft_version}-${ie_version}")
implementation files("deps/ImmersiveEngineering-${minecraft_version}-${ie_version}.jar")
// We depend on many AE2 internals, such as using their basic cell drive, thus not using classifier = "api"
implementation("appeng:appliedenergistics2:${ae2_version}")
runtimeOnly("mekanism:Mekanism:${minecraft_version}-${mekanism_version}:all") {
exclude(group: "com.blamejared.crafttweaker")
}
if (project.runtime_itemlist_mod == "jei") {
implementation "mezz.jei:jei-${project.minecraft_version}-neoforge:${project.jei_version}"
} else {
compileOnly "mezz.jei:jei-${project.minecraft_version}-neoforge:${project.jei_version}"
}
if (project.runtime_itemlist_mod == "emi") {
implementation "dev.emi:emi-neoforge:${project.emi_version}+${project.minecraft_version}"
// Add JEI so that we can use EMI's builtin compat layer
runtimeOnly "mezz.jei:jei-${project.minecraft_version}-neoforge:${project.jei_version}"
} else {
compileOnly "dev.emi:emi-neoforge:${project.emi_version}+${project.minecraft_version}"
}
if (!(project.runtime_itemlist_mod in ["jei", "emi"])) {
throw new GradleException("Invalid runtime_itemlist_mod value: " + project.runtime_itemlist_mod)
}
compileOnly("curse.maven:jade-324717:${jade_id}")
}
sourceSets {
main {
resources {
srcDir("src/generated/resources")
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
////////////////////
// Minecraft
neoForge {
mods {
immeng {
sourceSet sourceSets.main
}
}
runs {
configureEach {
systemProperty("forge.logging.console.level", "debug")
}
client {
client()
}
server {
server()
programArgument '--nogui'
}
data {
data()
programArguments.addAll "--mod", "immeng", "--all", "--output", file("src/generated/resources/").getAbsolutePath(), "--existing", file("src/main/resources/").getAbsolutePath()
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
version: version,
loader_version_range: loader_version_range,
neo_version_range: neo_version_range,
ae2_version_range: ae2_version_range,
ie_version_range: ie_version_range,
]
inputs.properties(replaceProperties)
filesMatching(["META-INF/neoforge.mods.toml"]) {
expand replaceProperties
}
}
/////////////
// Spotless
spotless {
java {
target("src/main/java/**/*.java")
endWithNewline()
indentWithSpaces()
removeUnusedImports()
toggleOffOn()
eclipse().configFile("codeformat/codeformat.xml")
importOrderFile("codeformat/ae2.importorder")
}
format("json") {
target("src/*/resources/**/*.json")
targetExclude("src/generated/resources/**")
prettier().config(parser: "json")
}
}
////////////////
// CurseForge
System.getenv("CURSEFORGE")?.with { String key ->
curseforge {
apiKey = key
project {
id = "992377"
changelogType = "markdown"
changelog = "View changelog at [the release page](https://github.com/AppliedEnergistics/Immersive-Energistics/releases/tag/${version})"
if (version.contains("alpha")) {
releaseType = "alpha"
} else if (version.contains("beta")) {
releaseType = "beta"
} else {
releaseType = "release"
}
addGameVersion("${minecraft_version}")
addGameVersion("NeoForge")
mainArtifact(jar) {
displayName = "${project.version}"
relations {
requiredDependency("applied-energistics-2")
requiredDependency("immersive-engineering")
}
}
}
}
}
////////////////
// Modrinth
modrinth {
token.set(System.getenv("MODRINTH"))
projectId.set("immersive-energistics")
changelog.set("View changelog at [the release page](https://github.com/AppliedEnergistics/Immersive-Energistics/releases/tag/${version})")
versionNumber.set(project.version)
if (version.contains("alpha")) {
versionType.set("alpha")
} else if (version.contains("beta")) {
versionType.set("beta")
} else {
versionType.set("release")
}
uploadFile.set(jar)
gameVersions.add(minecraft_version)
loaders.add("neoforge")
dependencies {
required.project("ae2")
required.project("immersiveengineering")
}
}
tasks.modrinth.onlyIf {
System.getenv("MODRINTH")
}