mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8486b4c5ee
Summary: I'm not sure why, but my commit https://github.com/facebook/react-native/commit/97f5ef05e6396e9694e4b021e830b71c5900cd3c landed despite the PR still having a couple of merge conflicts from after Kudo's PR https://github.com/facebook/react-native/issues/34846 being merged. What happened is that basically it just "overwrote" those chances, so this PR is just a fix for that. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Changed] - re-adding Kudo's fix for nightly build Pull Request resolved: https://github.com/facebook/react-native/pull/34861 Test Plan: N/A Reviewed By: cipolleschi Differential Revision: D40059290 Pulled By: cortinico fbshipit-source-id: 38e495a0dbecd39e836d15aa2a1a30e7354d9813
83 lines
2.1 KiB
JavaScript
83 lines
2.1 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 {exec, echo, exit, test, env} = require('shelljs');
|
|
const {saveFiles} = require('./scm-utils');
|
|
|
|
function saveFilesToRestore(tmpPublishingFolder) {
|
|
const filesToSaveAndRestore = [
|
|
'template/Gemfile',
|
|
'template/_ruby-version',
|
|
'template/package.json',
|
|
'.ruby-version',
|
|
'Gemfile.lock',
|
|
'Gemfile',
|
|
'package.json',
|
|
'ReactAndroid/gradle.properties',
|
|
'Libraries/Core/ReactNativeVersion.js',
|
|
'React/Base/RCTVersion.m',
|
|
'ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java',
|
|
'ReactCommon/cxxreact/ReactNativeVersion.h',
|
|
];
|
|
|
|
saveFiles(filesToSaveAndRestore, tmpPublishingFolder);
|
|
}
|
|
|
|
function generateAndroidArtifacts(releaseVersion, tmpPublishingFolder) {
|
|
// -------- Generating Android Artifacts
|
|
env.REACT_NATIVE_SKIP_PREFAB = true;
|
|
if (exec('./gradlew :ReactAndroid:installArchives').code) {
|
|
echo('Could not generate artifacts');
|
|
exit(1);
|
|
}
|
|
|
|
// -------- Generating the Hermes Engine Artifacts
|
|
env.REACT_NATIVE_HERMES_SKIP_PREFAB = true;
|
|
if (exec('./gradlew :ReactAndroid:hermes-engine:installArchives').code) {
|
|
echo('Could not generate artifacts');
|
|
exit(1);
|
|
}
|
|
|
|
echo('Generated artifacts for Maven');
|
|
|
|
let artifacts = [
|
|
'.module',
|
|
'.pom',
|
|
'-debug.aar',
|
|
'-release.aar',
|
|
'-debug-sources.jar',
|
|
'-release-sources.jar',
|
|
].map(suffix => {
|
|
return `react-native-${releaseVersion}${suffix}`;
|
|
});
|
|
|
|
artifacts.forEach(name => {
|
|
if (
|
|
!test(
|
|
'-e',
|
|
`./android/com/facebook/react/react-native/${releaseVersion}/${name}`,
|
|
)
|
|
) {
|
|
echo(
|
|
`Failing as expected file: \n\
|
|
android/com/facebook/react/react-native/${releaseVersion}/${name}\n\
|
|
was not correctly generated.`,
|
|
);
|
|
exit(1);
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = {
|
|
generateAndroidArtifacts,
|
|
saveFilesToRestore,
|
|
};
|