Skip to content

Commit

Permalink
Fix facebook#18244 Support CRLF build.gradle for Linking
Browse files Browse the repository at this point in the history
Summary:
Fix for facebook#18244
Add support for build.gradle with CRLF based line ending when running react-native link

<!--
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!

-->

`react native link` fails if andorid/app/build.gradle has CRLF based line endings.

Minor 3 character code change.
Ran `react native link` on Windows and Mac to verify.

None

<!--
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.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
 [CLI] [BUGFIX] [local-cli/link/android/patches/makeBuildPath.js] - Support CRLF line endings
Closes facebook#18245

Differential Revision: D8044774

Pulled By: hramos

fbshipit-source-id: 93fad3db7022784ee949936777aa5ac25e3a64a3
  • Loading branch information
sujayjaju authored and macdoum1 committed Jun 28, 2018
1 parent e7b9a3c commit 2d908ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions local-cli/link/android/patches/makeBuildPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function makeBuildPatch(name) {

return {
installPattern,
pattern: /[^ \t]dependencies {\n/,
patch: ` compile project(':${normalizedProjectName}')\n`,
pattern: /[^ \t]dependencies {(\r\n|\n)/,
patch: ` compile project(':${normalizedProjectName}')\n`
};
};

0 comments on commit 2d908ca

Please sign in to comment.