Skip to content

Commit 5faff44

Browse files
Get rid of gradle clean conan_toolchain.cmake workaround. Just remove .cxx in clean's doFirst stage
1 parent 6317814 commit 5faff44

1 file changed

Lines changed: 2 additions & 24 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -172,29 +172,7 @@ dependencies {
172172
}
173173

174174
tasks.named("clean") {
175-
doLast {
176-
delete(new File(projectDir, ".cxx"))
177-
}
178-
}
179-
180-
// This is needed because task "clean" depends on these tasks:
181-
//:app:externalNativeBuildCleanLiteDebug
182-
//:app:externalNativeBuildCleanLiteRelease
183-
//:app:externalNativeBuildCleanProDebug
184-
//:app:externalNativeBuildCleanProRelease
185-
// And these tasks expect to find build/conan/[ABI]/conan_toolchain.cmake files
186-
//
187-
// If build folder is malformed, we can't run `gradle clean` without this workaround.
188-
// This is because we supply our (conan's) CMAKE_TOOLCHAIN_FILE.
189-
// This workaround removes these "clean" task dependencies if conan_toolchain.cmake is not found (malformed build dir)
190-
project.afterEvaluate {
191-
["armv7", "armv8", "x86", "x86_64"].each { String arch ->
192-
if (!new File(projectDir, 'build/conan/' + arch + 'conan_toolchain.cmake').exists()) {
193-
def cleanTask = tasks.named("clean").get()
194-
cleanTask.dependsOn -= tasks.named('externalNativeBuildCleanLiteDebug')
195-
cleanTask.dependsOn -= tasks.named('externalNativeBuildCleanLiteRelease')
196-
cleanTask.dependsOn -= tasks.named('externalNativeBuildCleanProDebug')
197-
cleanTask.dependsOn -= tasks.named('externalNativeBuildCleanProRelease')
198-
}
175+
doFirst {
176+
delete getLayout().getProjectDirectory().dir(".cxx")
199177
}
200178
}

0 commit comments

Comments
 (0)