-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
228 lines (200 loc) · 7.98 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
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
import com.github.minecraftschurlimods.helperplugin.api
import com.github.minecraftschurlimods.helperplugin.localGradleProperty
import com.github.minecraftschurlimods.helperplugin.version
import com.github.minecraftschurlimods.helperplugin.moddependencies.ModDependency
import com.github.minecraftschurlimods.helperplugin.sourceSets
plugins {
idea
id("net.neoforged.gradle.userdev")
id ("com.github.minecraftschurlimods.helperplugin")
}
helper.license.url = helper.gitHub.url.zip(helper.license.file) { url, file -> "$url/blob/version/1.20.x/$file" }
helper.withApiSourceSet()
helper.withDataGenSourceSet()
helper.withTestSourceSet()
val include: Configuration by configurations.creating {
isTransitive = false
}
sourceSets.configureEach {
configurations.getByName(implementationConfigurationName).extendsFrom(include)
}
configurations.jarJar.get().extendsFrom(include)
repositories {
mavenLocal()
mavenCentral()
maven {
name = "Minecraftschurli Maven"
url = uri("https://minecraftschurli.ddns.net/repository/maven-public/")
content {
includeGroup("com.github.minecraftschurlimods")
}
}
maven {
name = "mcjty maven"
url = uri("https://maven.k-4u.nl")
content {
includeGroup("mcjty.theoneprobe")
}
}
maven {
name = "theillusivec4 Maven"
url = uri("https://maven.theillusivec4.top/")
content {
includeGroup("top.theillusivec4.curios")
}
}
maven {
name = "blamejared Maven"
url = uri("https://maven.blamejared.com")
content {
includeGroup("com.blamejared.controlling")
includeGroup("vazkii.patchouli")
includeGroup("mezz.jei")
}
}
maven {
name = "GeckoLib Maven"
url = uri("https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/")
content {
includeGroup("software.bernie.geckolib")
}
}
maven {
name = "ModMaven"
url = uri("https://modmaven.k-4u.nl")
}
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
}
val jei = helper.dependencies.jei()
val jade = helper.dependencies.jade()
val theoneprobe = helper.dependencies.theoneprobe()
val curios = helper.dependencies.curios()
val configured = helper.dependencies.configured()
val catalogue = helper.dependencies.catalogue()
val potionbundles = helper.dependencies.optional("potionbundles") {
curseforgeId = "potion-bundles"
modrinthId = "potion-bundles"
}
val geckolib = helper.dependencies.required("geckolib") {
ordering = ModDependency.Ordering.BEFORE
side = ModDependency.Side.BOTH
}
val patchouli = helper.dependencies.required("patchouli") {
ordering = ModDependency.Ordering.BEFORE
side = ModDependency.Side.BOTH
}
val embeddium = helper.dependencies.optional("embeddium")
dependencies {
implementation(helper.neoforge())
testImplementation(helper.testframework())
// jei for integration
val jeiApiDep = helper.minecraftVersion.zip(jei.version) { mc, version -> "mezz.jei:jei-${mc}-common-api:${version}" }
val jeiDep = helper.minecraftVersion.zip(jei.version) { mc, version -> "mezz.jei:jei-${mc}-neoforge:${version}" }
compileOnly(jeiApiDep)
// curios for additional inventory slots
val curiosApiDep = curios.version.map { "top.theillusivec4.curios:curios-neoforge:${it}:api" }
val curiosDep = curios.version.map { "top.theillusivec4.curios:curios-neoforge:${it}" }
compileOnly(curiosApiDep)
"dataCompileOnly"(curiosApiDep)
"dataRuntimeOnly"(curiosDep)
// patchouli for the guide book (arcane compendium)
val patchouliApiDep = patchouli.version.map { "vazkii.patchouli:Patchouli:${it}:api" }
val patchouliDep = patchouli.version.map { "vazkii.patchouli:Patchouli:${it}" }
compileOnly(patchouliApiDep)
runtimeOnly(patchouliDep)
testRuntimeOnly(patchouliDep)
"dataRuntimeOnly"(patchouliDep)
// geckolib for animations
val geckolibDep = helper.minecraftVersion.zip(geckolib.version) { mc, version -> "software.bernie.geckolib:geckolib-neoforge-${mc}:${version}" }
implementation(geckolibDep)
testRuntimeOnly(geckolibDep)
"dataRuntimeOnly"(geckolibDep)
// theoneprobe for integration
val theoneprobeApiDep = theoneprobe.version.map { "mcjty.theoneprobe:theoneprobe:${it}:api" }
val theoneprobeDep = theoneprobe.version.map { "mcjty.theoneprobe:theoneprobe:${it}" }
compileOnly(theoneprobeApiDep) { (this as ModuleDependency).isTransitive = false }
// jade for integration
val jadeDep = jade.version.map { "maven.modrinth:jade:${it}-neoforge" }
compileOnly(jadeDep)
if (!helper.runningInCI.getOrElse(false)) {
val potionbundlesDep = potionbundles.version.map { "com.github.minecraftschurlimods:potionbundles:${it}" }
runtimeOnly(potionbundlesDep)
runtimeOnly(theoneprobeDep) { (this as ModuleDependency).isTransitive = false }
runtimeOnly(jeiDep)
runtimeOnly(jadeDep)
runtimeOnly(curiosDep)
}
// add internal libraries
val codeclib = project.localGradleProperty("dependency.codeclib.version").map { "com.github.minecraftschurlimods:codeclib:$it" }
jarJar(codeclib)
"apiCompileOnly"(codeclib)
implementation(codeclib)
"dataImplementation"(codeclib)
testImplementation(codeclib)
val betterkeybindlib = project.localGradleProperty("dependency.betterkeybindlib.version").map { "com.github.minecraftschurlimods:betterkeybindlib:$it" }
jarJar(betterkeybindlib)
implementation(betterkeybindlib)
"dataImplementation"(betterkeybindlib)
testImplementation(betterkeybindlib)
val betterhudlib = project.localGradleProperty("dependency.betterhudlib.version").map { "com.github.minecraftschurlimods:betterhudlib:$it" }
jarJar(betterhudlib)
implementation(betterhudlib)
"dataImplementation"(betterhudlib)
testImplementation(betterhudlib)
val easyDatagenLibVersion = project.localGradleProperty("dependency.easydatagenlib.version")
val easyDatagenLibApiDep = easyDatagenLibVersion.map { "com.github.minecraftschurlimods:easydatagenlib:${it}:api" }
val easyDatagenLibDep = easyDatagenLibVersion.map { "com.github.minecraftschurlimods:easydatagenlib:${it}" }
"apiCompileOnly"(easyDatagenLibApiDep)
"dataImplementation"(easyDatagenLibDep)
sourceSets.forEach {
it.compileOnlyConfigurationName("org.jetbrains:annotations:23.0.0")
}
}
helper.withCommonRuns()
helper.withGameTestRuns()
helper.withDataGenRuns {
programArguments.add("--mixin.config")
programArguments.add(helper.projectId.map { "${it}_data.mixins.json" })
}
helper.modproperties.put("catalogueItemIcon", helper.projectId.map { "$it:occulus" })
helper.mixinConfigs.add(helper.projectId.map { "${it}.mixins.json" })
minecraft.accessTransformers.file("src/main/resources/META-INF/accesstransformer.cfg")
helper.withJarJar()
tasks.javadoc {
classpath = sourceSets.api.get().compileClasspath
source = sourceSets.api.get().allJava
}
tasks.jar {
exclude("com/github/minecraftschurlimods/arsmagicalegacy/api/data")
}
helper.publication.pom {
organization {
name = "Minecraftschurli Mods"
url = "https://github.com/MinecraftschurliMods"
}
developers {
developer {
id = "minecraftschurli"
name = "Minecraftschurli"
email = "minecraftschurli@gmail.com"
url = "https://github.com/Minecraftschurli"
organization = "Minecraftschurli Mods"
organizationUrl = "https://github.com/MinecraftschurliMods"
timezone = "Europe/Vienna"
}
developer {
id = "ichhabehunger54"
name = "IchHabeHunger54"
url = "https://github.com/IchHabeHunger54"
organization = "Minecraftschurli Mods"
organizationUrl = "https://github.com/MinecraftschurliMods"
timezone = "Europe/Vienna"
}
}
}