From 2cf6dd49db8feafee98a357527c6c22e97ac0460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Thu, 19 Sep 2024 16:17:01 +0200 Subject: [PATCH] [eas-cli] Let iOS bundle identifier override always (#2576) # Why In a submit job we're going to have an IPA/APK to submit. We don't want to resolve any bundle identifiers from the project, we can use one from that IPA/APK. # How Let the override env variable override bundle identifier resolution if the workflow is managed too. # Test Plan I used it to submit an IPA with workflows. --- CHANGELOG.md | 1 + packages/eas-cli/src/project/android/applicationId.ts | 7 ++++--- packages/eas-cli/src/project/ios/bundleIdentifier.ts | 9 +++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e32bb4f456..90f81b527d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This is the log of notable changes to EAS CLI and related packages. - Log command execution to assist in debugging local builds. ([#2526](https://github.com/expo/eas-cli/pull/2526) by [@trajano](https://github.com/trajano)) - Allow submitting builds in progress ([#2543](https://github.com/expo/eas-cli/pull/2543) by [@radoslawkrzemien](https://github.com/radoslawkrzemien)) +- Use `EAS_DANGEROUS_OVERRIDE_ANDROID_APPLICATION_ID` and `EAS_DANGEROUS_OVERRIDE_IOS_BUNDLE_IDENTIFIER` environment variables as overrides of the Android application ID and iOS bundle identifier in managed workflow too. ([#2576](https://github.com/expo/eas-cli/pull/2576) by [@sjchmiela](https://github.com/sjchmiela)) ### 🐛 Bug fixes diff --git a/packages/eas-cli/src/project/android/applicationId.ts b/packages/eas-cli/src/project/android/applicationId.ts index 6cecb7dd44..f1039cdf9d 100644 --- a/packages/eas-cli/src/project/android/applicationId.ts +++ b/packages/eas-cli/src/project/android/applicationId.ts @@ -65,9 +65,6 @@ export async function getApplicationIdFromBareAsync( projectDir: string, gradleContext?: GradleBuildContext ): Promise { - if (env.overrideAndroidApplicationId) { - return env.overrideAndroidApplicationId; - } const errorMessage = 'Could not read applicationId from Android project.'; if (gradleContext) { @@ -109,6 +106,10 @@ export async function getApplicationIdAsync( vcsClient: Client, gradleContext?: GradleBuildContext ): Promise { + if (env.overrideAndroidApplicationId) { + return env.overrideAndroidApplicationId; + } + const workflow = await resolveWorkflowAsync(projectDir, Platform.ANDROID, vcsClient); if (workflow === Workflow.GENERIC) { warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject(projectDir, exp); diff --git a/packages/eas-cli/src/project/ios/bundleIdentifier.ts b/packages/eas-cli/src/project/ios/bundleIdentifier.ts index 91c4110281..07b4108e5c 100644 --- a/packages/eas-cli/src/project/ios/bundleIdentifier.ts +++ b/packages/eas-cli/src/project/ios/bundleIdentifier.ts @@ -59,14 +59,15 @@ export async function getBundleIdentifierAsync( vcsClient: Client, xcodeContext?: { targetName?: string; buildConfiguration?: string } ): Promise { + if (env.overrideIosBundleIdentifier) { + return env.overrideIosBundleIdentifier; + } + const workflow = await resolveWorkflowAsync(projectDir, Platform.IOS, vcsClient); + if (workflow === Workflow.GENERIC) { warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject(projectDir, exp); - if (env.overrideIosBundleIdentifier) { - return env.overrideIosBundleIdentifier; - } - const xcodeProject = IOSConfig.XcodeUtils.getPbxproj(projectDir); const isMultiScheme = IOSConfig.BuildScheme.getSchemesFromXcodeproj(projectDir).length > 1; const isMultiTarget =