forked from Mari023/AE2WirelessTerminalLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
199 lines (179 loc) · 5.65 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
193
194
195
196
197
198
199
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
}
plugins {
id("fabric-loom") version "1.3-SNAPSHOT"
id("com.diffplug.spotless") version "6.21.0"
id("maven-publish")
id("io.github.juuxel.loom-vineflower") version "1.11.0"
java
idea
}
val modVersion: String by project
val modloader: String by project
val minecraftVersion: String by project
val parchmentMinecraftVersion: String by project
val parchmentVersion: String by project
val fabricLoaderVersion: String by project
val fabricApiVersion: String by project
val trinketsVersion: String by project
val ccaVersion: String by project
val clothVersion: String by project
val modMenuVersion: String by project
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
version = "$modVersion-SNAPSHOT"
val pr = System.getenv("PR_NUMBER") ?: ""
if (pr != "") {
version = "$modVersion+pr$pr"
}
val tag = System.getenv("TAG") ?: ""
if (tag != "") {
if (!tag.contains(modloader)) {
throw GradleException("Tags for the $modloader version should contain ${modloader}: $tag")
}
version = tag
}
dependencies {
minecraft("com.mojang:minecraft:${minecraftVersion}")
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchmentMinecraftVersion}:${parchmentVersion}@zip")
})
modImplementation("net.fabricmc:fabric-loader:${fabricLoaderVersion}")
modApi("net.fabricmc.fabric-api:fabric-api:${fabricApiVersion}")
modCompileOnly("dev.emi:trinkets:${trinketsVersion}") { isTransitive = false }
//modRuntimeOnly("dev.emi:trinkets:${trinketsVersion}")
modCompileOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${ccaVersion}")
modRuntimeOnly("me.shedaniel.cloth:cloth-config-${modloader}:${clothVersion}")
modCompileOnly("com.terraformersmc:modmenu:${modMenuVersion}")
modCompileOnly("dev.architectury:architectury-${modloader}:${architecturyVersion}")
modImplementation("appeng:appliedenergistics2-${modloader}:${ae2Version}") {
exclude(group = "mezz.jei")
exclude(group = "me.shedaniel")
exclude(group = "net.fabricmc.fabric-api")
}
modCompileOnly("me.shedaniel:RoughlyEnoughItems-${modloader}:${reiVersion}") {
exclude(group = "net.fabricmc.fabric-api")
}
modCompileOnly("mezz.jei:jei-${jeiMinecraftVersion}-${modloader}:${jeiVersion}") {
exclude(group = "mezz.jei")
}
when (runtimeItemlistMod) {
"rei" -> modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-${modloader}:${reiVersion}") {
exclude(group = "net.fabricmc.fabric-api")
}
"jei" -> modRuntimeOnly("mezz.jei:jei-${jeiMinecraftVersion}-${modloader}:${jeiVersion}") {
exclude(group = "mezz.jei")
}
"emi" -> {
modRuntimeOnly("dev.emi:emi-${modloader}:${emiVersion}+${minecraftVersion}")
modRuntimeOnly("mezz.jei:jei-${jeiMinecraftVersion}-${modloader}:${jeiVersion}") {
exclude(group = "mezz.jei")
}
}
}
implementation("com.google.code.findbugs:jsr305:3.0.2")
}
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://modmaven.dev/")
content {
includeGroup("net.fabricmc.fabric-api")
includeGroup("appeng")
includeGroup("mezz.jei")
}
}
maven {
url = uri("https://maven.bai.lol")
content {
includeGroup("mcp.mobius.waila")
includeGroup("lol.bai")
}
}
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("com.terraformersmc")
includeGroup("dev.emi")
}
}
maven {
url = uri("https://maven.ladysnake.org/releases")
content {
includeGroup("dev.onyxstudios.cardinal-components-api")
}
}
maven {
url = uri("https://maven.parchmentmc.net/")
content {
includeGroup("org.parchmentmc.data")
}
}
maven {
url = uri("https://maven.theillusivec4.top/")
content {
includeGroup("top.theillusivec4.curios")
}
}
maven {
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
}
java {
withSourcesJar()
}
tasks {
jar {
finalizedBy("remapJar")
}
processResources {
val resourceTargets = "fabric.mod.json"
val replaceProperties = mapOf(
"version" to version as String,
"ae2_version" to ae2Version
)
inputs.properties(replaceProperties)
filesMatching(resourceTargets) {
expand(replaceProperties)
}
}
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
}
}
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
java {
target("/src/*/java/**/*.java")
endWithNewline()
indentWithSpaces()
removeUnusedImports()
toggleOffOn()
eclipse().configFile("codeformat/codeformat.xml")
importOrderFile("codeformat/ae2wtlib.importorder")
}
}