Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.
If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again.
Visit https://cla.developers.google.com/ to see your current agreements or to sign a new one.
This project follows Google's Open Source Community Guidelines.
- Linux, Mac OS X, or Windows.
- git (used for source version control).
- An IDE such as Android Studio or Visual Studio Code.
- addlicense
- google-java-format Version 1.23.0 (used to format Java code).
- clang-format (used to format Objective-C code).
- Ensure all the dependencies described in the README are installed.
- Fork
https://github.com/googlemaps/react-native-navigation-sdk
into your own GitHub account. If you already have a fork, and are now installing a development environment on a new machine, make sure you've updated your fork. - If you haven't configured your machine with an SSH key that's known to github, then follow GitHub's directions to generate an SSH key.
git clone [email protected]:<your_name_here>/googlemaps/react-native-navigation-sdk.git
git remote add upstream [email protected]:googlemaps/react-native-sdk.git
(So that you fetch from the master repository, not your clone, when runninggit fetch
et al.)
git fetch upstream
git checkout upstream/master -b <name_of_your_branch>
- Start coding!
-
This project uses
lefthook
to ensure tests pass before committing. Please configure your environment paths to include the Go binary path foraddlicense
and the Node binary path fornpx
in the~/.lefthookrc
file. For more information, refer to the lefthook documentation. -
git commit -a -m "<your informative commit message>"
Please make sure all your check-ins have detailed commit messages explaining the patch. When naming the title of your pull request, please follow the Conventional Commits guide. For example, for a fix to the Driver library:
fix(navigation_view): fixed a bug!
-
git push origin <name_of_your_branch>
git pull-request
(if you are using Hub) or go tohttps://github.com/googlemaps/react-native-navigation-sdk
and click the "Compare & pull request" button
Make sure to test your changes before sending them for review. To do so, update and run the Sample app at ./example
.
This project enforces code formatting for Objective-C and Java files to follow Google's style guidelines. The formatting is automatically checked before commits and during continuous integration (CI) using Lefthook and GitHub Actions.
Before committing your changes, you should run the formatters manually to ensure your code adheres to the required style:
Objective-C:
./scripts/format-objc.sh
This script will format all Objective-C files under the /ios and /example/ios directories according to Google's Objective-C style guide.
Java:
./scripts/format-java.sh
This script will format all Java files under the /android and /example/android directories according to Google's Java style guide.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
Please peruse the Typescript style guide, Java style guide, and Objective-C style guide before working on anything non-trivial. These guidelines are intended to keep the code consistent and avoid common pitfalls.
Google Maps React Native Navigation package has integration tests.
Integration tests are responsible for ensuring that the plugin works against the native Navigation SDK for both Android and iOS platforms. Detox along with example application is used for the integration tests. "Integration tests must accompany the implementation of all new features. To run the test you must first install and setup detox. Please follow the guide here: https://wix.github.io/Detox/docs/introduction/environment-setup
Build the tests using detox-cli in the example folder:
iOS:
yarn run example detox:build:ios-release
Android:
yarn run example detox:build:android-release
Google Maps React Native Navigation SDK integration tests can be run with the following command:
iOS
yarn run example detox:test:ios-release
Android:
yarn run example detox:test:android-release
When adding new tests, you need to first add the detox part in the e2e folder and then the actual logical part of the test in the integration tests page of the example app.