Files
react-native/scripts/try-set-nightly-hermes-compiler.js
T
Jakub Piasecki 076e6a1d53 Use prebuilt Hermes by default when building Android (#54707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54707

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D87929652

fbshipit-source-id: 439eef5eea9b9203cf2a7b5a8eae38d83e192bd5
2025-12-15 08:13:16 -08:00

27 lines
927 B
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.
*/
// @flow
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
function main() {
const packageJsonPath = path.join(__dirname, '../packages/react-native/package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const hermesCompilerVersion = packageJson.dependencies['hermes-compiler'];
if (hermesCompilerVersion === '0.0.0') {
console.log(`Hermes compiler version not set. Updating to the latest nightly release.`);
execSync('yarn workspace react-native add hermes-compiler@nightly --exact', { stdio: 'inherit' });
} else {
console.log(`Hermes compiler version set to ${hermesCompilerVersion}. Not setting nightly hermes.`);
}
}
main();