-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
61 lines (53 loc) · 1.8 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
61 lines (53 loc) · 1.8 KB
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
plugins {
java
id("com.gradleup.shadow") version "8.3.7"
}
group = "fr.fastedit"
version = "1.3.0"
description = "FastEdit — async WorldEdit plugin for PowerNukkitX (Bedrock)"
java {
toolchain { languageVersion.set(JavaLanguageVersion.of(21)) }
}
repositories {
mavenCentral()
maven("https://repo.opencollab.dev/maven-releases/")
maven("https://repo.opencollab.dev/maven-snapshots/")
maven("https://repo.powernukkitx.cn/releases")
maven("https://repo.powernukkitx.cn/snapshots")
maven("https://jitpack.io")
}
dependencies {
// PNX 3 is not published to any reachable Maven repo, so the compile
// classpath comes from a local build: FASTEDIT_PNX_JAR, else the sibling
// PowerNukkitX checkout's build/libs (plain jar + its dependency jars).
val localPnx = System.getenv("FASTEDIT_PNX_JAR")
?: System.getenv("LINESIA_PNX_JAR")
?: rootProject.file("../PowerNukkitX/build/libs")
.takeIf { it.isDirectory }?.absolutePath
if (localPnx != null && file(localPnx).exists()) {
val f = file(localPnx)
if (f.isDirectory) {
compileOnly(fileTree(f) { include("*.jar") })
} else {
compileOnly(files(localPnx))
val siblingLibs = f.parentFile
if (siblingLibs != null && siblingLibs.isDirectory) {
compileOnly(fileTree(siblingLibs) { include("*.jar"); exclude(f.name) })
}
}
} else {
compileOnly("org.powernukkitx:powernukkitx:3.0.1")
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(21)
}
tasks.processResources {
filesMatching("plugin.yml") { expand("version" to project.version) }
}
tasks.shadowJar {
archiveClassifier.set("")
mergeServiceFiles()
}
tasks.build { dependsOn(tasks.shadowJar) }