@samitouri / QOS-React-2 / commits / c7d28a0136

Fix build/sync script for RN/CS/RT (#11302)

While testing some changes to RN, I noticed that the '--sync-fbsource' flag had been broken recently by things being moved around and the newly-added CS renderer. Fixed it up.

Brian Vaughn committed Oct 20, 2017 at 12:58 UTC c7d28a0136857a4d4b36fae19a91e4915c3cdc34
2 files changed +14 -14
scripts/rollup/build.js
+2 -2
@@ -594,10 +594,10 @@ rimraf('build', () => {
594 syncReactNative(join('build', 'react-native'), syncFbsource)
595 );
596 tasks.push(() =>
597 - syncReactNativeRT(join('build', 'react-native-rt'), syncFbsource)
597 + syncReactNativeRT(join('build', 'react-rt'), syncFbsource)
598 );
599 tasks.push(() =>
600 - syncReactNativeCS(join('build', 'react-native-cs'), syncFbsource)
600 + syncReactNativeCS(join('build', 'react-cs'), syncFbsource)
601 );
602 } else if (syncWww) {
603 tasks.push(() => syncReactDom(join('build', 'facebook-www'), syncWww));
scripts/rollup/sync.js
+12 -12
@@ -7,6 +7,7 @@ const resolvePath = require('./utils').resolvePath;
7 const DEFAULT_FB_SOURCE_PATH = '~/fbsource/';
8 const DEFAULT_WWW_PATH = '~/www/';
9 const RELATIVE_RN_PATH = 'xplat/js/react-native-github/Libraries/Renderer/';
10 +const RELATIVE_RN_CS_PATH = 'xplat/js/RKJSModules/Libraries/CS/downstream/';
11 const RELATIVE_RN_RT_PATH = 'xplat/js/RKJSModules/Libraries/RT/downstream/';
12 const RELATIVE_WWW_PATH = 'html/shared/react/';
13
@@ -33,7 +34,7 @@ function syncReactDom(buildPath, wwwPath) {
34 return doSync(buildPath, destPath);
35 }
36
36 -function syncReactNative(buildPath, fbSourcePath) {
37 +function syncReactNativeHelper(buildPath, fbSourcePath, relativeDestPath) {
38 fbSourcePath = typeof fbSourcePath === 'string'
39 ? fbSourcePath
40 : DEFAULT_FB_SOURCE_PATH;
@@ -42,27 +43,26 @@ function syncReactNative(buildPath, fbSourcePath) {
43 fbSourcePath += '/';
44 }
45
45 - const destPath = resolvePath(fbSourcePath + RELATIVE_RN_PATH);
46 + const destPath = resolvePath(fbSourcePath + relativeDestPath);
47
48 return doSync(buildPath, destPath);
49 }
50
50 -function syncReactNativeRT(buildPath, fbSourcePath) {
51 - fbSourcePath = typeof fbSourcePath === 'string'
52 - ? fbSourcePath
53 - : DEFAULT_FB_SOURCE_PATH;
54 -
55 - if (fbSourcePath.charAt(fbSourcePath.length - 1) !== '/') {
56 - fbSourcePath += '/';
57 - }
51 +function syncReactNative(buildPath, fbSourcePath) {
52 + return syncReactNativeHelper(buildPath, fbSourcePath, RELATIVE_RN_PATH);
53 +}
54
59 - const destPath = resolvePath(fbSourcePath + RELATIVE_RN_RT_PATH);
55 +function syncReactNativeCS(buildPath, fbSourcePath) {
56 + return syncReactNativeHelper(buildPath, fbSourcePath, RELATIVE_RN_CS_PATH);
57 +}
58
61 - return doSync(buildPath, destPath);
59 +function syncReactNativeRT(buildPath, fbSourcePath) {
60 + return syncReactNativeHelper(buildPath, fbSourcePath, RELATIVE_RN_RT_PATH);
61 }
62
63 module.exports = {
64 syncReactDom,
65 syncReactNative,
66 + syncReactNativeCS,
67 syncReactNativeRT,
68 };