Skip to content

Commit

Permalink
[eas-cli] Use new expo-updates configuration:syncnative for versioned…
Browse files Browse the repository at this point in the history
… native sync
  • Loading branch information
wschurman committed Mar 7, 2024
1 parent d78917b commit badb5c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/eas-cli/src/update/android/UpdatesModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -13,6 +15,15 @@ export async function syncUpdatesConfigurationAsync(
): Promise<void> {
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);
Expand All @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions packages/eas-cli/src/update/ios/UpdatesModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -12,7 +14,14 @@ export async function syncUpdatesConfigurationAsync(
exp: ExpoConfig
): Promise<void> {
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,
Expand Down

0 comments on commit badb5c8

Please sign in to comment.