From c5babd993a2bed2994ecc4710fa9e424b3e6cfc2 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 7 Apr 2022 10:55:32 -0700 Subject: [PATCH] Improve support for Android users on M1 machine Summary: This is a follow up to my previous diff. It applies the same customization for M1 users to the :ReactAndroid:hermes-engine build. The two diffs are split so the first one can be cherry-picked into 0.68.1 if needed. Changelog: [Android] [Fixed] - Improve support for Android users on M1 machine Reviewed By: mdvacca Differential Revision: D35468658 fbshipit-source-id: c07822f6708f872456971378f44257f6c1e967ee --- ReactAndroid/hermes-engine/build.gradle | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 61780e38b97a2a..6cbadca13fa9ff 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -101,10 +101,13 @@ android { compileSdkVersion 31 buildToolsVersion = "31.0.0" - // Used to override the NDK path & version on internal CI - if (System.getenv("ANDROID_NDK") != null && System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) { - ndkPath System.getenv("ANDROID_NDK") - ndkVersion System.getenv("LOCAL_ANDROID_NDK_VERSION") + // Used to override the NDK path/version on internal CI or by allowing + // users to customize the NDK path/version from their root project (e.g. for M1 support) + if (rootProject.hasProperty("ndkPath")) { + ndkPath rootProject.ext.ndkPath + } + if (rootProject.hasProperty("ndkVersion")) { + ndkVersion rootProject.ext.ndkVersion } defaultConfig {