-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathbuild.gradle.kts
98 lines (81 loc) · 2.77 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
plugins {
id("eclipse")
id("java")
id("maven-publish")
// alias(libs.plugins.aggregate.javadoc) // Stupid idiot dumb plugin checks if "java" plugin is used on root, but can't use compileOnly() or implementation() UNLESS the "java" plugin is applied. So I guess fuck me then
}
/* Meant for Aggregate Javadocs but lol the plugin is stupid
dependencies {
rootProject.subprojects.forEach { subproject ->
subproject.plugins.withId("java") {
javadoc(subproject)
}
}
}
*/
subprojects {
apply(plugin = "checkstyle")
apply(plugin = "java")
apply(plugin = "maven-publish")
group = "wtf.choco"
version = "2.2.6"
repositories {
mavenCentral()
maven { url = uri("http://repo.choco.wtf/releases"); isAllowInsecureProtocol = true }
maven { url = uri("http://repo.choco.wtf/snapshots"); isAllowInsecureProtocol = true } // Themis
}
dependencies {
compileOnly(rootProject.libs.jetbrains.annotations)
implementation(rootProject.libs.choco.networking.common)
}
java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks {
withType<JavaCompile> {
options.release = 17
options.encoding = Charsets.UTF_8.name()
}
withType<Javadoc> {
val options = (options as org.gradle.external.javadoc.StandardJavadocDocletOptions)
options.encoding = Charsets.UTF_8.name()
options.links(
"https://docs.oracle.com/en/java/javase/17/docs/api/",
"https://hub.spigotmc.org/javadocs/spigot"
)
options.tags(
"apiNote:a:API Note:",
"implSpec:a:Implementation Specification",
"implNote:a:Implementation Note"
)
}
withType<Checkstyle> {
configFile = file("${rootDir}/checkstyle.xml")
}
withType<Test> {
useJUnitPlatform()
}
}
publishing {
repositories {
maven {
isAllowInsecureProtocol = true // I'll fix this once I get an SSL cert for my repository :)
val repository = if (project.version.toString().endsWith("SNAPSHOT")) "snapshots" else "releases"
url = uri("http://repo.choco.wtf/$repository")
credentials {
username = project.properties["mavenUsername"].toString()
password = project.properties["mavenAccessToken"].toString()
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
}