generated from katorlys-samples/Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
66 lines (58 loc) · 1.87 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 com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "2.0.10"
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // https://github.com/Minecrell/plugin-yml
id("com.gradleup.shadow") version "8.3.0" // https://github.com/GradleUp/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("examplecommand")
}
permissions {
register("exampleproject.examplecommand")
}
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = "21"
targetCompatibility = "21"
}
withType<KotlinCompile> {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}
withType<ShadowJar> {
archiveBaseName.set(pluginName)
archiveClassifier.set("shadow")
}
}