Skip to content

Commit 7230eda

Browse files
m-bertj-piasecki
authored andcommitted
[Android] build.gradle cleanup (#3741)
> [!NOTE] > Supersede #3335 This PR contains cherry picked commits from #3335 as merging changes after migrating into monorepo became quite painful 😞 1. `appProject` seems to be left unused after #3091 2. adding `configureEach` allows for [lazy task initialization](https://docs.gradle.org/current/userguide/task_configuration_avoidance.html#sec:old_vs_new_configuration_api_overview) This PR optimises pre-build time of Gesture Handler android, taking it down from ~7s to ~0.6s, a 11x improvement. - baseline: - time 6.776s ([link](https://gradle.com/s/h5iselfgzhafi)) - time 7.391s ([link](https://scans.gradle.com/s/6sz4ssuepvema)) - optimised: - time 0.687s ([link](https://gradle.com/s/zwiujfjblp64s)) - time 0.560s ([link](https://gradle.com/s/i5xqega7pazja)) - time 0.596s ([link](https://gradle.com/s/ohcnspquhmau4)) fixes: #2865 Optimisation of the `example` app pre-build time will be done in a separate PR, so far i took it down from 13s to 0.1s (caching & on-demand building). - Run `./gradlew help --scan` to see pre-build performance - Build app to see everything still works
1 parent cda8f22 commit 7230eda

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native-gesture-handler/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ android {
198198
}
199199

200200
if (isGHExampleApp()) {
201-
tasks.withType(ExternalNativeBuildJsonTask) {
201+
tasks.withType(ExternalNativeBuildJsonTask).configureEach {
202202
compileTask ->
203203
compileTask.doLast {
204204
def rootDir = new File("${project.projectDir}/..")

0 commit comments

Comments
 (0)