mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
84a2765c2a
Summary: Use a more suitable name for the [scripts used in the release process](https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-testing.md) to generate a testing project to test a new React Native release against. ```diff - test-e2e-local + test-release-local ``` ## Changelog: [INTERNAL] Pull Request resolved: https://github.com/facebook/react-native/pull/52541 Test Plan: `yarn test-release-local-clean` works the same way: <img width="1177" height="161" alt="Screenshot 2025-07-10 at 17 54 50" src="https://github.com/user-attachments/assets/5efe30c6-a738-476e-a670-696959e9a0fc" /> `yarn test-release-local` works the same way: <img width="1077" height="395" alt="Screenshot 2025-07-10 at 17 59 29" src="https://github.com/user-attachments/assets/fe6c6443-9316-4ed0-b6dc-51de5ffb109c" /> Reviewed By: cipolleschi Differential Revision: D78150648 Pulled By: vzaidman fbshipit-source-id: 471715da271d03bc2a35afbda02074bf71f62734
79 lines
2.4 KiB
JavaScript
79 lines
2.4 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.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/*
|
|
* This script, paired with test-release-local.js, is the full suite of
|
|
* tooling needed for a successful local testing experience.
|
|
* This script is an helper to clean up the environment fully
|
|
* before running the test suite.
|
|
*
|
|
* You should use this when switching between branches.
|
|
*
|
|
* It will:
|
|
* - clean up node modules
|
|
* - clean up the build folder (derived data, gradlew clean)
|
|
* - clean up the pods folder for RNTester (pod install) (and Podfile.lock too)
|
|
* - kill all packagers
|
|
* - remove RNTestProject folder
|
|
*
|
|
* an improvements to consider:
|
|
* - an option to uninstall the apps (RNTester, RNTestProject) from emulators
|
|
*/
|
|
|
|
const {VERDACCIO_STORAGE_PATH} = require('../e2e/utils/verdaccio');
|
|
const {isPackagerRunning} = require('./utils/testing-utils');
|
|
const {exec, exit} = require('shelljs');
|
|
|
|
console.info('\n** Starting the clean up process **\n');
|
|
|
|
// let's check if Metro is already running, if it is let's kill it and start fresh
|
|
if (isPackagerRunning() === 'running') {
|
|
exec("lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill");
|
|
console.info('\n** Killed Metro **\n');
|
|
}
|
|
|
|
// Android
|
|
console.info('\n** Cleaning Gradle build artifacts **\n');
|
|
exec('./gradlew clean');
|
|
exec('rm -rf /tmp/maven-local');
|
|
exec('rm -rf /tmp/react-native-tmp');
|
|
|
|
// iOS
|
|
console.info('\n** Nuking the derived data folder **\n');
|
|
exec('rm -rf ~/Library/Developer/Xcode/DerivedData');
|
|
|
|
console.info('\n** Removing the hermes-engine pod cache **\n');
|
|
exec('rm -rf ~/Library/Caches/CocoaPods/Pods/External/hermes-engine');
|
|
|
|
// RNTester Pods
|
|
console.info('\n** Removing the RNTester Pods **\n');
|
|
exec('rm -rf packages/rn-tester/Pods');
|
|
|
|
// RNTestProject
|
|
console.info('\n** Removing the RNTestProject folder **\n');
|
|
exec('rm -rf /tmp/RNTestProject');
|
|
|
|
console.info('\n** Removing Verdaccio storage directory **\n');
|
|
exec(`rm -rf ${VERDACCIO_STORAGE_PATH}`);
|
|
|
|
// final clean up
|
|
console.info('\n** Final git level wipe **\n');
|
|
// clean unstaged changes from git
|
|
exec('git checkout -- .');
|
|
// remove all the untracked files
|
|
exec('git clean -fdx');
|
|
|
|
console.info(
|
|
'\n** Clean up process completed\nPlease remember to run yarn install if you are planning to test again\n',
|
|
);
|
|
exit(0);
|