From badb5c82d8e38648843aab4b548d0cd8452b3a8e Mon Sep 17 00:00:00 2001 From: Will Schurman Date: Thu, 7 Mar 2024 15:40:03 -0800 Subject: [PATCH] [eas-cli] Use new expo-updates configuration:syncnative for versioned native sync --- packages/eas-cli/src/update/android/UpdatesModule.ts | 12 ++++++++++++ packages/eas-cli/src/update/ios/UpdatesModule.ts | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/packages/eas-cli/src/update/android/UpdatesModule.ts b/packages/eas-cli/src/update/android/UpdatesModule.ts index 15c3fd2429..ca733cbba6 100644 --- a/packages/eas-cli/src/update/android/UpdatesModule.ts +++ b/packages/eas-cli/src/update/android/UpdatesModule.ts @@ -2,6 +2,8 @@ import { ExpoConfig } from '@expo/config'; import { AndroidConfig, AndroidManifest, XML } from '@expo/config-plugins'; import { RequestedPlatform } from '../../platform'; +import { isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync } from '../../project/projectUtils'; +import { expoUpdatesCommandAsync } from '../../utils/expoUpdatesCli'; import { ensureValidVersions } from '../utils'; /** @@ -13,6 +15,15 @@ export async function syncUpdatesConfigurationAsync( ): Promise { ensureValidVersions(exp, RequestedPlatform.Android); + if (await isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync(projectDir)) { + await expoUpdatesCommandAsync(projectDir, [ + 'configuration:syncnative', + '--platform', + 'android', + ]); + return; + } + // sync AndroidManifest.xml const androidManifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(projectDir); const androidManifest = await getAndroidManifestAsync(projectDir); @@ -32,6 +43,7 @@ export async function syncUpdatesConfigurationAsync( path: stringsJSONPath, }); + // TODO(wschurman): this dependency needs to be updated for fingerprint const updatedStringsResourceXML = await AndroidConfig.Updates.applyRuntimeVersionFromConfigForProjectRootAsync( projectDir, diff --git a/packages/eas-cli/src/update/ios/UpdatesModule.ts b/packages/eas-cli/src/update/ios/UpdatesModule.ts index df4bbc26ed..3adcd55bf6 100644 --- a/packages/eas-cli/src/update/ios/UpdatesModule.ts +++ b/packages/eas-cli/src/update/ios/UpdatesModule.ts @@ -2,6 +2,8 @@ import { ExpoConfig } from '@expo/config'; import { IOSConfig } from '@expo/config-plugins'; import { RequestedPlatform } from '../../platform'; +import { isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync } from '../../project/projectUtils'; +import { expoUpdatesCommandAsync } from '../../utils/expoUpdatesCli'; import { readPlistAsync, writePlistAsync } from '../../utils/plist'; import { Client } from '../../vcs/vcs'; import { ensureValidVersions } from '../utils'; @@ -12,7 +14,14 @@ export async function syncUpdatesConfigurationAsync( exp: ExpoConfig ): Promise { ensureValidVersions(exp, RequestedPlatform.Ios); + + if (await isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync(projectDir)) { + await expoUpdatesCommandAsync(projectDir, ['configuration:syncnative', '--platform', 'ios']); + return; + } + const expoPlist = await readExpoPlistAsync(projectDir); + // TODO(wschurman): this dependency needs to be updated for fingerprint const updatedExpoPlist = await IOSConfig.Updates.setUpdatesConfigAsync( projectDir, exp,