-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
35 lines (32 loc) · 1.15 KB
/
build.gradle.kts
File metadata and controls
35 lines (32 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.ksp) apply false
}
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
fun cleanAfterRelease(task: Task) {
task.doLast {
println("🚀 Release concluído para: ${task.name}")
// Buscamos especificamente o subprojeto "app"
val appProject = childProjects["app"]
appProject?.let { proj ->
val buildDir = proj.layout.buildDirectory.asFile.get()
println("🧹 Limpando módulo :app em ${buildDir.path}")
buildDir.listFiles()?.forEach { file ->
if (file.name != "outputs") {
file.deleteRecursively()
}
}
}
println("✨ Limpeza do módulo :app concluída.")
}
}
tasks.matching {
it.name == ":app:assembleRelease" || it.name == ":app:bundleRelease"
}.configureEach {
cleanAfterRelease(this)
}