-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
134 lines (116 loc) · 3.98 KB
/
build.gradle.kts
File metadata and controls
134 lines (116 loc) · 3.98 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
132
133
134
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
java
id("com.gradleup.shadow") version "8.3.0"
`maven-publish`
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
// Disable the default jar task for the root project to prevent conflict with shadowJar publishing
tasks.jar {
archiveClassifier.set("bare")
enabled = false
}
allprojects {
group = "com.github.mattbaconz"
version = "1.5.0"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://jitpack.io") // For VaultAPI
}
}
// Subprojects configuration
subprojects {
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
withJavadocJar()
withSourcesJar()
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(21)
}
tasks.withType<Javadoc> {
options.encoding = "UTF-8"
(options as StandardJavadocDocletOptions).apply {
addStringOption("Xdoclint:none", "-quiet")
links("https://docs.oracle.com/en/java/javase/21/docs/api/")
links("https://jd.papermc.io/paper/1.20/")
}
}
configure<PublishingExtension> {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
}
// Root project dependencies (all modules) for the "All-in-one" JAR
dependencies {
implementation(project(":ion-api"))
implementation(project(":ion-core"))
implementation(project(":ion-gui"))
implementation(project(":ion-item"))
implementation(project(":ion-ui"))
implementation(project(":ion-tasks"))
implementation(project(":ion-database"))
implementation(project(":ion-proxy"))
implementation(project(":ion-npc"))
implementation(project(":ion-placeholder"))
implementation(project(":ion-inject"))
implementation(project(":ion-compat"))
implementation(project(":ion-economy"))
implementation(project(":ion-redis"))
}
// Configure Shadow JAR for the root project to combine all modules
tasks.withType<ShadowJar> {
archiveClassifier.set("") // Produce IonAPI-1.2.0.jar
// Merge service files (like plugin.yml if multiple, though unlikely here)
mergeServiceFiles()
// Minimize to remove unused classes
// minimize() // Removed to prevent empty JAR when root project has no code
}
// Publish the root project's Shadow JAR
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = "IonAPI"
version = project.version.toString()
// Publish the shadow jar artifact
artifact(tasks["shadowJar"]) {
classifier = ""
}
}
}
}
// Generate aggregated Javadoc for all modules
tasks.register<Javadoc>("aggregateJavadoc") {
group = "documentation"
description = "Generates aggregated Javadoc for all modules"
setDestinationDir(file("$buildDir/docs/javadoc"))
subprojects.forEach { subproject ->
subproject.tasks.withType<Javadoc>().forEach { javadocTask ->
source += javadocTask.source
classpath += javadocTask.classpath
}
}
options.encoding = "UTF-8"
(options as StandardJavadocDocletOptions).apply {
addStringOption("Xdoclint:none", "-quiet")
links("https://docs.oracle.com/en/java/javase/21/docs/api/")
links("https://jd.papermc.io/paper/1.20/")
windowTitle = "IonAPI v${project.version} API Documentation"
docTitle = "IonAPI v${project.version}"
header = "<b>IonAPI v${project.version}</b>"
bottom = "Copyright © 2025 mattbaconz. All rights reserved."
}
}