-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
44 lines (44 loc) · 1.52 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
val kotlinVersion: String by System.getProperties()
kotlin("jvm").version(kotlinVersion)
id("com.github.johnrengelman.shadow").version("6.1.0")
}
group = "nfsprodriver"
version = "1.5"
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 {
val kotlinVersion: String by System.getProperties()
implementation(kotlin("stdlib", kotlinVersion))
compileOnly("org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT")
}
val autoRelocate by tasks.register<ConfigureShadowRelocation>("configureShadowRelocation", ConfigureShadowRelocation::class) {
target = tasks.getByName("shadowJar") as ShadowJar?
val packageName = "${project.group}.${project.name.toLowerCase()}"
prefix = "$packageName.shaded"
}
tasks {
shadowJar {
archiveClassifier.set("")
project.configurations.implementation.get().isCanBeResolved = true
configurations = listOf(project.configurations.implementation.get())
dependsOn(autoRelocate)
minimize()
}
build {
dependsOn(shadowJar)
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "16"
}
}
}