-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
81 lines (60 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import org.apache.tools.ant.filters.ReplaceTokens
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.23"
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "ru.enwulf"
version = "1.0"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
implementation(kotlin("stdlib"))
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
processResources {
filteringCharset = "UTF-8"
filesMatching("**/plugin.yml") {
filter<ReplaceTokens>(
"tokens" to mapOf(
"name" to project.name,
"version" to project.version,
)
)
}
}
shadowJar {
archiveFileName.set("${project.name}-${project.version}.jar")
val libs = "libs"
relocate("org.jetbrains", "$libs.jetbrains")
relocate("kotlin", "$libs.kotlin")
dependencies {
exclude("META-INF/**")
}
minimize()
}
build {
dependsOn(shadowJar)
}
}
/*tasks.register<Copy>("moveToPluginsDir") {
from(tasks.shadowJar.get().archiveFile.get().asFile)
//from("C:/Users/raizz/Desktop/DamagerENW/build/libs/DamagerENW-1.0.jar")
val userName = System.getProperty("user.name")
val pluginsDir = file("C:/Users/$userName/Desktop/server1.20.4/plugins")
pluginsDir.mkdirs()
into(pluginsDir)
}
tasks.named("build") { finalizedBy("moveToPluginsDir") }
/*