-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
104 lines (88 loc) · 2.26 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
plugins {
id("fabric-loom") version "1.8-SNAPSHOT"
id("maven-publish")
}
val artifactName = properties["artifact_name"] as String
val minecraftVersion = properties["minecraft_version"] as String
base {
archivesName = "${artifactName}-fabric-${minecraftVersion}"
}
repositories {
maven {
name = "Terraformers"
url = uri("https://maven.terraformersmc.com/")
}
}
dependencies {
minecraft("com.mojang:minecraft:${minecraftVersion}")
mappings("net.fabricmc:yarn:${properties["mappings_version"].toString()}:v2")
modImplementation("net.fabricmc:fabric-loader:${properties["fabric_loader_version"].toString()}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${properties["fabric_api_version"].toString()}")
modImplementation("com.terraformersmc:modmenu:${properties["modmenu_version"].toString()}")
}
loom {
splitEnvironmentSourceSets()
runs {
named("client") {
runDir = "run/client"
}
named("server") {
runDir = "run/server"
}
}
mods {
create(properties["mod_id"].toString()) {
sourceSet("main")
}
}
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
}
tasks.withType(JavaCompile::class.java).configureEach {
options.encoding = "UTF-8"
options.release = 21
}
tasks.processResources {
filesMatching("fabric.mod.json") {
filter { line ->
Regex("%([a-z_]+)%").replace(line) { match ->
properties[match.groupValues[1]]?.toString() ?: match.value
}
}
}
}
tasks.named<Jar>("jar") {
from("LICENSE") {
rename {
"LICENSE-${artifactName}"
}
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = project.group.toString()
artifactId = project.base.archivesName.get()
version = project.version.toString()
from(components["java"])
}
}
repositories {
maven {
name = "Mods"
url = uri("file://${projectDir}/repository")
}
maven {
name = "GithubPackages"
url = uri(properties["github_packages_url"].toString())
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}