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

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[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
This commit is contained in:
Tomek Zawadzki 2022-08-19 08:12:01 -07:00 коммит произвёл Facebook GitHub Bot
Родитель e142de0928
Коммит 50b1270298
1 изменённых файлов: 0 добавлений и 1 удалений

Просмотреть файл

@ -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"
}