Files
react-native/scripts/hermes/create-tarball.js
T
Riccardo Cipolleschi 5e5d29e43c Remove version from the tarball (#35285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35285

While doing the release 0f 0.71.0-RC0, we noticed that having the RN version in the hermes tarball was causing more harm than good.

With the version in the name, we ended up with multiple tarballs for debug and release and we were not able to explicitly pick the right tarball given a build.

This change remove the version from the tarball name.

## Changelog
[General][Changed] - Remove React Native version from Hermes tarball name

Reviewed By: lunaleaps

Differential Revision: D41156353

fbshipit-source-id: 8899d5e1e1555bc728d923f3b78d1261e6ff09c7
2022-11-22 11:24:26 +00:00

75 lines
1.8 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
'use strict';
const fs = require('fs');
const os = require('os');
const path = require('path');
/**
* This script creates a Hermes prebuilt artifacts tarball.
* Must be invoked after Hermes has been built.
*/
const yargs = require('yargs');
const {createHermesPrebuiltArtifactsTarball} = require('./hermes-utils');
let argv = yargs
.option('i', {
alias: 'inputDir',
describe: 'Path to directory where Hermes build artifacts were generated.',
})
.option('b', {
alias: 'buildType',
type: 'string',
describe: 'Specifies whether Hermes was built for Debug or Release.',
default: 'Debug',
})
.option('o', {
alias: 'outputDir',
describe: 'Location where the tarball will be saved to.',
})
.option('exclude-debug-symbols', {
describe: 'Whether dSYMs should be excluded from the tarball.',
type: 'boolean',
default: true,
}).argv;
async function main() {
const hermesDir = argv.inputDir;
const buildType = argv.buildType;
const excludeDebugSymbols = argv.excludeDebugSymbols;
let tarballOutputDir = argv.outputDir;
if (!tarballOutputDir) {
try {
tarballOutputDir = fs.mkdtempSync(
path.join(os.tmpdir(), 'hermes-engine-tarball-'),
);
} catch (error) {
throw new Error(
`[Hermes] Failed to create temporary output directory: ${error}`,
);
}
}
const tarballOutputPath = createHermesPrebuiltArtifactsTarball(
hermesDir,
buildType,
tarballOutputDir,
excludeDebugSymbols,
);
console.log(tarballOutputPath);
return tarballOutputPath;
}
main().then(() => {
process.exit(0);
});