Files
react-native/local-cli/link/android/patches/makeSettingsPatch.js
gengjiawen 58fe324163 fix ci path problem on Windows (#21203)
Summary:
fix ci path problem on Windows
pass all current ci.
none
 [GENERAL] [INTERNAL] [CI] - fix ci path problem on Windows
Pull Request resolved: https://github.com/facebook/react-native/pull/21203

Differential Revision: D9943608

Pulled By: hramos

fbshipit-source-id: 66e3e196a6c0015e0472851abeee32de9fef140c
2018-09-19 10:47:41 -07:00

32 lines
790 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const path = require('path');
const normalizeProjectName = require('./normalizeProjectName');
module.exports = function makeSettingsPatch(
name,
androidConfig,
projectConfig,
) {
var projectDir = path.relative(
path.dirname(projectConfig.settingsGradlePath),
androidConfig.sourceDir,
);
const normalizedProjectName = normalizeProjectName(name);
return {
pattern: '\n',
patch:
`include ':${normalizedProjectName}'\n` +
`project(':${normalizedProjectName}').projectDir = ` +
`new File(rootProject.projectDir, '${projectDir}')\n`,
};
};