mirror of
https://github.com/status-im/react-native.git
synced 2025-03-01 01:20:31 +00:00
Summary: Fix for #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 https://github.com/facebook/react-native/pull/18245 Differential Revision: D8044774 Pulled By: hramos fbshipit-source-id: 93fad3db7022784ee949936777aa5ac25e3a64a3
24 lines
653 B
JavaScript
24 lines
653 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
const normalizeProjectName = require('./normalizeProjectName');
|
|
|
|
module.exports = function makeBuildPatch(name) {
|
|
const normalizedProjectName = normalizeProjectName(name);
|
|
const installPattern = new RegExp(
|
|
`\\s{4}(compile)(\\(|\\s)(project)\\(\\\':${normalizedProjectName}\\\'\\)(\\)|\\s)`,
|
|
);
|
|
|
|
return {
|
|
installPattern,
|
|
pattern: /[^ \t]dependencies {(\r\n|\n)/,
|
|
patch: ` compile project(':${normalizedProjectName}')\n`
|
|
};
|
|
};
|