Skip to content

Commit

Permalink
Gradle Configuration Cache - Round 1
Browse files Browse the repository at this point in the history
Summary:
This is a first part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).

Here I'm making all those tasks `prepare*` CC friendly.

Those tasks were not CC friendly as they were referencing an external variable inside their body.
We don't need to know the library version, we can just substring after the first folder
and the tasks will behave as before.

Changelog:
[Internal] [Changed] -

Differential Revision: D69655168
  • Loading branch information
cortinico authored and facebook-github-bot committed Feb 14, 2025
1 parent af76ad4 commit 28e2ea8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/react-native/ReactAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ val prepareDoubleConversion by
from(dependenciesPath ?: tarTree(downloadDoubleConversionDest))
from("src/main/jni/third-party/double-conversion/")
include("double-conversion-${DOUBLE_CONVERSION_VERSION}/src/**/*", "CMakeLists.txt")
filesMatching("*/src/**/*") { this.path = "double-conversion/${this.name}" }
filesMatching("*/src/**/*") { path = "double-conversion/${name}" }
includeEmptyDirs = false
into("$thirdPartyNdkDir/double-conversion")
}
Expand All @@ -315,7 +315,7 @@ val prepareFolly by
from(dependenciesPath ?: tarTree(downloadFollyDest))
from("src/main/jni/third-party/folly/")
include("folly-${FOLLY_VERSION}/folly/**/*", "CMakeLists.txt")
eachFile { this.path = this.path.removePrefix("folly-${FOLLY_VERSION}/") }
eachFile { path = path.substringAfter("/") }
includeEmptyDirs = false
into("$thirdPartyNdkDir/folly")
}
Expand All @@ -338,7 +338,7 @@ val prepareFastFloat by
from(dependenciesPath ?: tarTree(downloadFastFloatDest))
from("src/main/jni/third-party/fast_float/")
include("fast_float-${FAST_FLOAT_VERSION}/include/**/*", "CMakeLists.txt")
eachFile { this.path = this.path.removePrefix("fast_float-${FAST_FLOAT_VERSION}/") }
eachFile { path = path.substringAfter("/") }
includeEmptyDirs = false
into("$thirdPartyNdkDir/fast_float")
}
Expand All @@ -361,7 +361,7 @@ val prepareFmt by
from(dependenciesPath ?: tarTree(downloadFmtDest))
from("src/main/jni/third-party/fmt/")
include("fmt-${FMT_VERSION}/src/**/*", "fmt-${FMT_VERSION}/include/**/*", "CMakeLists.txt")
eachFile { this.path = this.path.removePrefix("fmt-${FMT_VERSION}/") }
eachFile { path = path.substringAfter("/") }
includeEmptyDirs = false
into("$thirdPartyNdkDir/fmt")
}
Expand Down Expand Up @@ -394,7 +394,7 @@ val prepareGtest by
tasks.registering(Copy::class) {
dependsOn(if (dependenciesPath != null) emptyList() else listOf(downloadGtest))
from(dependenciesPath ?: tarTree(downloadGtestDest))
eachFile { this.path = (this.path.removePrefix("googletest-release-${GTEST_VERSION}/")) }
eachFile { path = path.substringAfter("/") }
into(File(thirdPartyNdkDir, "googletest"))
}

Expand Down

0 comments on commit 28e2ea8

Please # to comment.