Skip to content

Do not store .cpp/.h files inside src/main/java - jscexecutor#34396

Closed
cortinico wants to merge 1 commit into
facebook:mainfrom
cortinico:export-D38615007
Closed

Do not store .cpp/.h files inside src/main/java - jscexecutor#34396
cortinico wants to merge 1 commit into
facebook:mainfrom
cortinico:export-D38615007

Conversation

@cortinico
Copy link
Copy Markdown
Contributor

Summary:
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 jscexecutor

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

Reviewed By: sshic

Differential Revision: D38615007

Summary:
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 jscexecutor

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

Reviewed By: sshic

Differential Revision: D38615007

fbshipit-source-id: 3d617f4a23cb36887262ecc45d16f064d8d84b18
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Aug 12, 2022
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D38615007

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 296d7db
Branch: main

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,614,927 -48
android hermes armeabi-v7a 7,029,884 -39
android hermes x86 7,914,966 -33
android hermes x86_64 7,888,565 -59
android jsc arm64-v8a 9,490,950 -34
android jsc armeabi-v7a 8,268,794 -32
android jsc x86 9,428,601 -30
android jsc x86_64 10,021,326 -59

Base commit: 296d7db
Branch: main

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cortinico in be39184.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 15, 2022
roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
…ok#34396)

Summary:
Pull Request resolved: facebook#34396

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 jscexecutor

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

Reviewed By: sshic

Differential Revision: D38615007

fbshipit-source-id: e5085130579f37f052b5c8a5702d2c0f1b332bee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants