-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
98 lines (83 loc) · 3.31 KB
/
build.gradle.kts
File metadata and controls
98 lines (83 loc) · 3.31 KB
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
plugins {
id("java")
`maven-publish`
id("net.fabricmc.fabric-loom")
id("me.modmuss50.mod-publish-plugin") version "2.0.0-beta.1"
}
version = "${property("mod.version")}+${stonecutter.current.version}"
base.archivesName = property("mod.id") as String
repositories {
fun strictMaven(url: String, alias: String, vararg groups: String) = exclusiveContent {
forRepository { maven(url) { name = alias } }
filter { groups.forEach(::includeGroup) }
}
strictMaven("https://maven.isxander.dev/releases", "Xander Maven", "dev.isxander")
strictMaven("https://maven.terraformersmc.com/", "Terraformers", "com.terraformersmc")
strictMaven("https://maven.quiltmc.org/repository/release", "Quilt", "org.quiltmc.parsers")
strictMaven("https://api.modrinth.com/maven", "Modrinth", "maven.modrinth")
strictMaven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1", "DevAuth", "me.djtheredstoner")
}
dependencies {
minecraft("com.mojang:minecraft:${stonecutter.current.version}")
implementation("net.fabricmc:fabric-loader:${property("deps.fabric_loader")}")
implementation("net.fabricmc.fabric-api:fabric-api:${property("deps.fabric_api")}")
implementation("maven.modrinth:yacl:${property("yacl_version")}") {
exclude(group = "net.fabricmc.fabric-api")
}
implementation("com.terraformersmc:modmenu:${property("modmenu_version")}")
runtimeOnly("me.djtheredstoner:DevAuth-fabric:${property("devauth_version")}")
testImplementation("net.fabricmc:fabric-loader-junit:${property("deps.fabric_loader")}")
}
loom {
decompilerOptions.named("vineflower") {
options.put("mark-corresponding-synthetics", "1")
}
runConfigs.named("client") {
ideConfigGenerated(true)
runDir = "../../run"
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
tasks {
processResources {
val props = mapOf(
"id" to project.property("mod.id"),
"name" to project.property("mod.name"),
"version" to project.property("mod.version"),
"description" to project.property("mod.description"),
"minecraft" to project.property("mod.mc_dep"),
"yacl" to project.property("deps.yacl")
)
inputs.properties(props)
filesMatching("fabric.mod.json") { expand(props) }
}
register<Copy>("buildAndCollect") {
group = "build"
from(jar.map { it.archiveFile }, named<Jar>("sourcesJar").map { it.archiveFile })
into(rootProject.layout.buildDirectory.file("libs/${project.property("mod.version")}"))
dependsOn("build")
}
test {
useJUnitPlatform()
}
}
publishMods {
displayName = "${property("mod.name")} ${project.version}"
version = property("mod.version") as String
changelog = providers.environmentVariable("CHANGELOG")
type = STABLE
modLoaders.add("fabric")
file.set(tasks.named<Jar>("jar").flatMap { it.archiveFile })
modrinth {
accessToken.set(providers.environmentVariable("MODRINTH_TOKEN"))
projectId.set(property("modrinth.id") as String)
minecraftVersions.add(stonecutter.current.version)
requires("fabric-api")
requires("yacl")
optional("modmenu")
}
}