Updated on 2026-08-14
This commit is contained in:
parent
f775011234
commit
3f4c8acf8e
1 changed files with 62 additions and 1 deletions
|
|
@ -10,6 +10,67 @@ plugins {
|
|||
alias(deps.plugins.firebase.crashlytics) apply false
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete::class) {
|
||||
val clean by tasks.registering {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
|
||||
interface Injected {
|
||||
@get:Inject
|
||||
val fs: FileSystemOperations
|
||||
}
|
||||
|
||||
val assembleInternalQA by tasks.registering {
|
||||
group = "build"
|
||||
description = "Builds internal APK to 'build/outputs' directory"
|
||||
|
||||
val appOutputApkDir = "$projectDir/app/build/outputs/apk/internal"
|
||||
val rootOutputApkDir = "$buildDir/outputs"
|
||||
val injected = objects.newInstance<Injected>()
|
||||
|
||||
dependsOn(":app:assembleInternal")
|
||||
|
||||
doFirst {
|
||||
injected.fs.delete {
|
||||
delete(appOutputApkDir)
|
||||
delete("$rootOutputApkDir/app-internal.apk")
|
||||
}
|
||||
}
|
||||
doLast {
|
||||
injected.fs.copy {
|
||||
from("$appOutputApkDir/app-internal.apk")
|
||||
into(rootOutputApkDir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val assembleExternalQA by tasks.registering {
|
||||
group = "build"
|
||||
description = "Builds external APK to 'build/outputs' directory"
|
||||
|
||||
val appOutputApkDir = "$projectDir/app/build/outputs/apk/external"
|
||||
val rootOutputApkDir = "$buildDir/outputs"
|
||||
val injected = objects.newInstance<Injected>()
|
||||
|
||||
dependsOn(":app:assembleExternal")
|
||||
|
||||
doFirst {
|
||||
injected.fs.delete {
|
||||
delete(appOutputApkDir)
|
||||
delete("$rootOutputApkDir/app-external.apk")
|
||||
}
|
||||
}
|
||||
doLast {
|
||||
injected.fs.copy {
|
||||
from("$appOutputApkDir/app-external.apk")
|
||||
into(rootOutputApkDir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val assembleQA by tasks.registering {
|
||||
group = "build"
|
||||
description = "Builds internal and external APKs to 'build/outputs' directory"
|
||||
|
||||
dependsOn(assembleInternalQA)
|
||||
dependsOn(assembleExternalQA)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue