-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
71 lines (62 loc) · 2.23 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
import io.papermc.hangarpublishplugin.model.Platforms
plugins {
id("java")
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
}
group = "cn.lunadeer"
version = "3.1-rc.2"
repositories {
mavenCentral()
maven ("https://repo.papermc.io/repository/maven-public/")
maven ("https://oss.sonatype.org/content/groups/public/")
maven("https://jitpack.io") // for VaultAPI
maven("https://repo.codemc.org/repository/maven-public") // for VaultUnlockedAPI
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("com.github.MilkBowl:VaultAPI:1.7")
compileOnly("net.milkbowl.vault:VaultUnlockedAPI:2.7")
implementation("net.kyori:adventure-platform-bukkit:4.3.3")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks.processResources {
outputs.upToDateWhen { false }
// copy languages folder from PROJECT_DIR/languages to core/src/main/resources
from(file("${rootProject.projectDir}/languages")) {
into("languages")
}
// replace @version@ in plugin.yml with project version
filesMatching("**/plugin.yml") {
filter {
it.replace("@version@", rootProject.version.toString())
}
}
}
tasks.shadowJar {
archiveClassifier.set("")
archiveVersion.set(project.version.toString())
dependsOn(tasks.withType<ProcessResources>())
}
hangarPublish {
publications.register("plugin") {
version.set(project.version as String) // use project version as publication version
id.set("ReColorfulMap")
channel.set("Release")
changelog.set("See https://github.com/ColdeZhang/ReColorfulMap/releases/tag/v${project.version}")
apiKey.set(System.getenv("HANGAR_TOKEN"))
// register platforms
platforms {
register(Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
kotlin.io.println("ShadowJar: ${tasks.shadowJar.flatMap { it.archiveFile }}")
platformVersions.set(kotlin.collections.listOf("1.20.1-1.20.6", "1.21.x"))
}
}
}
}
tasks.named("publishPluginPublicationToHangar") {
dependsOn(tasks.named("jar"))
}