Files
react-native/scripts/releases/ios-prebuild/build.js
Tim Yung 84de8a075e RN: Delete @oncall Annotations (#51416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51416

Deletes `oncall` annotations from the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74902524

fbshipit-source-id: 32a6a5b2ff27281792d572f151e2b094d9a79029
2025-05-17 16:18:05 -07:00

70 lines
1.7 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
* @format
*/
const {execSync} = require('child_process');
/*::
import type { Dependency, Destination, Platform } from './types';
*/
/**
* Builds dependencies for the specified platforms. This function will use the generated
* Package.swift file together with the extracted dependencies to build the frameworks for
* the requested platforms.
*/
async function buildDepenencies(
scheme /*: string */,
configuration /*: string */,
dependencies /*: $ReadOnlyArray<Dependency> */,
destinations /*: $ReadOnlyArray<Destination> */,
rootFolder /*: string */,
buildFolder /*: string */,
) {
console.log('✅ Building dependencies...');
await Promise.all(
destinations.map(destination =>
buildPlatform(
scheme,
configuration,
destination,
rootFolder,
buildFolder,
),
),
);
}
/**
* Builds a single platform.
*/
async function buildPlatform(
scheme /*: string */,
configuration /*: string */,
destination /*: Destination */,
rootFolder /*: string */,
buildFolder /*: string */,
) {
console.log(`Building ${destination}...`);
const command =
`xcodebuild -scheme "${scheme}" -destination "generic/platform=${destination}" ` +
`-derivedDataPath "${buildFolder}" ` +
`-configuration "${configuration}" ` +
'SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
DEBUG_INFORMATION_FORMAT=dwarf-with-dsym';
execSync(command, {cwd: rootFolder, stdio: 'inherit'});
}
module.exports = {
buildDepenencies,
};