mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 13:05:52 +08:00
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:
1 parent
a7537e9d98
commit
7c644e4d63
4 files changed
+37
-1
No files matched your search
Generated
+3
@@ -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>
|
||||
|
||||
@@ -16,4 +16,9 @@ dependencies {
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.named('shadowJar') {
|
||||
destinationDirectory = rootProject.layout.projectDirectory.dir('out/tmp')
|
||||
archiveFileName = "${project.name}.jar"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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')
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user