-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
66 lines (54 loc) · 1.8 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
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default.OP
plugins {
id("java")
id("net.minecrell.plugin-yml.bukkit") version "0.3.0"
}
group = ofProp("package_group", "")
version = ofProp("plugin_version", "")
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
jcenter()
}
repositories {
mavenCentral()
// maven {
// // spigot
// setUrl("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
// }
// maven {
// // bungee
// setUrl("https://oss.sonatype.org/content/groups/public/")
// }
maven {
// paper
setUrl("https://papermc.io/repo/repository/maven-public/")
}
}
val spigotVersion = ofProp("spigot")
dependencies {
compileOnly(group = "com.destroystokyo.paper", name = "paper-api", version = spigotVersion)
testImplementation("junit", "junit", "4.12")
}
bukkit {
author = "WhiteCat"
description = ofProp("plugin_description", "")
main = ofProp("plugin_main_class", "")
.replace("\${group}", "$group", true)
.replace("\${name}", ofProp("plugin_name", ""), true)
apiVersion = "1.13"
permissions {
register("spectatormodetweaks.tpbypass") {
default = OP
}
}
}
infix fun <A> A.toProp(name: String) = this to extra[name]
fun String.suffixIfNot(suffix: String) = if (this.endsWith(suffix)) this else "$this$suffix"
fun ofProp(propName: String, suffix: String = "_version", default: String = ""): String =
extra[propName.suffixIfNot(suffix)] as? String ?: default
fun String.propVer(propName: String = split(":").last()) =
"$this:${ofProp(propName)}"
fun ExternalModuleDependency.propVersion(propName: String) = version { prefer(ofProp(propName)) }