generated from hirosukt/KotlinMinecraftPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
87 lines (74 loc) · 2.13 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
plugins {
kotlin("jvm") version "2.1.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
`maven-publish`
}
group = "love.chihuyu"
version = "0.0.3-SNAPSHOT"
val pluginVersion: String by project.ext
repositories {
mavenCentral()
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://repo.purpurmc.org/snapshots")
}
/*
1.7.10~1.8.8: "org.github.paperspigot:paperspigot-api:$pluginVersion-R0.1-SNAPSHOT"
1.9.4~1.16.5: "com.destroystokyo.paper:paper-api:$pluginVersion-R0.1-SNAPSHOT"
1.17~1.19.4: "io.papermc.paper:paper-api:$pluginVersion-R0.1-SNAPSHOT"
*/
dependencies {
compileOnly("com.destroystokyo.paper:paper-api:$pluginVersion-R0.1-SNAPSHOT")
implementation("dev.jorel:commandapi-bukkit-shade:9.5.3")
implementation(kotlin("stdlib"))
}
tasks {
test {
useJUnitPlatform()
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from(sourceSets.main.get().resources.srcDirs) {
filter(org.apache.tools.ant.filters.ReplaceTokens::class, mapOf("tokens" to mapOf(
"version" to project.version.toString(),
"name" to project.name,
"mainPackage" to "love.chihuyu.${project.name.lowercase()}.${project.name}Plugin"
)))
filteringCharset = "UTF-8"
}
}
shadowJar {
exclude("org/slf4j/**")
archiveClassifier = ""
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
name = "repo"
credentials(PasswordCredentials::class)
url = uri(
if (project.version.toString().endsWith("SNAPSHOT"))
"https://chihuyu.love/repo/snapshots"
else
"https://chihuyu.love/repo/releases"
)
}
}
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}
ktlint {
ignoreFailures.set(true)
disabledRules.add("no-wildcard-imports")
}
kotlin {
jvmToolchain(17)
}