/** * 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 */ import type { Task } from "./types"; import type { ExecaPromise } from "execa"; type AppleBuildMode = "Debug" | "Release"; type AppleBuildOptions = { isWorkspace: boolean, name: string, mode: AppleBuildMode, scheme?: string, destination: "device" | "simulator" | string, ...AppleOptions, }; type AppleBootstrapOption = { // Enabled by default hermes: boolean, newArchitecture: boolean, frameworks?: "static" | "dynamic", ...AppleOptions, }; type AppleInstallApp = { // Install the app on a simulator or device, typically this is the description from // `xcrun simctl list devices` device: string, appPath: string, bundleId: string, ...AppleOptions, }; type AppleOptions = { // The directory where the Xcode project is located cwd: string, // The environment variables to pass to the build command env?: { [key: string]: string | void, ... }, }; /* eslint sort-keys: "off" */ declare export const tasks: { // 1. Setup your environment for building the iOS apps bootstrap: (options: AppleBootstrapOption) => { cleanupBuildFolder: Task, runCodegen: Task, validate: Task, installRubyGems: Task, installDependencies: Task, }, // 2. Build the iOS app using a setup environment build: ( options: AppleBuildOptions, ...args: $ReadOnlyArray ) => { validate: Task, hasPodsInstalled: Task, build: Task, }, // 3. Install the built app on a simulator or device ios: { install: (options: AppleInstallApp) => { validate: Task, install: Task, }, }, };