Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iOS builds to use latest iOS SDK #679

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/vscode-extension/src/builders/BuildManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export class BuildManager {
}
};
buildResult = await buildIos(
deviceInfo,
getAppRootFolder(),
forceCleanBuild,
cancelToken,
Expand Down
21 changes: 3 additions & 18 deletions packages/vscode-extension/src/builders/buildIOS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Logger } from "../Logger";
import { CancelToken } from "./cancelToken";
import { BuildIOSProgressProcessor } from "./BuildIOSProgressProcessor";
import { getLaunchConfiguration } from "../utilities/launchConfiguration";
import { IOSDeviceInfo, DevicePlatform } from "../common/DeviceManager";
import { DevicePlatform } from "../common/DeviceManager";
import { EXPO_GO_BUNDLE_ID, downloadExpoGo, isExpoGoProject } from "./expoGo";
import { findXcodeProject, findXcodeScheme, IOSProjectInfo } from "../utilities/xcode";
import { runExternalBuild } from "./customBuild";
Expand Down Expand Up @@ -33,7 +33,6 @@ async function getBundleID(appPath: string) {
}

function buildProject(
deviceInfo: IOSDeviceInfo,
xcodeProject: IOSProjectInfo,
buildDir: string,
scheme: string,
Expand All @@ -50,7 +49,7 @@ function buildProject(
"-arch",
getXcodebuildArch(),
"-sdk",
`iphonesimulator${deviceInfo.runtimeInfo.version}`,
"iphonesimulator",
"-showBuildTimingSummary",
"-destination-timeout",
"0",
Expand All @@ -71,7 +70,6 @@ function buildProject(
}

export async function buildIos(
deviceInfo: IOSDeviceInfo,
appRootFolder: string,
forceCleanBuild: boolean,
cancelToken: CancelToken,
Expand Down Expand Up @@ -145,10 +143,8 @@ export async function buildIos(
const scheme = buildOptions?.scheme || (await findXcodeScheme(xcodeProject))[0];
Logger.debug(`Xcode build will use "${scheme}" scheme`);

let platformName: string | undefined;
const buildProcess = cancelToken.adapt(
buildProject(
deviceInfo,
xcodeProject,
sourceDir,
scheme,
Expand All @@ -161,23 +157,13 @@ export async function buildIos(
lineReader(buildProcess).onLineRead((line) => {
outputChannel.appendLine(line);
buildIOSProgressProcessor.processLine(line);
// Xcode can sometimes escape `=` with a backslash or put the value in quotes
const platformNameMatch = /export PLATFORM_NAME\\?="?(\w+)"?$/m.exec(line);
if (platformNameMatch) {
platformName = platformNameMatch[1];
}
});

await buildProcess;

if (!platformName) {
throw new Error(`Couldn't find "PLATFORM_NAME" in xcodebuild output`);
}

const appPath = await getBuildPath(
xcodeProject,
sourceDir,
platformName,
scheme,
buildOptions?.configuration || "Debug",
cancelToken
Expand All @@ -191,7 +177,6 @@ export async function buildIos(
async function getBuildPath(
xcodeProject: IOSProjectInfo,
projectDir: string,
platformName: string,
scheme: string,
configuration: string,
cancelToken: CancelToken
Expand All @@ -212,7 +197,7 @@ async function getBuildPath(
"-scheme",
scheme,
"-sdk",
platformName,
"iphonesimulator",
"-configuration",
configuration,
"-showBuildSettings",
Expand Down