From 40c687c132ffc75f9db7dd4c42378ba676da2ea1 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 16 Feb 2023 04:38:36 -0800 Subject: [PATCH] Allow for Android offline mirrors to be executed on developer's laptops Summary: Before this change, the only way to update the offline mirror was to run it on a devmachine (OD won't work either due to network restriction). Developer's laptop also won't work as they would download AAPT2 for MacOS. In the offline mirror instead we need AAPT2 for Linux as that's Sandcastle runner type. This relaxes this requirement so the next time a developer has to update the offline mirror they will see the message on the diff with the command to execute, and they should be able to run the command locally (or on their devbox). Changelog: [Internal] [Changed] - Allow for Android offline mirrors to be executed on developer's laptops allow-large-files Reviewed By: cipolleschi Differential Revision: D43344651 fbshipit-source-id: 3e91adb2db45cf94d3f947aaab501d98580dc43d --- ReactAndroid/build.gradle | 6 ++++++ build.gradle.kts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 56bacf0b9b7..bcc8cda5aff 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -670,6 +670,12 @@ dependencies { androidTestImplementation("androidx.test:runner:${ANDROIDX_TEST_VERSION}") androidTestImplementation("androidx.test:rules:${ANDROIDX_TEST_VERSION}") androidTestImplementation("org.mockito:mockito-core:${MOCKITO_CORE_VERSION}") + + // This compileOnly dependency is needed to be able to update the offline + // mirror from a non-linux machine, while still executing inside a Linux CI + // as we declare a dependency on aap2 @linux so we're sure the linux artifact + // gets downloaded at some point. + compileOnly("com.android.tools.build:aapt2:7.4.1-8841542:linux") } react { diff --git a/build.gradle.kts b/build.gradle.kts index 9c6fad7ae4f..e9b1924d538 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -91,6 +91,8 @@ tasks.register("downloadAll") { dependsOn(":ReactAndroid:androidDependencies") dependsOn(":ReactAndroid:hermes-engine:dependencies") dependsOn(":ReactAndroid:hermes-engine:androidDependencies") + dependsOn(":packages:rn-tester:android:app:dependencies") + dependsOn(":packages:rn-tester:android:app:androidDependencies") } tasks.register("publishAllInsideNpmPackage") {