-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Local cli/android/normalize project name #18275
Local cli/android/normalize project name #18275
Conversation
update master
… local-cli/android/normalize-project-name
Generated by 🚫 dangerJS |
Hey! Awesome PR, and definitely important for Android developers. I have only one thing to request: can you please verify that unlink also works as expected? 🙌 |
Hello, I did add some test to the helpers used by both link and unlink:
so everything should be fine |
@facebook-github-bot shipit |
Something went wrong executing that command, @hramos could you take a look? |
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.
@Kureev is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android. I added tests in the 2 impacted functions + a test file for the normalizer function <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** --> [CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again.⚠️ Closes facebook#18275 Differential Revision: D7305227 Pulled By: hramos fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android. I added tests in the 2 impacted functions + a test file for the normalizer function <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** --> [CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again.⚠️ Closes facebook#18275 Differential Revision: D7305227 Pulled By: hramos fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android. I added tests in the 2 impacted functions + a test file for the normalizer function <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** --> [CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again.⚠️ Closes facebook#18275 Differential Revision: D7305227 Pulled By: hramos fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android. I added tests in the 2 impacted functions + a test file for the normalizer function <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** --> [CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again.⚠️ Closes facebook#18275 Differential Revision: D7305227 Pulled By: hramos fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android. I added tests in the 2 impacted functions + a test file for the normalizer function <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** --> [CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again.⚠️ Closes facebook#18275 Differential Revision: D7305227 Pulled By: hramos fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
Is this PR planned for a release? |
@petermekhaeil it's in |
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android. I added tests in the 2 impacted functions + a test file for the normalizer function <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** --> [CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again.⚠️ Closes facebook#18275 Differential Revision: D7305227 Pulled By: hramos fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
Newer versions of Gradle don't allow project names to contain a variety of characters, including `/`, that have special meaning in filesystems or in various Gradle features: https://docs.gradle.org/4.2/release-notes.html#path-separator-characters-in-names-are-deprecated We don't use such a new version of Gradle for the actual build, but apparently the current versions of both Android Studio, and the default Java extension in VS Code, do use it. Both give obscure errors (though AS's is much more reasonable) with the old name, and successfully complete a Gradle project sync after this fix. The project name is just an identifier for our own use within the Gradle config, so we can rename it however we like; just need to do so everywhere in our Gradle config. An underscore is the choice made by newer upstream versions of `react-native link`: facebook/react-native#18275 so an underscore it is.
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android. I added tests in the 2 impacted functions + a test file for the normalizer function <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** --> [CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again.⚠️ Closes facebook/react-native#18275 Differential Revision: D7305227 Pulled By: hramos fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
Motivation
Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android.
Test Plan
I added tests in the 2 impacted functions + a test file for the normalizer function
Related PRs
#17000 This was the initial PR but this is done without mutations
Release Notes
[CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.⚠️ However if you previously linked scoped packages, they will get linked again. ⚠️