This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
generated from katorlys-samples/Kotlin-Spigot-Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
63 lines (55 loc) · 1.76 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.8.0"
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Documentation: https://github.com/Minecrell/plugin-yml
id("com.github.johnrengelman.shadow") version "8.1.1" // Documentation: https://github.com/johnrengelman/shadow
}
val spigotVersion: String by project
val pluginGroup: String by project
val pluginVersion: String by project
group = project.property("pluginGroup") as String
version = project.property("pluginVersion") as String
repositories {
maven("https://maven.aliyun.com/repository/public/") // Mirror: Comment this if you are not in China
maven("https://repo.huaweicloud.com/repository/maven/") // Mirror: Comment this if you are not in China
mavenLocal()
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
dependencies {
implementation(kotlin("stdlib"))
compileOnly("org.spigotmc:spigot-api:$spigotVersion")
}
val pluginApi: String by project
val pluginMain: String by project
val pluginName: String by project
val pluginAuthor: String by project
val pluginDescription: String by project
bukkit {
name = pluginName
version = pluginVersion
apiVersion = pluginApi
main = pluginMain
author = pluginAuthor
description = pluginDescription
commands {
register("hide")
}
permissions {
register("obfusplayer.hide")
}
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
withType<ShadowJar> {
archiveBaseName.set(pluginName)
archiveClassifier.set("shadow")
}
}