-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle.kts
192 lines (167 loc) · 5.2 KB
/
build.gradle.kts
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
plugins {
id("net.neoforged.moddev") version "2.0.73"
id("com.diffplug.spotless") version "7.0.0.BETA2"
id("maven-publish")
}
val ae2Version: String by project
val architecturyVersion: String by project
val runtimeItemlistMod: String by project
val jeiMinecraftVersion: String by project
val jeiVersion: String by project
val reiVersion: String by project
val emiVersion: String by project
val emiMinecraftVersion: String by project
val neoforgeVersion: String by project
val curiosVersion: String by project
val mavenGroup: String by project
val modID: String by project
version = "0.0.0-SNAPSHOT"
val pr = System.getenv("PR_NUMBER") ?: ""
if (pr != "") {
version = "0.0.0-pr$pr"
}
val tag = System.getenv("TAG") ?: ""
if (tag != "") {
version = tag
}
val artifactVersion = version
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
dependencies {
//implementation("top.theillusivec4.curios:curios-neoforge:${curiosVersion}")
implementation("appeng:appliedenergistics2:${ae2Version}")
jarJar(project(path = ":ae2wtlib_api"))
api(project(path = ":ae2wtlib_api"))
compileOnly("me.shedaniel:RoughlyEnoughItems-neoforge:${reiVersion}")
compileOnly("mezz.jei:jei-${jeiMinecraftVersion}-neoforge:${jeiVersion}")
compileOnly("dev.emi:emi-neoforge:${emiVersion}+${emiMinecraftVersion}:api")
when (runtimeItemlistMod) {
"rei" -> {
runtimeOnly("me.shedaniel:RoughlyEnoughItems-neoforge:${reiVersion}")
runtimeOnly("dev.architectury:architectury-neoforge:${architecturyVersion}")
}
"jei" -> runtimeOnly("mezz.jei:jei-${jeiMinecraftVersion}-neoforge:${jeiVersion}")
"emi" -> {
runtimeOnly("dev.emi:emi-neoforge:${emiVersion}+${emiMinecraftVersion}")
}
"jemi" -> {
runtimeOnly("dev.emi:emi-neoforge:${emiVersion}+${emiMinecraftVersion}")
runtimeOnly("mezz.jei:jei-${jeiMinecraftVersion}-neoforge:${jeiVersion}")
}
}
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
//testing
//runtimeOnly(fg.deobf("maven.modrinth:aeinfinitybooster:1.20.1-1.0.0+20"))
//implementation("maven.modrinth:spark:1.10.109-neoforge")
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://modmaven.dev/")
content {
includeGroup("appeng")
includeGroup("mezz.jei")
}
}
maven {
url = uri("https://maven.shedaniel.me/")
content {
includeGroup("me.shedaniel")
includeGroup("me.shedaniel.cloth")
includeGroup("dev.architectury")
}
}
maven {
url = uri("https://maven.terraformersmc.com/")
content {
includeGroup("dev.emi")
}
}
maven {
url = uri("https://maven.theillusivec4.top/")
content {
includeGroup("top.theillusivec4.curios")
}
}
maven {
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
}
}
tasks {
processResources {
// Ensure the resources get re-evaluate when the version changes
inputs.property("version", version)
inputs.property("ae2_version", ae2Version)
val replaceProperties = mapOf(
"version" to version as String, "ae2_version" to ae2Version
)
inputs.properties(replaceProperties)
filesMatching("META-INF/neoforge.mods.toml") {
expand(replaceProperties)
}
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
}
neoForge {
version = neoforgeVersion
mods {
create(modID) {
sourceSet(sourceSets.main.get())
}
}
runs {
configureEach {
gameDirectory.file("run")
systemProperty("forge.logging.console.level", "debug")
}
create("client") {
client()
}
create("server") {
server()
}
create("guide") {
client()
systemProperty("guideDev.ae2guide.startupPage", "ae2:index.md")
systemProperty("guideDev.ae2guide.sources", file("src/main/resources/assets/ae2wtlib/ae2guide").absolutePath)
}
}
}
publishing {
publications {
create<MavenPublication>(modID) {
groupId = mavenGroup
artifactId = modID
version = artifactVersion.toString()
from(components["java"])
}
}
repositories {
maven {
credentials {
username = System.getenv("MODMAVEN_USER")
password = System.getenv("MODMAVEN_PASSWORD")
}
name = "modmaven"
url = uri("https://modmaven.dev/artifactory/local-releases/")
}
}
}
spotless {
java {
target("/src/**/java/**/*.java")
endWithNewline()
indentWithSpaces()
removeUnusedImports()
toggleOffOn()
eclipse().configFile("codeformat/codeformat.xml")
importOrderFile("codeformat/ae2wtlib.importorder")
}
}