Skip to content

Commit 3befaef

Browse files
committed
getting closer to have it fully working
1 parent fa1aad2 commit 3befaef

File tree

2 files changed

+41
-12
lines changed

2 files changed

+41
-12
lines changed

scripts/release-utils.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

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

@@ -96,22 +96,35 @@ function publishAndroidArtifactsToMaven(releaseVersion, isNightly) {
9696
}
9797

9898
function generateiOSArtifacts(
99-
hermesSourceFolder,
99+
jsiFolder,
100+
hermesEngineSourceFolder,
101+
hermesCoreSourceFolder,
100102
buildType,
101103
releaseVersion,
102104
targetFolder,
103105
) {
104-
pushd(`${hermesSourceFolder}`);
106+
pushd(`${hermesCoreSourceFolder}`);
105107

106108
//Generating iOS Artifacts
107-
exec(`BUILD_TYPE=${buildType} ./utils/build-mac-framework.sh`);
108-
exec(`BUILD_TYPE=${buildType} ./utils/build-ios-framework.sh`);
109-
exec(`BUILD_TYPE=${buildType} ./utils/build-apple-framework.sh`);
109+
console.log('BUILD MAC FRAMEWORK');
110+
exec(
111+
`JSI_PATH=${jsiFolder} BUILD_TYPE=${buildType} ${hermesEngineSourceFolder}/utils/build-mac-framework.sh`,
112+
);
113+
114+
console.log('BUILD IOS FRAMEWORK');
115+
exec(
116+
`JSI_PATH=${jsiFolder} BUILD_TYPE=${buildType} ${hermesEngineSourceFolder}/utils/build-ios-framework.sh`,
117+
);
118+
119+
console.log('BUILD APPLE FRAMEWORK');
120+
exec(
121+
`JSI_PATH=${jsiFolder} BUILD_TYPE=${buildType} ${hermesEngineSourceFolder}/utils/build-apple-framework.sh`,
122+
);
110123

111124
popd();
112125

113126
const tarballOutputPath = createHermesTarball(
114-
hermesSourceFolder,
127+
hermesCoreSourceFolder,
115128
buildType,
116129
releaseVersion,
117130
targetFolder,

scripts/test-e2e-local.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if (argv.target === 'RNTester') {
162162
exec(`node scripts/set-rn-version.js --to-version ${releaseVersion}`).code;
163163

164164
// Generate native files (Android only for now)
165-
generateAndroidArtifacts(releaseVersion, tmpPublishingFolder);
165+
// generateAndroidArtifacts(releaseVersion, tmpPublishingFolder);
166166

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

189+
console.info('\n\nGENERATING THE STUFF!\n\n');
190+
189191
// I need to tell it where the hermes stuff lives
190-
const hermesSourceFolder = `${repoRoot}/sdks/hermes-engine`;
192+
const jsiFolder = `${repoRoot}/ReactCommon/jsi`;
193+
const hermesEngineSourceFolder = `${repoRoot}/sdks/hermes-engine`;
194+
// TODO: need to try a full cleanup and see if the folder is there of if I need to download it
195+
const hermesCoreSourceFolder = `${repoRoot}/sdks/hermes`;
191196

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

199204
const tarballOutputPath = generateiOSArtifacts(
200-
hermesSourceFolder,
205+
jsiFolder,
206+
hermesEngineSourceFolder,
207+
hermesCoreSourceFolder,
201208
buildType,
202209
releaseVersion,
203210
localMavenPath,
204211
);
205212

206-
console.log('this is where I generated the tarball', tarballOutputPath);
213+
console.info(
214+
'this is where I generated the tarball (last element)',
215+
hermesEngineSourceFolder,
216+
hermesCoreSourceFolder,
217+
buildType,
218+
releaseVersion,
219+
localMavenPath,
220+
tarballOutputPath, // /private/tmp/maven-local/hermes-runtime-darwin-debug-v1000.0.0-20221031-1736.tar.gz
221+
);
207222

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

213229
// set HERMES_ENGINE_TARBALL_PATH to point to the local artifacts I just created
214230
exec(
215-
`HERMES_ENGINE_TARBALL_PATH=${hermesMavenPath} USE_HERMES=${
231+
`HERMES_ENGINE_TARBALL_PATH=${tarballOutputPath} USE_HERMES=${
216232
argv.hermes ? 1 : 0
217233
} bundle exec pod install --ansi`,
218234
);

0 commit comments

Comments
 (0)