Skip to content

Commit

Permalink
getting closer to have it fully working
Browse files Browse the repository at this point in the history
  • Loading branch information
kelset committed Nov 1, 2022
1 parent fa1aad2 commit 3befaef
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
27 changes: 20 additions & 7 deletions scripts/release-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'use strict';

const {exec, echo, exit, test, env} = require('shelljs');
const {exec, echo, exit, test, env, pushd, popd} = require('shelljs');
const {saveFiles} = require('./scm-utils');
const {createHermesTarball} = require('./hermes/hermes-utils');

Expand Down Expand Up @@ -96,22 +96,35 @@ function publishAndroidArtifactsToMaven(releaseVersion, isNightly) {
}

function generateiOSArtifacts(
hermesSourceFolder,
jsiFolder,
hermesEngineSourceFolder,
hermesCoreSourceFolder,
buildType,
releaseVersion,
targetFolder,
) {
pushd(`${hermesSourceFolder}`);
pushd(`${hermesCoreSourceFolder}`);

//Generating iOS Artifacts
exec(`BUILD_TYPE=${buildType} ./utils/build-mac-framework.sh`);
exec(`BUILD_TYPE=${buildType} ./utils/build-ios-framework.sh`);
exec(`BUILD_TYPE=${buildType} ./utils/build-apple-framework.sh`);
console.log('BUILD MAC FRAMEWORK');
exec(
`JSI_PATH=${jsiFolder} BUILD_TYPE=${buildType} ${hermesEngineSourceFolder}/utils/build-mac-framework.sh`,
);

console.log('BUILD IOS FRAMEWORK');
exec(
`JSI_PATH=${jsiFolder} BUILD_TYPE=${buildType} ${hermesEngineSourceFolder}/utils/build-ios-framework.sh`,
);

console.log('BUILD APPLE FRAMEWORK');
exec(
`JSI_PATH=${jsiFolder} BUILD_TYPE=${buildType} ${hermesEngineSourceFolder}/utils/build-apple-framework.sh`,
);

popd();

const tarballOutputPath = createHermesTarball(
hermesSourceFolder,
hermesCoreSourceFolder,
buildType,
releaseVersion,
targetFolder,
Expand Down
26 changes: 21 additions & 5 deletions scripts/test-e2e-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ if (argv.target === 'RNTester') {
exec(`node scripts/set-rn-version.js --to-version ${releaseVersion}`).code;

// Generate native files (Android only for now)
generateAndroidArtifacts(releaseVersion, tmpPublishingFolder);
// generateAndroidArtifacts(releaseVersion, tmpPublishingFolder);

// create locally the node module
exec('npm pack');
Expand All @@ -186,8 +186,13 @@ if (argv.target === 'RNTester') {
cd('ios');
exec('bundle install');

console.info('\n\nGENERATING THE STUFF!\n\n');

// I need to tell it where the hermes stuff lives
const hermesSourceFolder = `${repoRoot}/sdks/hermes-engine`;
const jsiFolder = `${repoRoot}/ReactCommon/jsi`;
const hermesEngineSourceFolder = `${repoRoot}/sdks/hermes-engine`;
// TODO: need to try a full cleanup and see if the folder is there of if I need to download it
const hermesCoreSourceFolder = `${repoRoot}/sdks/hermes`;

// for this scenario, we only need to create the debug build
// (env variable PRODUCTION defines that podspec side)
Expand All @@ -197,22 +202,33 @@ if (argv.target === 'RNTester') {
const localMavenPath = '/private/tmp/maven-local';

const tarballOutputPath = generateiOSArtifacts(
hermesSourceFolder,
jsiFolder,
hermesEngineSourceFolder,
hermesCoreSourceFolder,
buildType,
releaseVersion,
localMavenPath,
);

console.log('this is where I generated the tarball', tarballOutputPath);
console.info(
'this is where I generated the tarball (last element)',
hermesEngineSourceFolder,
hermesCoreSourceFolder,
buildType,
releaseVersion,
localMavenPath,
tarballOutputPath, // /private/tmp/maven-local/hermes-runtime-darwin-debug-v1000.0.0-20221031-1736.tar.gz
);

// TODO: verify if I actually need to do the renaming
// final name needs to be hermes-ios-debug.tar.gz
// so we need to do something like
// mv <folder>/hermes-runtime-darwin-debug-*.tar.gz <same-folder>/hermes-ios-debug.tar.gz
// see this line for reference: https://github.com/facebook/react-native/blob/main/.circleci/config.yml#L1412

// set HERMES_ENGINE_TARBALL_PATH to point to the local artifacts I just created
exec(
`HERMES_ENGINE_TARBALL_PATH=${hermesMavenPath} USE_HERMES=${
`HERMES_ENGINE_TARBALL_PATH=${tarballOutputPath} USE_HERMES=${
argv.hermes ? 1 : 0
} bundle exec pod install --ansi`,
);
Expand Down

0 comments on commit 3befaef

Please sign in to comment.