mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-15 03:38:08 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc320de954 | ||
|
|
d24c686133 |
No files matched your search
@@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages.
|
|||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
|
||||||
|
- Load iOS entitlements from prebuild config when `./ios` is gitignored. ([#1852](https://github.com/expo/eas-cli/pull/1852) by [@byCedric](https://github.com/byCedric))
|
||||||
|
|
||||||
### 🧹 Chores
|
### 🧹 Chores
|
||||||
|
|
||||||
- Short format for selecting devices prompt. ([#1840](https://github.com/expo/eas-cli/pull/1840) by [@khamilowicz](https://github.com/khamilowicz))
|
- Short format for selecting devices prompt. ([#1840](https://github.com/expo/eas-cli/pull/1840) by [@khamilowicz](https://github.com/khamilowicz))
|
||||||
|
|||||||
@@ -169,4 +169,8 @@ describe(syncCapabilityIdentifiersForEntitlementsAsync, () => {
|
|||||||
})
|
})
|
||||||
).rejects.toThrow(/is not available. Enter a different string/);
|
).rejects.toThrow(/is not available. Enter a different string/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it(`ignores capabilities from "/ios" folder when gitignored`, async () => {
|
||||||
|
//
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -2,12 +2,15 @@ import { IOSConfig, compileModsAsync } from '@expo/config-plugins';
|
|||||||
import { JSONObject } from '@expo/json-file';
|
import { JSONObject } from '@expo/json-file';
|
||||||
import { getPrebuildConfigAsync } from '@expo/prebuild-config';
|
import { getPrebuildConfigAsync } from '@expo/prebuild-config';
|
||||||
|
|
||||||
|
import Log from '../../log';
|
||||||
import { readPlistAsync } from '../../utils/plist';
|
import { readPlistAsync } from '../../utils/plist';
|
||||||
|
import { getVcsClient } from '../../vcs';
|
||||||
|
|
||||||
interface Target {
|
interface Target {
|
||||||
buildConfiguration?: string;
|
buildConfiguration?: string;
|
||||||
targetName: string;
|
targetName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getManagedApplicationTargetEntitlementsAsync(
|
export async function getManagedApplicationTargetEntitlementsAsync(
|
||||||
projectDir: string,
|
projectDir: string,
|
||||||
env: Record<string, string>
|
env: Record<string, string>
|
||||||
@@ -43,3 +46,37 @@ export async function getNativeTargetEntitlementsAsync(
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When users have the `./ios` folder ignored through gitignore,
|
||||||
|
* we should load the app entitlements as managed instead of native/bare workflow.
|
||||||
|
* Without this, the user's configuration through config plugins will be ignored.
|
||||||
|
* The gitignore check can be disabled by setting the `EAS_SYNC_NATIVE_CAPABILITIES=1` env variable.
|
||||||
|
*/
|
||||||
|
export async function getNativeTargetEntitlementsUnlessGitIgnoredAsync(
|
||||||
|
projectDir: string,
|
||||||
|
{
|
||||||
|
target,
|
||||||
|
env,
|
||||||
|
}: {
|
||||||
|
target: Target;
|
||||||
|
env: Record<string, string>;
|
||||||
|
}
|
||||||
|
): Promise<JSONObject | null> {
|
||||||
|
// Escape hatch to force syncing native capabilities from `/ios` folder
|
||||||
|
const useNativeCapabilities = process.env.EAS_SYNC_NATIVE_CAPABILITIES;
|
||||||
|
if (useNativeCapabilities) {
|
||||||
|
Log.log(
|
||||||
|
'Syncing native ios capabilities from `./ios` folder, EAS_SYNC_NATIVE_CAPABILITIES is defined.'
|
||||||
|
);
|
||||||
|
return getNativeTargetEntitlementsAsync(projectDir, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the capabilities from the prebuild config, instead of the native project when gitignored
|
||||||
|
if (await getVcsClient().isFileIgnoredAsync('ios')) {
|
||||||
|
return getManagedApplicationTargetEntitlementsAsync(projectDir, env);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the capabilities from the `./ios` native project
|
||||||
|
return getNativeTargetEntitlementsAsync(projectDir, target);
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ import { resolveWorkflowAsync } from '../workflow';
|
|||||||
import { getBundleIdentifierAsync } from './bundleIdentifier';
|
import { getBundleIdentifierAsync } from './bundleIdentifier';
|
||||||
import {
|
import {
|
||||||
getManagedApplicationTargetEntitlementsAsync,
|
getManagedApplicationTargetEntitlementsAsync,
|
||||||
getNativeTargetEntitlementsAsync,
|
getNativeTargetEntitlementsUnlessGitIgnoredAsync,
|
||||||
} from './entitlements';
|
} from './entitlements';
|
||||||
import { XcodeBuildContext } from './scheme';
|
import { XcodeBuildContext } from './scheme';
|
||||||
|
|
||||||
@@ -89,6 +89,7 @@ export async function resolveBareProjectTargetsAsync({
|
|||||||
exp,
|
exp,
|
||||||
projectDir,
|
projectDir,
|
||||||
xcodeBuildContext,
|
xcodeBuildContext,
|
||||||
|
env,
|
||||||
}: ResolveTargetOptions): Promise<Target[]> {
|
}: ResolveTargetOptions): Promise<Target[]> {
|
||||||
const { buildScheme, buildConfiguration } = xcodeBuildContext;
|
const { buildScheme, buildConfiguration } = xcodeBuildContext;
|
||||||
const result: Target[] = [];
|
const result: Target[] = [];
|
||||||
@@ -102,9 +103,12 @@ export async function resolveBareProjectTargetsAsync({
|
|||||||
targetName: applicationTarget.name,
|
targetName: applicationTarget.name,
|
||||||
buildConfiguration,
|
buildConfiguration,
|
||||||
});
|
});
|
||||||
const entitlements = await getNativeTargetEntitlementsAsync(projectDir, {
|
const entitlements = await getNativeTargetEntitlementsUnlessGitIgnoredAsync(projectDir, {
|
||||||
targetName: applicationTarget.name,
|
env: env ?? {},
|
||||||
buildConfiguration,
|
target: {
|
||||||
|
targetName: applicationTarget.name,
|
||||||
|
buildConfiguration,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
result.push({
|
result.push({
|
||||||
targetName: applicationTarget.name,
|
targetName: applicationTarget.name,
|
||||||
@@ -151,6 +155,7 @@ async function resolveBareProjectDependenciesAsync({
|
|||||||
target,
|
target,
|
||||||
bundleIdentifier,
|
bundleIdentifier,
|
||||||
pbxProject,
|
pbxProject,
|
||||||
|
env,
|
||||||
}: {
|
}: {
|
||||||
exp: ExpoConfig;
|
exp: ExpoConfig;
|
||||||
projectDir: string;
|
projectDir: string;
|
||||||
@@ -158,6 +163,7 @@ async function resolveBareProjectDependenciesAsync({
|
|||||||
target: IOSConfig.Target.Target;
|
target: IOSConfig.Target.Target;
|
||||||
bundleIdentifier: string;
|
bundleIdentifier: string;
|
||||||
pbxProject: XcodeProject;
|
pbxProject: XcodeProject;
|
||||||
|
env?: ResolveTargetOptions['env'];
|
||||||
}): Promise<Target[]> {
|
}): Promise<Target[]> {
|
||||||
const result: Target[] = [];
|
const result: Target[] = [];
|
||||||
|
|
||||||
@@ -170,9 +176,12 @@ async function resolveBareProjectDependenciesAsync({
|
|||||||
targetName: dependency.name,
|
targetName: dependency.name,
|
||||||
buildConfiguration,
|
buildConfiguration,
|
||||||
});
|
});
|
||||||
const entitlements = await getNativeTargetEntitlementsAsync(projectDir, {
|
const entitlements = await getNativeTargetEntitlementsUnlessGitIgnoredAsync(projectDir, {
|
||||||
targetName: target.name,
|
env: env ?? {},
|
||||||
buildConfiguration,
|
target: {
|
||||||
|
targetName: target.name,
|
||||||
|
buildConfiguration,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
result.push({
|
result.push({
|
||||||
targetName: dependency.name,
|
targetName: dependency.name,
|
||||||
@@ -193,6 +202,7 @@ async function resolveBareProjectDependenciesAsync({
|
|||||||
target: dependency,
|
target: dependency,
|
||||||
bundleIdentifier: dependencyBundleIdentifier,
|
bundleIdentifier: dependencyBundleIdentifier,
|
||||||
pbxProject,
|
pbxProject,
|
||||||
|
env,
|
||||||
});
|
});
|
||||||
if (dependencyDependencies.length > 0) {
|
if (dependencyDependencies.length > 0) {
|
||||||
result.push(...dependencyDependencies);
|
result.push(...dependencyDependencies);
|
||||||
|
|||||||
Reference in new issue
Block a user