mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Attempt to fix https://github.com/facebook/react-native/pull/8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes https://github.com/facebook/react-native/pull/8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
const fs = require('fs');
|
|
const getReactVersion = require('../getReactNativeVersion');
|
|
const getPrefix = require('./getPrefix');
|
|
|
|
const applyPatch = require('./patches/applyPatch');
|
|
const makeStringsPatch = require('./patches/makeStringsPatch');
|
|
const makeSettingsPatch = require(`./patches/makeSettingsPatch`);
|
|
const makeBuildPatch = require(`./patches/makeBuildPatch`);
|
|
|
|
module.exports = function registerNativeAndroidModule(
|
|
name,
|
|
androidConfig,
|
|
params,
|
|
projectConfig
|
|
) {
|
|
const buildPatch = makeBuildPatch(name);
|
|
const prefix = getPrefix(getReactVersion(projectConfig.folder));
|
|
const makeImportPatch = require(`./${prefix}/makeImportPatch`);
|
|
const makePackagePatch = require(`./${prefix}/makePackagePatch`);
|
|
|
|
applyPatch(
|
|
projectConfig.settingsGradlePath,
|
|
makeSettingsPatch(name, androidConfig, projectConfig)
|
|
);
|
|
|
|
applyPatch(projectConfig.buildGradlePath, buildPatch);
|
|
applyPatch(projectConfig.stringsPath, makeStringsPatch(params, name));
|
|
|
|
applyPatch(
|
|
projectConfig.mainFilePath,
|
|
makePackagePatch(androidConfig.packageInstance, params, name)
|
|
);
|
|
|
|
applyPatch(
|
|
projectConfig.mainFilePath,
|
|
makeImportPatch(androidConfig.packageImportPath)
|
|
);
|
|
};
|