-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
124 lines (106 loc) · 2.58 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
plugins {
alias(libs.plugins.mod.publish)
alias(libs.plugins.fabric.loom)
`maven-publish`
java
}
val modVersion = "2.1.2"
val releaseVersion = "${modVersion}+${libs.versions.minecraft.get()}"
version = releaseVersion
group = "me.senseiwells"
repositories {
mavenCentral()
maven("https://maven.parchmentmc.org/")
maven("https://api.modrinth.com/maven")
}
dependencies {
minecraft(libs.minecraft)
@Suppress("UnstableApiUsage")
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${libs.versions.parchment.get()}@zip")
})
modImplementation(libs.fabric.loader)
modImplementation(libs.fabric.api)
includeModImplementation(libs.permissions) {
exclude(libs.fabric.api.get().group)
}
}
loom {
accessWidenerPath.set(file("src/main/resources/chunk-debug.accesswidener"))
runs {
getByName("server") {
runDir = "run/server"
}
getByName("client") {
runDir = "run/client"
}
}
}
java {
withSourcesJar()
}
tasks {
processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand(mutableMapOf(
"version" to project.version,
"minecraft_dependency" to libs.versions.minecraft.get().replaceAfterLast('.', "x"),
"fabric_loader_dependency" to libs.versions.fabric.loader.get(),
))
}
}
jar {
from("LICENSE")
}
publishMods {
file = remapJar.get().archiveFile
changelog.set(
"""
## ChunkDebug $modVersion
Updated to 1.21.3
""".trimIndent()
)
type = STABLE
modLoaders.add("fabric")
displayName = "ChunkDebug $modVersion for ${libs.versions.minecraft.get()}"
version = releaseVersion
modrinth {
accessToken = providers.environmentVariable("MODRINTH_API_KEY")
projectId = "zQxjhDPq"
minecraftVersions.add(libs.versions.minecraft)
requires {
id = "P7dR8mSH"
}
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(project.components.getByName("java"))
artifactId = "chunk-debug"
}
}
repositories {
val mavenUrl = System.getenv("MAVEN_URL")
if (mavenUrl != null) {
maven {
url = uri(mavenUrl)
val mavenUsername = System.getenv("MAVEN_USERNAME")
val mavenPassword = System.getenv("MAVEN_PASSWORD")
if (mavenUsername != null && mavenPassword != null) {
credentials {
username = mavenUsername
password = mavenPassword
}
}
}
}
}
}
}
private fun DependencyHandler.includeModImplementation(provider: Provider<*>, action: Action<ExternalModuleDependency>) {
this.include(provider, action)
this.modImplementation(provider, action)
}