-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
85 lines (75 loc) · 1.99 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
plugins {
java
alias(libs.plugins.loom)
alias(libs.plugins.minotaur)
id("gay.ampflower.BuildPlugin")
}
val github: String by project
val modrinthId: String by project
allprojects {
apply(plugin = "java")
apply(plugin = "gay.ampflower.BuildPlugin")
apply(plugin = rootProject.libs.plugins.minotaur.get().pluginId)
apply(plugin = rootProject.libs.plugins.loom.get().pluginId)
version = meta.globalVersion
base {
if (project != rootProject) {
archivesName.set(rootProject.name + '-' + project.name)
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
repositories {
mavenLocal()
mavenCentral()
maven("https://api.modrinth.com/maven") { name = "Modrinth" }
}
dependencies {
minecraft(rootProject.libs.minecraft)
mappings(variantOf(rootProject.libs.yarn) { classifier("v2") })
}
tasks {
withType<JavaCompile> {
options.release.set(17)
options.encoding = "UTF-8"
options.isDeprecation = true
options.isWarnings = true
}
withType<Jar> {
from("LICENSE*") {
rename { "${it}_${rootProject.name}" }
}
}
processResources {
val map =
mapOf(
"id" to project.name,
"java" to java.targetCompatibility.majorVersion,
"version" to project.version,
"sources" to github,
"issues" to "$github/issues",
"description" to project.description,
"projectVersion" to meta.projectVersion,
"modrinthId" to modrinthId,
"forgeRequired" to libs.versions.forge.loader.get().let {
val s = it.indexOf('-') + 1
it.substring(s, it.indexOf('.', s))
},
"minecraftVersion" to libs.versions.minecraft.version.get(),
"minecraftRequired" to libs.versions.minecraft.required.get()
)
inputs.properties(map)
filesMatching(listOf("fabric.mod.json", "quilt.mod.json", "META-INF/mods.toml")) {
expand(map)
}
}
javadoc {
(options as StandardJavadocDocletOptions).tags("reason:a:Reason")
}
create("publish")
}
}