Skip to content

Commit cb7ce49

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Fix build using nightlies (#54509)
Summary: Pull Request resolved: #54509 With the recent changes on where Hermes is published, we couldn't fetch automatically the nightly versions of ReactNativeDependencies because the url were misconfigured. This diff fixes that. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D86855230 fbshipit-source-id: 12dbcc117dd3716d93c5be960236b658fce7ac65
1 parent 5d0b0c8 commit cb7ce49

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

packages/react-native/scripts/ios-prebuild/hermes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ async function getNightlyTarballUrl(
204204
return await computeNightlyTarballURL(
205205
version,
206206
buildType,
207+
'hermes',
207208
artifactCoordinate,
208209
artifactName,
209210
);

packages/react-native/scripts/ios-prebuild/reactNativeDependencies.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ async function getNightlyTarballUrl(
200200
return await computeNightlyTarballURL(
201201
version,
202202
buildType,
203+
'react',
203204
coordinate,
204205
artifactName,
205206
);

packages/react-native/scripts/ios-prebuild/types.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export type Destination =
2020
'macOS,variant=Mac Catalyst';
2121
2222
export type BuildFlavor = 'Debug' | 'Release';
23+
24+
export type MavenSubGroup = 'hermes' | 'react';
2325
*/
2426

2527
module.exports = {};

packages/react-native/scripts/ios-prebuild/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @format
99
*/
1010

11-
/*:: import type {BuildFlavor} from './types'; */
11+
/*:: import type {BuildFlavor, MavenSubGroup} from './types'; */
1212

1313
const {execSync} = require('child_process');
1414
const fs = require('fs');
@@ -62,10 +62,11 @@ function createLogger(
6262
async function computeNightlyTarballURL(
6363
version /*: string */,
6464
buildType /*: BuildFlavor */,
65+
subGroup /*: MavenSubGroup */,
6566
artifactCoordinate /*: string */,
6667
artifactName /*: string */,
6768
) /*: Promise<string> */ {
68-
const xmlUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/hermes/${artifactCoordinate}/${version}-SNAPSHOT/maven-metadata.xml`;
69+
const xmlUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/${subGroup}/${artifactCoordinate}/${version}-SNAPSHOT/maven-metadata.xml`;
6970

7071
const response = await fetch(xmlUrl);
7172
if (!response.ok) {
@@ -97,7 +98,7 @@ async function computeNightlyTarballURL(
9798
const buildNumber = buildNumberMatch[1];
9899

99100
const fullVersion = `${version}-${timestamp}-${buildNumber}`;
100-
const finalUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/hermes/${artifactCoordinate}/${version}-SNAPSHOT/${artifactCoordinate}-${fullVersion}-${artifactName}`;
101+
const finalUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/${subGroup}/${artifactCoordinate}/${version}-SNAPSHOT/${artifactCoordinate}-${fullVersion}-${artifactName}`;
101102
return finalUrl;
102103
}
103104

0 commit comments

Comments
 (0)