-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
131 lines (108 loc) · 4.17 KB
/
build.gradle.kts
File metadata and controls
131 lines (108 loc) · 4.17 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
plugins {
`java-library`
id("com.gradleup.shadow") version "9.0.0-beta11"
id("io.papermc.paperweight.userdev") version "2.0.0-beta.19" apply false
id("re.alwyn974.groupez.repository") version "1.0.0"
}
group = "fr.maxlego08.essentials"
version = "1.0.3.5"
extra.set("targetFolder", file("target/"))
extra.set("targetFolderDiscord", file("target-discord/"))
extra.set("apiFolder", file("target-api/"))
extra.set("classifier", System.getProperty("archive.classifier"))
extra.set("sha", System.getProperty("github.sha"))
allprojects {
apply(plugin = "java-library")
apply(plugin = "com.gradleup.shadow")
apply(plugin = "re.alwyn974.groupez.repository")
group = "fr.maxlego08.essentials"
version = rootProject.version
repositories {
mavenLocal()
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://repo.papermc.io/repository/maven-public/")
maven(url = "https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven(url = "https://repo.tcoded.com/releases")
}
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "net.kyori" && requested.name == "adventure-text-serializer-ansi" && (requested.version.isNullOrBlank() || requested.version == ".")) {
useVersion("4.20.0")
}
}
}
java {
withSourcesJar()
if (!project.path.startsWith(":NMS:")) {
withJavadocJar()
}
}
tasks.shadowJar {
archiveBaseName.set(rootProject.name)
archiveAppendix.set(if (project.path == ":") "" else project.name)
archiveClassifier.set("")
}
tasks.compileJava {
options.encoding = "UTF-8"
options.release = 21
}
tasks.javadoc {
options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible)
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
dependencies {
// compileOnly("fr.maxlego08.menu:zmenu-api:1.1.0.0")
compileOnly(files("libs/zMenu-1.1.1.0.jar"))
compileOnly("fr.maxlego08.sarah:sarah:1.20")
compileOnly("com.tcoded:FoliaLib:0.5.1")
compileOnly("fr.mrmicky:fastboard:2.1.5")
}
}
dependencies {
compileOnly("me.clip:placeholderapi:2.11.6")
compileOnly("io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT")
api(project(":API"))
api(project(":NMS:V1_20_4", configuration = "reobf"))
api(project(":NMS:V1_20_6", configuration = "reobf"))
api(project(":NMS:V1_21", configuration = "reobf"))
api(project(":NMS:V1_21_1", configuration = "reobf"))
api(project(":NMS:V1_21_3", configuration = "reobf"))
api(project(":NMS:V1_21_4", configuration = "reobf"))
api(project(":NMS:V1_21_5", configuration = "reobf"))
api(project(":NMS:V1_21_6", configuration = "reobf"))
api(project(":NMS:V1_21_7", configuration = "reobf"))
api(project(":NMS:V1_21_8", configuration = "reobf"))
api(project(":NMS:V1_21_9", configuration = "reobf"))
api(project(":NMS:V1_21_10", configuration = "reobf"))
api(project(":NMS:V1_21_11", configuration = "reobf"))
rootProject.subprojects.filter { it.path.startsWith(":Hooks:") }.forEach { subproject ->
api(project(subproject.path))
}
}
tasks {
shadowJar {
relocate("com.tcoded.folialib", "fr.maxlego08.essentials.libs.folialib")
relocate("fr.maxlego08.sarah", "fr.maxlego08.essentials.libs.sarah")
relocate("fr.mrmicky.fastboard", "fr.maxlego08.essentials.libs.fastboard")
manifest {
attributes["paperweight-mappings-namespace"] = "spigot"
}
rootProject.extra.properties["sha"]?.let { sha ->
archiveClassifier.set("${rootProject.extra.properties["classifier"]}-${sha}")
} ?: run {
archiveClassifier.set(rootProject.extra.properties["classifier"] as String?)
}
destinationDirectory.set(rootProject.extra["targetFolder"] as File)
}
build {
dependsOn(shadowJar)
}
processResources {
from("resources")
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}
}