-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: autolinking for Android with Gradle #258
Merged
Merged
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
f5f6271
Initial commit
grabbou 9734a8f
Clean up main entry point
grabbou 3ab1c46
Fixes some typos
orta 703098f
Update configuration
grabbou 4f17675
Resolve conflicts
grabbou 32da7cf
update
grabbou 942db96
Tweaks to types
grabbou dcb0362
types and tweaks
grabbou 93090f8
Save another chunk of work
grabbou 4afecc2
add initial native modules gradle script
Salakar 8f947ce
[config] expose android sourceDir for react native module packages
Salakar 4af1cfe
rework config reader to new schema + add logging
Salakar 830e929
handle null android sourceDir
Salakar 505e4d0
add support for Packages that accept various app instance arguments
Salakar 64f3f5a
add build config support (for packages that use it in args)
Salakar 933512a
WIP part 2'
grabbou 9815ff2
Simplify diff by removing things we can tweak later
grabbou e50001a
Wip 3: Legacy link config
grabbou 2b3e016
Updates
grabbou bfc9ed7
Update name:
grabbou 2180a5a
Add deprecation messages for soon-to-be-deprecated rnpm configuration
grabbou 7abcaeb
Both array and string were acceptable in rnpm configuration
grabbou 225d739
Share root
grabbou 623b643
Documentation and refining the code
grabbou 3c7f36b
Start wrapping it up
grabbou b3cbf3b
Fix some simple flow errors
grabbou db90f50
Fix flow errors except for tests
grabbou 4b67b8b
Override configuration
grabbou 34224eb
Simplify typing changes
grabbou 717687b
Fix remaining flow errors
grabbou 50674d7
Validate dependencies separately
grabbou 752104b
Use Joi to validate schema
grabbou 8a491a8
Read Joi validated config
grabbou 1f1da28
Rewrite configuration once again
grabbou 089669b
Further simplification
grabbou c2c30e7
Simplify code again
grabbou d71658b
Print deprecation warning
grabbou 5c13c1a
Fix flow
grabbou a575d6c
Add basic error handling of Joi errors
grabbou 7b67f2e
wip
grabbou 6005390
chore: setup e2e tests (#264)
thymikee 5941d8f
Add first snapshot test using e2e utils
grabbou 8d08a00
Test for root too
grabbou b6e97cd
Merge remote-tracking branch 'origin/master' into feat/config
thymikee b5869f6
add initial native modules gradle script
Salakar 6a9ecd2
Merge branch 'master' of https://github.com/react-native-community/re…
Salakar 5ad00b3
move to platform-android
Salakar a7fb13b
cleanup
Salakar 5c3c7c9
update to new config output structure
Salakar 7a7115f
switch to using local cli path
Salakar 108b873
add `native_modules.gradle` to package files
Salakar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RN can technically be in monorepo so we can't make assumptions about where node_modules with cli are. That's why in iOS implementation we spawn a Node process and use its
require.resolve
to output the resolved path to stdoutThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is handled by the final arg here:
cli/packages/platform-android/native_modules.gradle
Line 178 in 7a7115f
cli/packages/platform-android/native_modules.gradle
Line 114 in 7a7115f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so it won't be seamless but at least that's supported. We need to add documentation on how the autolinking is working on how to configure it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Salakar, we already have
config.root
in our config outputted fromreact-native config
. You could use that one.Also, you can just do
console.log(require.resolve('react-native'))
script and execnode
to get the exact location. I think this is what we use on iOS.