create one headless file for all platforms
Summary: We are distributing a single package via fbpkg containing the headless version linux and macOS. This changes the build process to only create a single zip-file containing these binaries. Reviewed By: passy Differential Revision: D14042031 fbshipit-source-id: 88992f17501353a70bc21799c6bd2957576268a3
This commit is contained in:
committed by
Facebook Github Bot
parent
c28ef62f07
commit
825bfffd21
@@ -32,13 +32,16 @@ function preludeBundle(dir, versionNumber) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createZip(buildDir, distDir, targets) {
|
async function createZip(buildDir, distDir, targets) {
|
||||||
return Promise.all(
|
return new Promise((resolve, reject) => {
|
||||||
targets.map(
|
|
||||||
target =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
const zip = new yazl.ZipFile();
|
const zip = new yazl.ZipFile();
|
||||||
|
|
||||||
|
// add binaries for each target
|
||||||
|
targets.forEach(target => {
|
||||||
const binary = `flipper-${target === 'mac' ? 'macos' : target}`;
|
const binary = `flipper-${target === 'mac' ? 'macos' : target}`;
|
||||||
zip.addFile(path.join(buildDir, binary), binary);
|
zip.addFile(path.join(buildDir, binary), binary);
|
||||||
|
});
|
||||||
|
|
||||||
|
// add plugins
|
||||||
const pluginDir = path.join(buildDir, PLUGINS_FOLDER_NAME);
|
const pluginDir = path.join(buildDir, PLUGINS_FOLDER_NAME);
|
||||||
fs.readdirSync(pluginDir).forEach(file => {
|
fs.readdirSync(pluginDir).forEach(file => {
|
||||||
zip.addFile(
|
zip.addFile(
|
||||||
@@ -46,17 +49,13 @@ async function createZip(buildDir, distDir, targets) {
|
|||||||
path.join(PLUGINS_FOLDER_NAME, file),
|
path.join(PLUGINS_FOLDER_NAME, file),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// write zip file
|
||||||
zip.outputStream
|
zip.outputStream
|
||||||
.pipe(
|
.pipe(fs.createWriteStream(path.join(distDir, `Flipper-headless.zip`)))
|
||||||
fs.createWriteStream(
|
|
||||||
path.join(distDir, `Flipper-headless-${target}.zip`),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.on('close', resolve);
|
.on('close', resolve);
|
||||||
zip.end();
|
zip.end();
|
||||||
}),
|
});
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user