-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
82 lines (67 loc) · 2.7 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
82
import java.time.Instant
plugins {
`java-library`
alias(libs.plugins.maven.deployer) apply false
eclipse
idea
}
subprojects {
apply(plugin = "java-library")
apply(plugin = rootProject.libs.plugins.maven.deployer.get().pluginId)
applyCustomVersion()
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/snapshots") // Required for Spigots Bungeecord dependency
maven("https://oss.sonatype.org/content/repositories/central") // Required for Spigots Bungeecord dependency
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") {
content { includeGroup("me.clip") }
}
}
dependencies {
compileOnly(rootProject.libs.annotations)
annotationProcessor(rootProject.libs.annotations)
api(rootProject.libs.bundles.adventure)
compileOnly(rootProject.libs.spigot.api)
compileOnly(rootProject.libs.placeholderapi)
testImplementation(rootProject.libs.annotations)
testImplementation(platform(rootProject.libs.junit.bom))
testImplementation(rootProject.libs.bundles.junit)
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
withJavadocJar()
withSourcesJar()
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.compilerArgs.addAll(arrayListOf("-Xlint:all", "-Xlint:-processing", "-Xdiags:verbose"))
options.release.set(8)
}
javadoc {
isFailOnError = false
val options = options as StandardJavadocDocletOptions
options.encoding = Charsets.UTF_8.name()
options.overview = "src/main/javadoc/overview.html"
options.windowTitle = "${rootProject.name} Javadoc"
options.tags("apiNote:a:API Note:", "implNote:a:Implementation Note:", "implSpec:a:Implementation Requirements:")
options.addStringOption("Xdoclint:none", "-quiet")
options.use()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
test {
useJUnitPlatform()
failFast = false
}
}
}
fun applyCustomVersion() {
// Apply custom version arg or append snapshot version
val ver = properties["altVer"]?.toString() ?: "${rootProject.version}-SNAPSHOT-${Instant.now().epochSecond}"
// Strip prefixed "v" from version tag
rootProject.version = (if (ver.first().equals('v', true)) ver.substring(1) else ver.uppercase()).uppercase()
}