Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,18 @@ fun buildHermesCCommandLineArgs() = listOf(
ndkBuildJobs,
)

// CMake caches contain absolute paths. Clear them only when Gradle runs configuration again.
fun CustomExecTask.clearCMakeCacheBeforeConfigure(hermesBuildDir: File) {
doFirst {
File(hermesBuildDir, "CMakeCache.txt").delete()
File(hermesBuildDir, "CMakeFiles").deleteRecursively()
}
}

val configureBuildForHermes by
tasks.registering(CustomExecTask::class) {
dependsOn(installCMake)
clearCMakeCacheBeforeConfigure(hermesBuildDir)
workingDir(hermesDir)
inputs.dir(hermesDir)
outputs.files(hermesBuildOutputFileTree)
Expand Down Expand Up @@ -240,6 +249,7 @@ val buildHermesLib by
val configureBuildForHermesWithDebugger by
tasks.registering(CustomExecTask::class) {
dependsOn(installCMake)
clearCMakeCacheBeforeConfigure(hermesBuildDir)
workingDir(hermesDir)
inputs.dir(hermesDir)
outputs.files(hermesBuildOutputFileTree)
Expand Down
Loading