mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 13:00:17 +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()
|
abiFolder.takeIf { it.isDirectory }?.listFiles()?.toList() ?: emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("cleanNatives") {
|
|
||||||
doLast {
|
|
||||||
println("Cleaning native files")
|
|
||||||
getNativeFiles()?.forEach { file ->
|
|
||||||
file.deleteRecursively()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named("preBuild").configure {
|
val buildAndRename by tasks.registering {
|
||||||
dependsOn("cleanNatives", "cargoBuild")
|
dependsOn("cargoBuild")
|
||||||
doLast {
|
doLast {
|
||||||
getNativeFiles()?.forEach { file ->
|
getNativeFiles()?.forEach { file ->
|
||||||
if (file.name.endsWith(".so")) {
|
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