Do not store .cpp/.h files inside src/main/java - reactperflogger (#34386)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34386

Current we expose native code (.h, .cpp) inside the src/main/java folder.
This is making impossible for users on New Architecture to open the project
inside Android Studio.

The problem is that the src/main/java is reserved to Java/Kotlin sources only.
AGP 7.2 also removed support for mixed source roots:
https://developer.android.com/studio/releases/gradle-plugin#duplicate-content-roots

This is essentially forcing users to write Java code without any autocompletion
as all the React Native Java classes are considered C++ files.

I'm addressing this issue folder by folder by moving them
from `ReactAndroid/src/main/java/com/facebook/...` to `ReactAndroid/src/main/jni/react/...`

This is the diff for reactperflogger

Changelog:
[Internal] [Changed] - Do not store .cpp/.h files inside src/main/java - reactperflogger

Reviewed By: cipolleschi

Differential Revision: D38584681

fbshipit-source-id: 8b65b3fa47a7f106c7fea79fd739f0e4e37efa2a
This commit is contained in:
Nicola Corti 2022-08-12 05:05:39 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 7783f88d71
Коммит 296d7db7a2
8 изменённых файлов: 4 добавлений и 3 удалений

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

@ -20,6 +20,6 @@ rn_android_library(
deps = [
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
react_native_dep("libraries/fbjni:java"),
react_native_target("java/com/facebook/react/reactperflogger/jni:jni"),
react_native_target("jni/react/reactperflogger:jni"),
],
)

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

@ -36,7 +36,7 @@ rn_xplat_cxx_library(
react_native_xplat_shared_library_target("jsi:jsi"),
react_native_xplat_target("react/nativemodule/core:core"),
react_native_xplat_target("runtimeexecutor:runtimeexecutor"),
react_native_target("java/com/facebook/react/reactperflogger/jni:jni"),
react_native_target("jni/react/reactperflogger:jni"),
],
)

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

@ -95,7 +95,7 @@ add_react_android_subdir(src/main/jni/first-party/fb)
add_react_android_subdir(src/main/jni/first-party/fbgloginit)
add_react_android_subdir(src/main/jni/first-party/yogajni)
add_react_android_subdir(src/main/jni/react/jni)
add_react_android_subdir(src/main/java/com/facebook/react/reactperflogger/jni)
add_react_android_subdir(src/main/jni/react/reactperflogger)
add_react_android_subdir(src/main/java/com/facebook/react/jscexecutor)
add_react_android_subdir(src/main/java/com/facebook/react/turbomodule/core/jni)
add_react_android_subdir(src/main/java/com/facebook/react/uimanager/jni)

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

@ -1,4 +1,5 @@
---
InheritParentConfig: true
Checks: '>
clang-diagnostic-*,
'