diff --git a/.idea/misc.xml b/.idea/misc.xml
index f8404f1..a971e28 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -9,6 +9,9 @@
+
+
+
diff --git a/Loader/build.gradle b/Loader/build.gradle
index 8942dde..d0c7d0e 100644
--- a/Loader/build.gradle
+++ b/Loader/build.gradle
@@ -16,4 +16,9 @@ dependencies {
test {
useJUnitPlatform()
+}
+
+tasks.named('shadowJar') {
+ destinationDirectory = rootProject.layout.projectDirectory.dir('out/tmp')
+ archiveFileName = "${project.name}.jar"
}
\ No newline at end of file
diff --git a/OrangeX/build.gradle b/OrangeX/build.gradle
index 0f55759..69ab8a9 100644
--- a/OrangeX/build.gradle
+++ b/OrangeX/build.gradle
@@ -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"
}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 81410bf..5300420 100644
--- a/build.gradle
+++ b/build.gradle
@@ -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')
+ }
+}