mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-28 04:20:20 +02:00
fix(build): clean natives
This commit is contained in:
parent
f97dda6e4d
commit
43f1a305a2
@ -44,17 +44,9 @@ fun getNativeFiles() = File(projectDir, "build/rustJniLibs/android").listFiles()
|
||||
abiFolder.takeIf { it.isDirectory }?.listFiles()?.toList() ?: emptyList()
|
||||
}
|
||||
|
||||
tasks.register("cleanNatives") {
|
||||
doLast {
|
||||
println("Cleaning native files")
|
||||
getNativeFiles()?.forEach { file ->
|
||||
file.deleteRecursively()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("preBuild").configure {
|
||||
dependsOn("cleanNatives", "cargoBuild")
|
||||
val buildAndRename by tasks.registering {
|
||||
dependsOn("cargoBuild")
|
||||
doLast {
|
||||
getNativeFiles()?.forEach { file ->
|
||||
if (file.name.endsWith(".so")) {
|
||||
@ -64,3 +56,17 @@ tasks.named("preBuild").configure {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val cleanNatives by tasks.registering {
|
||||
finalizedBy(buildAndRename)
|
||||
doFirst {
|
||||
println("Cleaning native files")
|
||||
getNativeFiles()?.forEach { file ->
|
||||
file.deleteRecursively()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("preBuild").configure {
|
||||
dependsOn(cleanNatives)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user