RN-only build flag
Summary: Previously I had created a RN build, locally, with a few minor differences. That had to be reverted. Instead of reverting and re-applying changes, I'm introducing a flag that can be used in the interim to produce the RN-only builds. Reviewed By: LukeDefeo Differential Revision: D50555055 fbshipit-source-id: edface9a1587fb51e54eebe73724032baf985c83
This commit is contained in:
committed by
Facebook GitHub Bot
parent
05242b4ee9
commit
94120d61aa
@@ -73,6 +73,11 @@ const argv = yargs
|
||||
'Unique build identifier to be used as the version patch part for the build',
|
||||
type: 'number',
|
||||
},
|
||||
'react-native-only': {
|
||||
description: 'React Native only build',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
channel: {
|
||||
description: 'Release channel for the build',
|
||||
choices: ['stable', 'insiders'],
|
||||
@@ -115,6 +120,10 @@ if (argv['default-plugins-dir']) {
|
||||
process.env.FLIPPER_DEFAULT_PLUGINS_DIR = argv['default-plugins-dir'];
|
||||
}
|
||||
|
||||
if (argv['react-native-only']) {
|
||||
process.env.FLIPPER_REACT_NATIVE_ONLY = 'true';
|
||||
}
|
||||
|
||||
async function generateManifest(versionNumber: string) {
|
||||
await fs.writeFile(
|
||||
path.join(distDir, 'manifest.json'),
|
||||
@@ -130,6 +139,7 @@ async function modifyPackageManifest(
|
||||
versionNumber: string,
|
||||
hgRevision: string | null,
|
||||
channel: string,
|
||||
reactNativeOnly: boolean,
|
||||
) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Creating package.json manifest');
|
||||
@@ -148,6 +158,7 @@ async function modifyPackageManifest(
|
||||
manifest.revision = hgRevision;
|
||||
}
|
||||
manifest.releaseChannel = channel;
|
||||
manifest.reactNativeOnly = reactNativeOnly;
|
||||
await fs.writeFile(
|
||||
path.join(buildFolder, 'package.json'),
|
||||
JSON.stringify(manifest, null, ' '),
|
||||
@@ -299,7 +310,13 @@ async function copyStaticFolder(buildFolder: string) {
|
||||
await moveSourceMaps(dir, argv['source-map-dir']);
|
||||
const versionNumber = getVersionNumber(argv.version);
|
||||
const hgRevision = await genMercurialRevision();
|
||||
await modifyPackageManifest(dir, versionNumber, hgRevision, argv.channel);
|
||||
await modifyPackageManifest(
|
||||
dir,
|
||||
versionNumber,
|
||||
hgRevision,
|
||||
argv.channel,
|
||||
argv['react-native-only'],
|
||||
);
|
||||
await fs.ensureDir(distDir);
|
||||
await generateManifest(versionNumber);
|
||||
await buildDist(dir);
|
||||
|
||||
@@ -70,6 +70,10 @@ const argv = yargs
|
||||
'[FB-internal only] Will yield `true` on any GK. Disabled by default. Setting env var FLIPPER_ENABLE_ALL_GKS is equivalent',
|
||||
type: 'boolean',
|
||||
},
|
||||
'react-native-only': {
|
||||
description: '[FB-internal only] React Native only build',
|
||||
type: 'boolean',
|
||||
},
|
||||
channel: {
|
||||
describe:
|
||||
'[FB-internal only] Release channel. "stable" by default. Setting env var "FLIPPER_RELEASE_CHANNEL" is equivalent.',
|
||||
@@ -148,6 +152,10 @@ if (argv.channel !== undefined) {
|
||||
process.env.FLIPPER_RELEASE_CHANNEL = argv.channel;
|
||||
}
|
||||
|
||||
if (argv['react-native-only'] === true) {
|
||||
process.env.FLIPPER_REACT_NATIVE_ONLY = 'true';
|
||||
}
|
||||
|
||||
if (argv['force-version']) {
|
||||
process.env.FLIPPER_FORCE_VERSION = argv['force-version'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user