From 4fc8cd2e01c0f952623e5903e818cc078a43b040 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Wed, 4 Oct 2023 11:06:39 +0200 Subject: [PATCH] fix: Clean C++ CMake cache (`.cxx/`) on clean --- package/android/build.gradle | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/package/android/build.gradle b/package/android/build.gradle index c883b95..feff007 100644 --- a/package/android/build.gradle +++ b/package/android/build.gradle @@ -151,17 +151,27 @@ dependencies { } } -// Resolves "LOCAL_SRC_FILES points to a missing file, Check that libfb.so exists or that its path is correct". +task cleanCmakeCache() { + tasks.getByName("clean").dependsOn(cleanCmakeCache) + doFirst { + delete "${projectDir}/.cxx" + } +} + tasks.configureEach { task -> + // C++ build if (task.name.contains("configureCMakeDebug")) { rootProject.getTasksByName("packageReactNdkDebugLibs", true).forEach { task.dependsOn(it) } } - // We want to add a dependency for both configureCMakeRelease and configureCMakeRelWithDebInfo if (task.name.contains("configureCMakeRel")) { rootProject.getTasksByName("packageReactNdkReleaseLibs", true).forEach { task.dependsOn(it) } } + // C++ clean + if (task.name.contains("clean")) { + task.dependsOn(cleanCmakeCache) + } }