From 1e9d7b70fc5eec247653f83e506de193babc2eea Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Tue, 27 Oct 2020 10:04:45 -0700 Subject: [PATCH] More reliable way to get ReactAndroid build dir in Android-prebuilt.mk (#30222) Summary: Pass the ReactAndroid project build directory as a variable to the ndk build so it can be used instead of assuming that the build directory is under ReactAndroid/build. ## Changelog [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/30222 Test Plan: Tested in an app with a custom build directory Reviewed By: yungsters Differential Revision: D24560643 Pulled By: fkgozali fbshipit-source-id: cc65a70582f546ca2e2ca9fb6a2ff03ea70ca9d8 --- ReactAndroid/Android-prebuilt.mk | 4 ---- packages/rn-tester/android/app/build.gradle | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/Android-prebuilt.mk b/ReactAndroid/Android-prebuilt.mk index 3fd9edb4091..6a921100744 100644 --- a/ReactAndroid/Android-prebuilt.mk +++ b/ReactAndroid/Android-prebuilt.mk @@ -14,10 +14,6 @@ LOCAL_PATH := $(call my-dir) -REACT_ANDROID_DIR := $(LOCAL_PATH) -# TODO: Find a better way without pointing to ReactAndroid/build dir. -REACT_ANDROID_BUILD_DIR := $(REACT_ANDROID_DIR)/build - FIRST_PARTY_NDK_DIR := $(REACT_ANDROID_DIR)/src/main/jni/first-party THIRD_PARTY_NDK_DIR := $(REACT_ANDROID_BUILD_DIR)/third-party-ndk REACT_ANDROID_SRC_DIR := $(REACT_ANDROID_DIR)/src/main diff --git a/packages/rn-tester/android/app/build.gradle b/packages/rn-tester/android/app/build.gradle index 7b90fa60787..13c150cb30d 100644 --- a/packages/rn-tester/android/app/build.gradle +++ b/packages/rn-tester/android/app/build.gradle @@ -256,7 +256,8 @@ if (enableCodegen) { // The following paths assume building React Native from source. "GENERATED_SRC_DIR=$buildDir/generated/source", "PROJECT_BUILD_DIR=$buildDir", - "REACT_ANDROID_DIR=$reactAndroidProjectDir" + "REACT_ANDROID_DIR=$reactAndroidProjectDir", + "REACT_ANDROID_BUILD_DIR=$reactAndroidBuildDir" cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" cppFlags "-std=c++1y" targets "rntester_appmodules"