Build: Package shaded jars into out/tmp

- Add root packageAll task aggregating Loader and OrangeX shadow jars
- Add cleanOut task so stale artifacts are removed before packaging
- Output fixed-name Loader.jar and OrangeX.jar into out/tmp
- Switch OrangeX Lombok to compileOnly so it is not shaded
This commit is contained in:
xiaozhou233 committed 2026-10-24 14:01:21 +08:00
1 parent a7537e9d98
commit 7c644e4d63
4 files changed
+37 -1

No files matched your search

+3
View File
@@ -9,6 +9,9 @@
<option name="description" value="" />
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
+5
View File
@@ -16,4 +16,9 @@ dependencies {
test {
useJUnitPlatform()
}
tasks.named('shadowJar') {
destinationDirectory = rootProject.layout.projectDirectory.dir('out/tmp')
archiveFileName = "${project.name}.jar"
}
+7 -1
View File
@@ -1,5 +1,6 @@
plugins {
id 'java'
id("com.gradleup.shadow") version "8.3.11"
}
group = 'cn.xiaozhou233.orangex'
@@ -11,10 +12,15 @@ repositories {
dependencies {
// Source: https://mvnrepository.com/artifact/org.projectlombok/lombok
implementation 'org.projectlombok:lombok:1.18.48'
compileOnly 'org.projectlombok:lombok:1.18.48'
annotationProcessor 'org.projectlombok:lombok:1.18.48'
}
test {
useJUnitPlatform()
}
tasks.named('shadowJar') {
destinationDirectory = rootProject.layout.projectDirectory.dir('out/tmp')
archiveFileName = "${project.name}.jar"
}
+22
View File
@@ -2,3 +2,25 @@ plugins {
id 'base'
}
def outputDir = layout.projectDirectory.dir('out/tmp')
tasks.register('cleanOut') {
group = 'build'
description = 'Deletes the shaded jar output directory (out/tmp)'
doLast {
delete outputDir
}
}
tasks.register('packageAll') {
group = 'build'
description = 'Builds the shaded Loader and OrangeX jars into out/tmp'
dependsOn cleanOut
dependsOn ':Loader:shadowJar', ':OrangeX:shadowJar'
}
subprojects {
tasks.matching { it.name == 'shadowJar' }.configureEach {
mustRunAfter rootProject.tasks.named('cleanOut')
}
}