mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 13:05:52 +08:00
- Add Injector module, built to out/injector.jar - Add packageAll chain producing out/injection.zip from out/tmp - Copy resources and natives into out/tmp with a flat layout
58 lines
1.5 KiB
Groovy
58 lines
1.5 KiB
Groovy
plugins {
|
|
id 'base'
|
|
}
|
|
|
|
def outputDir = layout.projectDirectory.dir('out/tmp')
|
|
def distDir = layout.projectDirectory.dir('out')
|
|
def resourcesDir = layout.projectDirectory.dir('resources')
|
|
def nativesDir = layout.projectDirectory.dir('natives')
|
|
|
|
tasks.register('cleanOut') {
|
|
group = 'build'
|
|
description = 'Deletes the shaded jar output directory (out/tmp)'
|
|
doLast {
|
|
delete outputDir
|
|
}
|
|
}
|
|
|
|
tasks.register('prepareInjection') {
|
|
group = 'build'
|
|
description = 'Copies resources and natives into out/tmp (both flattened)'
|
|
dependsOn cleanOut
|
|
dependsOn ':Loader:shadowJar', ':OrangeX:shadowJar'
|
|
doLast {
|
|
copy {
|
|
from resourcesDir
|
|
into outputDir
|
|
exclude '**/.gitkeep'
|
|
}
|
|
copy {
|
|
from nativesDir
|
|
into outputDir
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register('injectionZip', Zip) {
|
|
group = 'build'
|
|
description = 'Zips out/tmp into out/injection.zip'
|
|
dependsOn prepareInjection
|
|
destinationDirectory = distDir
|
|
archiveFileName = 'injection.zip'
|
|
from outputDir
|
|
}
|
|
|
|
tasks.register('packageAll') {
|
|
group = 'build'
|
|
description = 'Builds Loader, OrangeX and Injector, then zips out/tmp into out/injection.zip'
|
|
dependsOn cleanOut
|
|
dependsOn ':Loader:shadowJar', ':OrangeX:shadowJar', ':Injector:jar'
|
|
dependsOn injectionZip
|
|
}
|
|
|
|
subprojects {
|
|
tasks.matching { it.name == 'shadowJar' }.configureEach {
|
|
mustRunAfter rootProject.tasks.named('cleanOut')
|
|
}
|
|
}
|