-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
43 lines (33 loc) · 1.25 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
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
plugins {
java
id("com.github.johnrengelman.shadow") version "6.0.0"
}
// Project metadata
group = "com.example"
description = "A clear and concise description of a Spigot plugin."
version = "1.0"
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://oss.sonatype.org/content/repositories/central")
}
dependencies {
compileOnly("org.jetbrains", "annotations", "23.0.0")
compileOnly("org.spigotmc", "spigot-api", "1.18.1-R0.1-SNAPSHOT")
}
// ShadowJAR configuration and tasks
tasks.jar.get().enabled = false // do not create regular jar
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
configurations = mutableListOf(project.configurations.shadow.get())
archiveClassifier.set(null as String?)
}
tasks.register<com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation>("autoRelocateDependencies") {
target = tasks.shadowJar.get()
prefix = "com.example.myawesomeplugin.dependency"
}
tasks.shadowJar.get().dependsOn(tasks["autoRelocateDependencies"])