From 50b12702987c7f6550d4272ce7c94262ec47b6c3 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Fri, 19 Aug 2022 08:12:01 -0700 Subject: [PATCH] Remove unused variable `NODE_MODULES_DIR` from `build.gradle` in app template (#34459) Summary: This PR removes unused variable `NODE_MODULES_DIR` passed from `build.gradle` to `CMakeLists.txt` which causes the following CMake warnings to appear in the logs: ``` > Task :app:configureCMakeDebug[arm64-v8a] C/C++: debug|arm64-v8a :CMake Warning: C/C++: debug|arm64-v8a : Manually-specified variables were not used by the project: C/C++: debug|arm64-v8a : NODE_MODULES_DIR ``` First I changed the value of `NODE_MODULES_DIR` to some non-existent path (i.e. `-DNODE_MODULES_DIR=/foo/bar`) to confirm that the variable is indeed unused. Then I completely removed it from `arguments` and the CMake warning disappeared. ## Changelog [Android] [Fixed] - Removed unused variable `NODE_MODULES_DIR` from `build.gradle` in app template Pull Request resolved: https://github.com/facebook/react-native/pull/34459 Test Plan: 1. Create a new RN 0.70.0-rc.3 app from template with `npx react-native@next init RN070RC3 --version 0.70.0-rc.3` 2. Set `newArchEnabled=true` in `settings.gradle` 3. Open `android` directory in Android Studio 4. Run Gradle Sync 5. Build the app 6. Search for `NODE_MODULES_DIR` in the logs 7. Notice the CMake warning 8. Remove the line from this PR 9. Build the app again 10. Search for `NODE_MODULES_DIR` in the logs 11. Confirm there are no occurrences Reviewed By: neildhar Differential Revision: D38864127 Pulled By: cortinico fbshipit-source-id: b41440edcdba63945e3b08cef897a250686c13ba --- template/android/app/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/template/android/app/build.gradle b/template/android/app/build.gradle index 92fd20361b617f..5364e587e47823 100644 --- a/template/android/app/build.gradle +++ b/template/android/app/build.gradle @@ -157,7 +157,6 @@ android { arguments "-DPROJECT_BUILD_DIR=$buildDir", "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", - "-DNODE_MODULES_DIR=$rootDir/../node_modules", "-DTARGET_NAME=$dynamicLibraryName", "-DANDROID_STL=c++_shared" }