fix: eliminate build race between cleanTmp and shadowJar

shadowJar tasks now output to their default build/libs directories,
and buildInjection copies the jars into out/tmp. Previously cleanTmp
(Delete out/tmp) and shadowJar tasks (writing into out/tmp) had no
mutual ordering guarantee, which could delete freshly built jars.
This commit is contained in:
xiaozhou233 committed 2026-08-18 13:16:06 +08:00
1 parent 206187949b
commit 33232a106c
3 files changed
+2 -2

No files matched your search

-1
View File
@@ -16,5 +16,4 @@ dependencies {
shadowJar {
archiveFileName = 'Loader.jar'
destinationDirectory = rootProject.layout.projectDirectory.dir('out/tmp')
}
-1
View File
@@ -17,5 +17,4 @@ dependencies {
shadowJar {
archiveFileName = 'OrangeX.jar'
destinationDirectory = rootProject.layout.projectDirectory.dir('out/tmp')
}
+2
View File
@@ -22,6 +22,8 @@ tasks.register("buildInjection", Copy) {
project(':Loader').tasks.named('shadowJar')
)
from(project(':OrangeX').tasks.named('shadowJar').flatMap { it.archiveFile })
from(project(':Loader').tasks.named('shadowJar').flatMap { it.archiveFile })
from(rootProject.layout.projectDirectory.dir('natives'))
from(rootProject.layout.projectDirectory.dir('resources'))
into(tmpDir)