-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
149 lines (129 loc) · 3.36 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
149 lines (129 loc) · 3.36 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
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
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
plugins {
`maven-publish`
alias(libs.plugins.loom)
alias(libs.plugins.minotaur)
alias(libs.plugins.yumi.licenser)
}
val modVersion: String by project
val branchName: String by project
val slug: String by project
val modId: String by project
val modAuthors: String by project
val group: String by project
val user: String by project
val github_slug: String by project
val modDescription: String by project
val license: String by project
val compatibleVersions: String by project
val compatibleLoaders: String by project
val modName: String by project
val contributors: String by project
version = "$modVersion+$branchName"
base.archivesName = slug
repositories {
maven {
name = "ParchmentMC"
url = uri("https://maven.parchmentmc.org")
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth Maven"
url = uri("https://api.modrinth.com/maven")
}
}
filter {
includeGroup("maven.modrinth")
}
}
}
dependencies {
minecraft(libs.mc)
implementation(libs.fl)
implementation(libs.fapi)
implementation(libs.yumi.commons.core)
include(libs.yumi.commons.core)
// modRuntimeOnly(libs.sodium) // re-enable when 0.8.1 comes out lol
runtimeOnly(libs.modmenu)
}
loom {
splitEnvironmentSourceSets()
mods {
register(modId) {
sourceSet("main")
sourceSet("client")
}
}
runs {
getByName("client") {
client()
source(sourceSets["client"])
}
}
}
tasks.processResources {
val members = if (contributors.isNotEmpty()) {
". Contributions by ${contributors}."
} else {
""
};
val meta = mapOf(
"version" to version,
"modId" to modId,
"modName" to modName,
"modDescription" to modDescription,
"homepage" to "https://modrinth.com/mod/${slug}",
"issues" to "https://github.com/${user}/${github_slug}/issues",
"sources" to "https://github.com/${user}/${github_slug}",
"license" to license,
"authors" to modAuthors.split(", ").joinToString("\",\n \""),
"contributors" to contributors.split(", ").joinToString("\",\n \""),
"members" to "${modAuthors}${members}",
"mc" to compatibleVersions.split(", ")[0],
"fl" to libs.versions.fl.get(),
"fapi" to libs.versions.fapi.get(),
)
inputs.properties(meta)
filesMatching("*.mod.json") { expand(meta) }
filesMatching("META-INF/*mods.toml") { expand(meta) }
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release = 25
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
publishing {
repositories {
}
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}
modrinth {
token = "${System.getenv("MODRINTH_TOKEN")}"
projectId = slug
versionNumber.set(project.version as String?)
uploadFile.set(tasks.jar)
gameVersions = compatibleVersions.split(", ").toList()
loaders = compatibleLoaders.split(", ").toList()
changelog = "${System.getenv("CHANGELOG")}"
syncBodyFrom = "<!--DO NOT EDIT MANUALLY: synced from gh readme-->\n" + rootProject.file("README.md").readText()
dependencies {
required.version("fabric-api", libs.versions.fapi.get())
}
}
tasks.compileJava {
dependsOn(tasks.applyLicenses)
}
license {
rule(file("codeformat/HEADER"))
include("**/*.java")
}