eas-cli 0.35.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -37
- package/build/analytics/common.d.ts +8 -0
- package/build/analytics/common.js +19 -0
- package/build/analytics/events.d.ts +43 -0
- package/build/analytics/events.js +51 -0
- package/build/{analytics.d.ts → analytics/rudderstackClient.d.ts} +0 -0
- package/build/{analytics.js → analytics/rudderstackClient.js} +2 -2
- package/build/build/android/build.d.ts +2 -1
- package/build/build/android/build.js +11 -9
- package/build/build/build.d.ts +0 -2
- package/build/build/build.js +19 -29
- package/build/build/configure.js +0 -1
- package/build/build/context.d.ts +19 -11
- package/build/build/context.js +0 -96
- package/build/build/createContext.d.ts +13 -0
- package/build/build/createContext.js +114 -0
- package/build/build/ios/UpdatesModule.js +3 -2
- package/build/build/ios/build.d.ts +2 -1
- package/build/build/ios/build.js +24 -19
- package/build/build/ios/credentials.js +3 -3
- package/build/build/ios/version.js +7 -3
- package/build/build/local.js +28 -26
- package/build/build/metadata.d.ts +1 -12
- package/build/build/metadata.js +24 -19
- package/build/build/types.d.ts +0 -1
- package/build/build/utils/devClient.d.ts +1 -2
- package/build/build/utils/repository.js +1 -0
- package/build/build/validate.d.ts +3 -3
- package/build/commandUtils/EasCommand.js +4 -4
- package/build/commands/branch/publish.js +24 -2
- package/build/commands/build/configure.js +2 -0
- package/build/commands/build/index.js +12 -17
- package/build/commands/channel/create.d.ts +6 -0
- package/build/commands/channel/create.js +2 -0
- package/build/commands/secret/create.js +0 -6
- package/build/commands/secret/delete.js +0 -6
- package/build/commands/secret/list.js +0 -6
- package/build/commands/submit.js +2 -11
- package/build/commands/webhook/create.js +1 -2
- package/build/commands/webhook/list.js +1 -1
- package/build/commands/webhook/update.js +1 -2
- package/build/credentials/android/actions/RemoveFcm.js +4 -4
- package/build/credentials/android/utils/keystore.js +67 -32
- package/build/credentials/ios/actions/AscApiKeyUtils.js +8 -7
- package/build/credentials/ios/actions/AssignAscApiKey.js +1 -1
- package/build/credentials/ios/actions/CreateAscApiKey.js +2 -2
- package/build/credentials/ios/actions/RemoveAscApiKey.js +6 -6
- package/build/credentials/ios/actions/SetUpAscApiKey.js +8 -8
- package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +3 -3
- package/build/credentials/ios/appstore/ascApiKey.js +12 -12
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +11 -1
- package/build/credentials/ios/appstore/entitlements.d.ts +2 -2
- package/build/credentials/ios/appstore/entitlements.js +28 -21
- package/build/credentials/ios/credentials.js +2 -2
- package/build/credentials/ios/utils/printCredentials.js +1 -1
- package/build/credentials/manager/AndroidActions.js +3 -3
- package/build/credentials/manager/IosActions.js +5 -5
- package/build/credentials/manager/ManageIos.js +4 -4
- package/build/graphql/generated.d.ts +146 -54
- package/build/graphql/generated.js +1 -0
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +3 -0
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +23 -0
- package/build/project/android/applicationId.d.ts +6 -0
- package/build/project/android/applicationId.js +39 -29
- package/build/project/android/gradle.js +3 -2
- package/build/project/android/gradleUtils.d.ts +1 -0
- package/build/project/ios/bundleIdentifier.d.ts +6 -1
- package/build/project/ios/bundleIdentifier.js +29 -18
- package/build/submit/BaseSubmitter.d.ts +20 -4
- package/build/submit/BaseSubmitter.js +34 -1
- package/build/submit/android/AndroidSubmitCommand.d.ts +1 -2
- package/build/submit/android/AndroidSubmitCommand.js +23 -35
- package/build/submit/android/AndroidSubmitter.d.ts +12 -8
- package/build/submit/android/AndroidSubmitter.js +30 -21
- package/build/submit/android/ServiceAccountSource.d.ts +3 -2
- package/build/submit/android/ServiceAccountSource.js +16 -4
- package/build/submit/context.d.ts +4 -0
- package/build/submit/context.js +16 -1
- package/build/submit/ios/AppSpecificPasswordSource.d.ts +8 -1
- package/build/submit/ios/AppSpecificPasswordSource.js +44 -4
- package/build/submit/ios/CredentialsServiceSource.d.ts +9 -5
- package/build/submit/ios/CredentialsServiceSource.js +22 -5
- package/build/submit/ios/IosSubmitCommand.d.ts +2 -2
- package/build/submit/ios/IosSubmitCommand.js +46 -53
- package/build/submit/ios/IosSubmitter.d.ts +17 -7
- package/build/submit/ios/IosSubmitter.js +55 -29
- package/build/submit/submit.js +13 -4
- package/build/user/User.js +1 -1
- package/build/{build/ios → utils}/plist.d.ts +1 -1
- package/build/{build/ios → utils}/plist.js +8 -2
- package/build/utils/profiles.d.ts +9 -4
- package/build/utils/profiles.js +14 -7
- package/build/vcs/clients/git.d.ts +2 -1
- package/build/vcs/clients/git.js +87 -6
- package/build/vcs/vcs.d.ts +4 -3
- package/build/vcs/vcs.js +3 -3
- package/build/webhooks/input.d.ts +2 -2
- package/build/webhooks/input.js +19 -2
- package/oclif.manifest.json +1 -1
- package/package.json +10 -10
- package/build/build/utils/analytics.d.ts +0 -22
- package/build/build/utils/analytics.js +0 -28
- package/build/project/isEasEnabledForProject.d.ts +0 -8
- package/build/project/isEasEnabledForProject.js +0 -33
- package/build/submit/android/AndroidPackageSource.d.ts +0 -17
- package/build/submit/android/AndroidPackageSource.js +0 -27
package/build/build/context.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
2
|
import { Platform, Workflow } from '@expo/eas-build-job';
|
|
3
3
|
import { BuildProfile } from '@expo/eas-json';
|
|
4
|
+
import type { XCBuildConfiguration } from 'xcode';
|
|
5
|
+
import { TrackingContext } from '../analytics/common';
|
|
4
6
|
import { CredentialsContext } from '../credentials/context';
|
|
7
|
+
import { Target } from '../credentials/ios/types';
|
|
5
8
|
import { RequestedPlatform } from '../platform';
|
|
9
|
+
import { GradleBuildContext } from '../project/android/gradle';
|
|
10
|
+
import { XcodeBuildContext } from '../project/ios/scheme';
|
|
6
11
|
import { Actor } from '../user/User';
|
|
7
|
-
import { TrackingContext } from './types';
|
|
8
12
|
export interface ConfigureContext {
|
|
9
13
|
user: Actor;
|
|
10
14
|
projectDir: string;
|
|
@@ -15,6 +19,18 @@ export interface ConfigureContext {
|
|
|
15
19
|
hasAndroidNativeProject: boolean;
|
|
16
20
|
hasIosNativeProject: boolean;
|
|
17
21
|
}
|
|
22
|
+
export declare type CommonContext<T extends Platform> = Omit<BuildContext<T>, 'android' | 'ios'>;
|
|
23
|
+
export interface AndroidBuildContext {
|
|
24
|
+
applicationId: string;
|
|
25
|
+
gradleContext?: GradleBuildContext;
|
|
26
|
+
}
|
|
27
|
+
export interface IosBuildContext {
|
|
28
|
+
bundleIdentifier: string;
|
|
29
|
+
applicationTargetBuildSettings: XCBuildConfiguration['buildSettings'];
|
|
30
|
+
applicationTarget: Target;
|
|
31
|
+
targets: Target[];
|
|
32
|
+
xcodeBuildContext: XcodeBuildContext;
|
|
33
|
+
}
|
|
18
34
|
export interface BuildContext<T extends Platform> {
|
|
19
35
|
accountName: string;
|
|
20
36
|
buildProfile: BuildProfile<T>;
|
|
@@ -32,14 +48,6 @@ export interface BuildContext<T extends Platform> {
|
|
|
32
48
|
trackingCtx: TrackingContext;
|
|
33
49
|
user: Actor;
|
|
34
50
|
workflow: Workflow;
|
|
51
|
+
android: T extends Platform.ANDROID ? AndroidBuildContext : undefined;
|
|
52
|
+
ios: T extends Platform.IOS ? IosBuildContext : undefined;
|
|
35
53
|
}
|
|
36
|
-
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, local, nonInteractive, platform, projectDir, skipProjectConfiguration, }: {
|
|
37
|
-
buildProfileName: string;
|
|
38
|
-
buildProfile: BuildProfile<T>;
|
|
39
|
-
clearCache: boolean;
|
|
40
|
-
local: boolean;
|
|
41
|
-
nonInteractive: boolean;
|
|
42
|
-
platform: T;
|
|
43
|
-
projectDir: string;
|
|
44
|
-
skipProjectConfiguration: boolean;
|
|
45
|
-
}): Promise<BuildContext<T>>;
|
package/build/build/context.js
CHANGED
|
@@ -1,98 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createBuildContextAsync = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
-
const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
|
|
7
|
-
const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
|
|
8
|
-
const uuid_1 = require("uuid");
|
|
9
|
-
const context_1 = require("../credentials/context");
|
|
10
|
-
const expoConfig_1 = require("../project/expoConfig");
|
|
11
|
-
const projectUtils_1 = require("../project/projectUtils");
|
|
12
|
-
const workflow_1 = require("../project/workflow");
|
|
13
|
-
const Account_1 = require("../user/Account");
|
|
14
|
-
const actions_1 = require("../user/actions");
|
|
15
|
-
const analytics_1 = (0, tslib_1.__importStar)(require("./utils/analytics"));
|
|
16
|
-
async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, local, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
|
|
17
|
-
var _a;
|
|
18
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
|
|
19
|
-
const user = await (0, actions_1.ensureLoggedInAsync)();
|
|
20
|
-
const accountName = (0, projectUtils_1.getProjectAccountName)(exp, user);
|
|
21
|
-
const projectName = exp.slug;
|
|
22
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp, { env: buildProfile.env });
|
|
23
|
-
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform);
|
|
24
|
-
const accountId = (_a = (0, Account_1.findAccountByName)(user.accounts, accountName)) === null || _a === void 0 ? void 0 : _a.id;
|
|
25
|
-
const credentialsCtx = new context_1.CredentialsContext({
|
|
26
|
-
exp,
|
|
27
|
-
nonInteractive,
|
|
28
|
-
projectDir,
|
|
29
|
-
user,
|
|
30
|
-
});
|
|
31
|
-
const devClientProperties = getDevClientEventProperties({
|
|
32
|
-
platform,
|
|
33
|
-
projectDir,
|
|
34
|
-
buildProfile,
|
|
35
|
-
});
|
|
36
|
-
const trackingCtx = {
|
|
37
|
-
tracking_id: (0, uuid_1.v4)(),
|
|
38
|
-
platform,
|
|
39
|
-
...(accountId && { account_id: accountId }),
|
|
40
|
-
account_name: accountName,
|
|
41
|
-
project_id: projectId,
|
|
42
|
-
project_type: workflow,
|
|
43
|
-
...devClientProperties,
|
|
44
|
-
};
|
|
45
|
-
analytics_1.default.logEvent(analytics_1.Event.BUILD_COMMAND, trackingCtx);
|
|
46
|
-
return {
|
|
47
|
-
accountName,
|
|
48
|
-
buildProfile,
|
|
49
|
-
buildProfileName,
|
|
50
|
-
clearCache,
|
|
51
|
-
credentialsCtx,
|
|
52
|
-
exp,
|
|
53
|
-
local,
|
|
54
|
-
nonInteractive,
|
|
55
|
-
platform,
|
|
56
|
-
projectDir,
|
|
57
|
-
projectId,
|
|
58
|
-
projectName,
|
|
59
|
-
skipProjectConfiguration,
|
|
60
|
-
trackingCtx,
|
|
61
|
-
user,
|
|
62
|
-
workflow,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
exports.createBuildContextAsync = createBuildContextAsync;
|
|
66
|
-
function getDevClientEventProperties({ platform, projectDir, buildProfile, }) {
|
|
67
|
-
var _a;
|
|
68
|
-
let includesDevClient;
|
|
69
|
-
const version = tryGetDevClientVersion(projectDir);
|
|
70
|
-
if (platform === eas_build_job_1.Platform.ANDROID && 'gradleCommand' in buildProfile) {
|
|
71
|
-
includesDevClient = Boolean(version && ((_a = buildProfile.gradleCommand) === null || _a === void 0 ? void 0 : _a.includes('Debug')));
|
|
72
|
-
}
|
|
73
|
-
else if (platform === eas_build_job_1.Platform.IOS && 'buildConfiguration' in buildProfile) {
|
|
74
|
-
includesDevClient = Boolean(version && buildProfile.buildConfiguration === 'Debug');
|
|
75
|
-
}
|
|
76
|
-
else if (buildProfile.developmentClient) {
|
|
77
|
-
includesDevClient = true;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
includesDevClient = false;
|
|
81
|
-
}
|
|
82
|
-
if (version) {
|
|
83
|
-
return { dev_client: includesDevClient, dev_client_version: version };
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
return { dev_client: includesDevClient };
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function tryGetDevClientVersion(projectDir) {
|
|
90
|
-
var _a, _b;
|
|
91
|
-
try {
|
|
92
|
-
const pkg = json_file_1.default.read((0, resolve_from_1.default)(projectDir, 'expo-dev-client/package.json'));
|
|
93
|
-
return (_b = (_a = pkg.version) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : null;
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Platform } from '@expo/eas-build-job';
|
|
2
|
+
import { BuildProfile } from '@expo/eas-json';
|
|
3
|
+
import { BuildContext } from './context';
|
|
4
|
+
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, local, nonInteractive, platform, projectDir, skipProjectConfiguration, }: {
|
|
5
|
+
buildProfileName: string;
|
|
6
|
+
buildProfile: BuildProfile<T>;
|
|
7
|
+
clearCache: boolean;
|
|
8
|
+
local: boolean;
|
|
9
|
+
nonInteractive: boolean;
|
|
10
|
+
platform: T;
|
|
11
|
+
projectDir: string;
|
|
12
|
+
skipProjectConfiguration: boolean;
|
|
13
|
+
}): Promise<BuildContext<T>>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBuildContextAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
+
const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
|
|
7
|
+
const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const events_1 = require("../analytics/events");
|
|
10
|
+
const context_1 = require("../credentials/context");
|
|
11
|
+
const expoConfig_1 = require("../project/expoConfig");
|
|
12
|
+
const projectUtils_1 = require("../project/projectUtils");
|
|
13
|
+
const workflow_1 = require("../project/workflow");
|
|
14
|
+
const Account_1 = require("../user/Account");
|
|
15
|
+
const actions_1 = require("../user/actions");
|
|
16
|
+
const build_1 = require("./android/build");
|
|
17
|
+
const build_2 = require("./ios/build");
|
|
18
|
+
async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, local, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
|
|
19
|
+
var _a;
|
|
20
|
+
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
|
|
21
|
+
const user = await (0, actions_1.ensureLoggedInAsync)();
|
|
22
|
+
const accountName = (0, projectUtils_1.getProjectAccountName)(exp, user);
|
|
23
|
+
const projectName = exp.slug;
|
|
24
|
+
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp, { env: buildProfile.env });
|
|
25
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform);
|
|
26
|
+
const accountId = (_a = (0, Account_1.findAccountByName)(user.accounts, accountName)) === null || _a === void 0 ? void 0 : _a.id;
|
|
27
|
+
const credentialsCtx = new context_1.CredentialsContext({
|
|
28
|
+
exp,
|
|
29
|
+
nonInteractive,
|
|
30
|
+
projectDir,
|
|
31
|
+
user,
|
|
32
|
+
});
|
|
33
|
+
const devClientProperties = getDevClientEventProperties({
|
|
34
|
+
platform,
|
|
35
|
+
projectDir,
|
|
36
|
+
buildProfile,
|
|
37
|
+
});
|
|
38
|
+
const trackingCtx = {
|
|
39
|
+
tracking_id: (0, uuid_1.v4)(),
|
|
40
|
+
platform,
|
|
41
|
+
...(accountId && { account_id: accountId }),
|
|
42
|
+
account_name: accountName,
|
|
43
|
+
project_id: projectId,
|
|
44
|
+
project_type: workflow,
|
|
45
|
+
...devClientProperties,
|
|
46
|
+
};
|
|
47
|
+
events_1.Analytics.logEvent(events_1.BuildEvent.BUILD_COMMAND, trackingCtx);
|
|
48
|
+
const commonContext = {
|
|
49
|
+
accountName,
|
|
50
|
+
buildProfile,
|
|
51
|
+
buildProfileName,
|
|
52
|
+
clearCache,
|
|
53
|
+
credentialsCtx,
|
|
54
|
+
exp,
|
|
55
|
+
local,
|
|
56
|
+
nonInteractive,
|
|
57
|
+
platform,
|
|
58
|
+
projectDir,
|
|
59
|
+
projectId,
|
|
60
|
+
projectName,
|
|
61
|
+
skipProjectConfiguration,
|
|
62
|
+
trackingCtx,
|
|
63
|
+
user,
|
|
64
|
+
workflow,
|
|
65
|
+
};
|
|
66
|
+
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
67
|
+
const common = commonContext;
|
|
68
|
+
return {
|
|
69
|
+
...common,
|
|
70
|
+
android: await (0, build_1.createAndroidContextAsync)(common),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const common = commonContext;
|
|
75
|
+
return {
|
|
76
|
+
...common,
|
|
77
|
+
ios: await (0, build_2.createIosContextAsync)(common),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.createBuildContextAsync = createBuildContextAsync;
|
|
82
|
+
function getDevClientEventProperties({ platform, projectDir, buildProfile, }) {
|
|
83
|
+
var _a;
|
|
84
|
+
let includesDevClient;
|
|
85
|
+
const version = tryGetDevClientVersion(projectDir);
|
|
86
|
+
if (platform === eas_build_job_1.Platform.ANDROID && 'gradleCommand' in buildProfile) {
|
|
87
|
+
includesDevClient = Boolean(version && ((_a = buildProfile.gradleCommand) === null || _a === void 0 ? void 0 : _a.includes('Debug')));
|
|
88
|
+
}
|
|
89
|
+
else if (platform === eas_build_job_1.Platform.IOS && 'buildConfiguration' in buildProfile) {
|
|
90
|
+
includesDevClient = Boolean(version && buildProfile.buildConfiguration === 'Debug');
|
|
91
|
+
}
|
|
92
|
+
else if (buildProfile.developmentClient) {
|
|
93
|
+
includesDevClient = true;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
includesDevClient = false;
|
|
97
|
+
}
|
|
98
|
+
if (version) {
|
|
99
|
+
return { dev_client: includesDevClient, dev_client_version: version };
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return { dev_client: includesDevClient };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function tryGetDevClientVersion(projectDir) {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
try {
|
|
108
|
+
const pkg = json_file_1.default.read((0, resolve_from_1.default)(projectDir, 'expo-dev-client/package.json'));
|
|
109
|
+
return (_b = (_a = pkg.version) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : null;
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -6,9 +6,9 @@ const config_plugins_1 = require("@expo/config-plugins");
|
|
|
6
6
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
7
7
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
8
8
|
const actions_1 = require("../../user/actions");
|
|
9
|
+
const plist_1 = require("../../utils/plist");
|
|
9
10
|
const vcs_1 = require("../../vcs");
|
|
10
11
|
const updates_1 = require("../utils/updates");
|
|
11
|
-
const plist_1 = require("./plist");
|
|
12
12
|
async function configureUpdatesAsync(projectDir, exp) {
|
|
13
13
|
(0, updates_1.ensureValidVersions)(exp);
|
|
14
14
|
const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
|
|
@@ -49,8 +49,9 @@ async function ensureUpdatesConfiguredAsync(projectDir) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
async function readExpoPlistAsync(projectDir) {
|
|
52
|
+
var _a;
|
|
52
53
|
const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
|
|
53
|
-
return (await (0, plist_1.readPlistAsync)(expoPlistPath));
|
|
54
|
+
return ((_a = (await (0, plist_1.readPlistAsync)(expoPlistPath))) !== null && _a !== void 0 ? _a : {});
|
|
54
55
|
}
|
|
55
56
|
async function writeExpoPlistAsync(projectDir, expoPlist) {
|
|
56
57
|
const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Platform } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildRequestSender } from '../build';
|
|
3
|
-
import { BuildContext } from '../context';
|
|
3
|
+
import { BuildContext, CommonContext, IosBuildContext } from '../context';
|
|
4
|
+
export declare function createIosContextAsync(ctx: CommonContext<Platform.IOS>): Promise<IosBuildContext>;
|
|
4
5
|
export declare function prepareIosBuildAsync(ctx: BuildContext<Platform.IOS>): Promise<BuildRequestSender>;
|
package/build/build/ios/build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prepareIosBuildAsync = void 0;
|
|
3
|
+
exports.prepareIosBuildAsync = exports.createIosContextAsync = void 0;
|
|
4
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
6
|
const BuildMutation_1 = require("../../graphql/mutations/BuildMutation");
|
|
@@ -14,7 +14,7 @@ const configure_1 = require("./configure");
|
|
|
14
14
|
const credentials_1 = require("./credentials");
|
|
15
15
|
const graphql_2 = require("./graphql");
|
|
16
16
|
const prepareJob_1 = require("./prepareJob");
|
|
17
|
-
async function
|
|
17
|
+
async function createIosContextAsync(ctx) {
|
|
18
18
|
const { buildProfile } = ctx;
|
|
19
19
|
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
20
20
|
await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
|
|
@@ -30,25 +30,36 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
30
30
|
projectDir: ctx.projectDir,
|
|
31
31
|
exp: ctx.exp,
|
|
32
32
|
}, xcodeBuildContext);
|
|
33
|
-
const
|
|
33
|
+
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
34
|
+
const applicationTargetBuildSettings = resolveBuildSettings(ctx, applicationTarget);
|
|
35
|
+
return {
|
|
36
|
+
bundleIdentifier: applicationTarget.bundleIdentifier,
|
|
37
|
+
applicationTarget,
|
|
38
|
+
applicationTargetBuildSettings,
|
|
39
|
+
targets,
|
|
40
|
+
xcodeBuildContext,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
exports.createIosContextAsync = createIosContextAsync;
|
|
44
|
+
async function prepareIosBuildAsync(ctx) {
|
|
34
45
|
return await (0, build_1.prepareBuildRequestForPlatformAsync)({
|
|
35
46
|
ctx,
|
|
36
47
|
ensureCredentialsAsync: async (ctx) => {
|
|
37
|
-
return (0, credentials_1.ensureIosCredentialsAsync)(ctx, targets);
|
|
48
|
+
return (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
|
|
38
49
|
},
|
|
39
50
|
ensureProjectConfiguredAsync: async () => {
|
|
40
51
|
await (0, configure_1.validateAndSyncProjectConfigurationAsync)({
|
|
41
52
|
projectDir: ctx.projectDir,
|
|
42
53
|
exp: ctx.exp,
|
|
43
|
-
buildProfile,
|
|
44
|
-
buildSettings:
|
|
54
|
+
buildProfile: ctx.buildProfile,
|
|
55
|
+
buildSettings: ctx.ios.applicationTargetBuildSettings,
|
|
45
56
|
});
|
|
46
57
|
},
|
|
47
|
-
getMetadataContext: () => {
|
|
48
|
-
return buildConfiguration;
|
|
49
|
-
},
|
|
50
58
|
prepareJobAsync: async (ctx, jobData) => {
|
|
51
|
-
return await (0, prepareJob_1.prepareJobAsync)(ctx, {
|
|
59
|
+
return await (0, prepareJob_1.prepareJobAsync)(ctx, {
|
|
60
|
+
...jobData,
|
|
61
|
+
buildScheme: ctx.ios.xcodeBuildContext.buildScheme,
|
|
62
|
+
});
|
|
52
63
|
},
|
|
53
64
|
sendBuildRequestAsync: async (appId, job, metadata) => {
|
|
54
65
|
const graphqlMetadata = (0, graphql_1.transformMetadata)(metadata);
|
|
@@ -62,21 +73,15 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
62
73
|
});
|
|
63
74
|
}
|
|
64
75
|
exports.prepareIosBuildAsync = prepareIosBuildAsync;
|
|
65
|
-
function
|
|
76
|
+
function resolveBuildSettings(ctx, applicationTarget) {
|
|
66
77
|
var _a;
|
|
67
78
|
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
68
|
-
return {
|
|
79
|
+
return {};
|
|
69
80
|
}
|
|
70
|
-
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
71
81
|
const project = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(ctx.projectDir);
|
|
72
82
|
const xcBuildConfiguration = config_plugins_1.IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {
|
|
73
83
|
targetName: applicationTarget.targetName,
|
|
74
84
|
buildConfiguration: applicationTarget.buildConfiguration,
|
|
75
85
|
});
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
buildSettings,
|
|
79
|
-
targetName: applicationTarget.targetName,
|
|
80
|
-
buildConfiguration: applicationTarget.buildConfiguration,
|
|
81
|
-
};
|
|
86
|
+
return (_a = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : xcBuildConfiguration.buildSettings) !== null && _a !== void 0 ? _a : {};
|
|
82
87
|
}
|
|
@@ -8,7 +8,7 @@ const BuildCredentialsUtils_1 = require("../../credentials/ios/actions/BuildCred
|
|
|
8
8
|
const entitlements_1 = require("../../credentials/ios/appstore/entitlements");
|
|
9
9
|
const credentials_1 = require("../utils/credentials");
|
|
10
10
|
async function ensureIosCredentialsAsync(buildCtx, targets) {
|
|
11
|
-
var _a;
|
|
11
|
+
var _a, _b;
|
|
12
12
|
if (!shouldProvideCredentials(buildCtx)) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
@@ -16,9 +16,9 @@ async function ensureIosCredentialsAsync(buildCtx, targets) {
|
|
|
16
16
|
app: (0, BuildCredentialsUtils_1.getAppFromContext)(buildCtx.credentialsCtx),
|
|
17
17
|
targets,
|
|
18
18
|
iosCapabilitiesOptions: {
|
|
19
|
-
entitlements: await (0, entitlements_1.resolveEntitlementsJsonAsync)(buildCtx.projectDir, buildCtx.workflow),
|
|
19
|
+
entitlements: await (0, entitlements_1.resolveEntitlementsJsonAsync)(buildCtx.projectDir, buildCtx.workflow, (_a = buildCtx.buildProfile.env) !== null && _a !== void 0 ? _a : {}),
|
|
20
20
|
},
|
|
21
|
-
distribution: (
|
|
21
|
+
distribution: (_b = buildCtx.buildProfile.distribution) !== null && _b !== void 0 ? _b : 'store',
|
|
22
22
|
enterpriseProvisioning: buildCtx.buildProfile.enterpriseProvisioning,
|
|
23
23
|
});
|
|
24
24
|
const { credentialsSource } = buildCtx.buildProfile;
|
|
@@ -10,9 +10,9 @@ const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
|
10
10
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
11
11
|
const workflow_1 = require("../../project/workflow");
|
|
12
12
|
const prompts_1 = require("../../prompts");
|
|
13
|
+
const plist_1 = require("../../utils/plist");
|
|
13
14
|
const appJson_1 = require("../utils/appJson");
|
|
14
15
|
const version_1 = require("../utils/version");
|
|
15
|
-
const plist_1 = require("./plist");
|
|
16
16
|
var BumpStrategy;
|
|
17
17
|
(function (BumpStrategy) {
|
|
18
18
|
BumpStrategy[BumpStrategy["APP_VERSION"] = 0] = "APP_VERSION";
|
|
@@ -96,7 +96,10 @@ async function maybeResolveVersionsAsync(projectDir, exp, buildSettings) {
|
|
|
96
96
|
appVersion: await readShortVersionAsync(projectDir, exp, buildSettings),
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
catch {
|
|
99
|
+
catch (err) {
|
|
100
|
+
log_1.default.warn('Failed to read app versions.');
|
|
101
|
+
log_1.default.warn(err.message);
|
|
102
|
+
log_1.default.warn('Proceeding anyway...');
|
|
100
103
|
return {};
|
|
101
104
|
}
|
|
102
105
|
}
|
|
@@ -125,8 +128,9 @@ function getInfoPlistPath(projectDir, buildSettings) {
|
|
|
125
128
|
}
|
|
126
129
|
exports.getInfoPlistPath = getInfoPlistPath;
|
|
127
130
|
async function readInfoPlistAsync(projectDir, buildSettings) {
|
|
131
|
+
var _a;
|
|
128
132
|
const infoPlistPath = getInfoPlistPath(projectDir, buildSettings);
|
|
129
|
-
return (await (0, plist_1.readPlistAsync)(infoPlistPath));
|
|
133
|
+
return ((_a = (await (0, plist_1.readPlistAsync)(infoPlistPath))) !== null && _a !== void 0 ? _a : {});
|
|
130
134
|
}
|
|
131
135
|
async function writeInfoPlistAsync({ projectDir, infoPlist, buildSettings, }) {
|
|
132
136
|
const infoPlistPath = getInfoPlistPath(projectDir, buildSettings);
|
package/build/build/local.js
CHANGED
|
@@ -3,36 +3,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.runLocalBuildAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"));
|
|
6
|
-
const
|
|
7
|
-
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
8
|
-
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
9
|
-
const log_1 = (0, tslib_1.__importDefault)(require("../log"));
|
|
6
|
+
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
10
7
|
const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
|
|
8
|
+
const PLUGIN_PACKAGE_VERSION = '0.0.50';
|
|
11
9
|
async function runLocalBuildAsync(job) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
await (0, spawn_async_1.default)(execNameOrPath, [arg], {
|
|
17
|
-
stdio: 'inherit',
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
if (err.code === 'ENOENT') {
|
|
22
|
-
log_1.default.warn(`Could not resolve executable ${execNameOrPath}.`);
|
|
23
|
-
log_1.default.warn(`Install ${PLUGIN_PACKAGE_NAME} package from npm e.g. ${chalk_1.default.bold(`npm install -g ${PLUGIN_PACKAGE_NAME}`)} and make sure it's in PATH.`);
|
|
24
|
-
throw err;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
10
|
+
const { command, args } = await getCommandAndArgsAsync(job);
|
|
11
|
+
await (0, spawn_async_1.default)(command, args, {
|
|
12
|
+
stdio: 'inherit',
|
|
13
|
+
});
|
|
27
14
|
}
|
|
28
15
|
exports.runLocalBuildAsync = runLocalBuildAsync;
|
|
29
|
-
async function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
async function getCommandAndArgsAsync(job) {
|
|
17
|
+
const jobBase64 = Buffer.from(JSON.stringify({ job })).toString('base64');
|
|
18
|
+
if (process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) {
|
|
19
|
+
return {
|
|
20
|
+
command: process.env.EAS_LOCAL_BUILD_PLUGIN_PATH,
|
|
21
|
+
args: [jobBase64],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const args = [`${PLUGIN_PACKAGE_NAME}@${PLUGIN_PACKAGE_VERSION}`, jobBase64];
|
|
26
|
+
if (await isAtLeastNpm7Async()) {
|
|
27
|
+
// npx shipped with npm >= 7.0.0 requires the "-y" flag to run commands without
|
|
28
|
+
// prompting the user to install a package that is used for the first time
|
|
29
|
+
args.unshift('-y');
|
|
34
30
|
}
|
|
31
|
+
return {
|
|
32
|
+
command: 'npx',
|
|
33
|
+
args,
|
|
34
|
+
};
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
}
|
|
37
|
+
async function isAtLeastNpm7Async() {
|
|
38
|
+
const version = (await (0, spawn_async_1.default)('npm', ['--version'])).stdout.trim();
|
|
39
|
+
return semver_1.default.gte(version, '7.0.0');
|
|
38
40
|
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
import { Metadata, Platform } from '@expo/eas-build-job';
|
|
2
|
-
import type { XCBuildConfiguration } from 'xcode';
|
|
3
|
-
import { GradleBuildContext } from '../project/android/gradle';
|
|
4
2
|
import { BuildContext } from './context';
|
|
5
|
-
export declare
|
|
6
|
-
export interface AndroidMetadataContext {
|
|
7
|
-
gradleContext?: GradleBuildContext;
|
|
8
|
-
}
|
|
9
|
-
export interface IosMetadataContext {
|
|
10
|
-
buildSettings: XCBuildConfiguration['buildSettings'];
|
|
11
|
-
targetName?: string;
|
|
12
|
-
buildConfiguration?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function collectMetadataAsync<T extends Platform>(ctx: BuildContext<T>, platformContext: MetadataContext<T>): Promise<Metadata>;
|
|
3
|
+
export declare function collectMetadataAsync<T extends Platform>(ctx: BuildContext<T>): Promise<Metadata>;
|
package/build/build/metadata.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.collectMetadataAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
6
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
|
-
const
|
|
6
|
-
const bundleIdentifier_1 = require("../project/ios/bundleIdentifier");
|
|
7
|
+
const log_1 = (0, tslib_1.__importDefault)(require("../log"));
|
|
7
8
|
const projectUtils_1 = require("../project/projectUtils");
|
|
8
9
|
const actions_1 = require("../user/actions");
|
|
9
10
|
const easCli_1 = require("../utils/easCli");
|
|
@@ -13,24 +14,34 @@ const version_1 = require("./android/version");
|
|
|
13
14
|
const UpdatesModule_2 = require("./ios/UpdatesModule");
|
|
14
15
|
const version_2 = require("./ios/version");
|
|
15
16
|
const updates_1 = require("./utils/updates");
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
// TODO(JJ): Replace this with the getRuntimeVersionNullable function in @expo/config-plugins
|
|
18
|
+
function getRuntimeVersionNullable(...[config, platform]) {
|
|
19
|
+
try {
|
|
20
|
+
return config_plugins_1.Updates.getRuntimeVersion(config, platform);
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
log_1.default.debug(e);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function collectMetadataAsync(ctx) {
|
|
28
|
+
var _a, _b;
|
|
18
29
|
const channelOrReleaseChannel = await resolveChannelOrReleaseChannelAsync(ctx);
|
|
19
30
|
const distribution = (_a = ('simulator' in ctx.buildProfile && ctx.buildProfile.simulator
|
|
20
31
|
? 'simulator'
|
|
21
32
|
: ctx.buildProfile.distribution)) !== null && _a !== void 0 ? _a : 'store';
|
|
22
33
|
const metadata = {
|
|
23
34
|
trackingContext: ctx.trackingCtx,
|
|
24
|
-
...(await maybeResolveVersionsAsync(ctx
|
|
35
|
+
...(await maybeResolveVersionsAsync(ctx)),
|
|
25
36
|
cliVersion: easCli_1.easCliVersion,
|
|
26
37
|
workflow: ctx.workflow,
|
|
27
38
|
credentialsSource: ctx.buildProfile.credentialsSource,
|
|
28
39
|
sdkVersion: ctx.exp.sdkVersion,
|
|
29
|
-
runtimeVersion: ctx.exp.
|
|
40
|
+
runtimeVersion: (_b = getRuntimeVersionNullable(ctx.exp, ctx.platform)) !== null && _b !== void 0 ? _b : undefined,
|
|
30
41
|
...channelOrReleaseChannel,
|
|
31
42
|
distribution,
|
|
32
43
|
appName: ctx.exp.name,
|
|
33
|
-
appIdentifier:
|
|
44
|
+
appIdentifier: resolveAppIdentifier(ctx),
|
|
34
45
|
buildProfile: ctx.buildProfileName,
|
|
35
46
|
gitCommitHash: await (0, vcs_1.getVcsClient)().getCommitHashAsync(),
|
|
36
47
|
isGitWorkingTreeDirty: await (0, vcs_1.getVcsClient)().hasUncommittedChangesAsync(),
|
|
@@ -42,11 +53,10 @@ async function collectMetadataAsync(ctx, platformContext) {
|
|
|
42
53
|
return (0, eas_build_job_1.sanitizeMetadata)(metadata);
|
|
43
54
|
}
|
|
44
55
|
exports.collectMetadataAsync = collectMetadataAsync;
|
|
45
|
-
async function maybeResolveVersionsAsync(ctx
|
|
46
|
-
var _a;
|
|
56
|
+
async function maybeResolveVersionsAsync(ctx) {
|
|
47
57
|
if (ctx.platform === eas_build_job_1.Platform.IOS) {
|
|
48
|
-
const iosContext =
|
|
49
|
-
return await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp,
|
|
58
|
+
const iosContext = ctx;
|
|
59
|
+
return await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, iosContext.ios.applicationTargetBuildSettings);
|
|
50
60
|
}
|
|
51
61
|
else if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
|
|
52
62
|
const androidCtx = ctx;
|
|
@@ -56,17 +66,12 @@ async function maybeResolveVersionsAsync(ctx, platformContext) {
|
|
|
56
66
|
throw new Error(`Unsupported platform ${ctx.platform}`);
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
|
-
|
|
69
|
+
function resolveAppIdentifier(ctx) {
|
|
60
70
|
if (ctx.platform === eas_build_job_1.Platform.IOS) {
|
|
61
|
-
|
|
62
|
-
return await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, ctx.exp, {
|
|
63
|
-
targetName: iosContext.targetName,
|
|
64
|
-
buildConfiguration: iosContext.buildConfiguration,
|
|
65
|
-
});
|
|
71
|
+
return ctx.ios.bundleIdentifier;
|
|
66
72
|
}
|
|
67
73
|
else {
|
|
68
|
-
|
|
69
|
-
return await (0, applicationId_1.getApplicationIdAsync)(ctx.projectDir, ctx.exp, androidContext.gradleContext);
|
|
74
|
+
return ctx.android.applicationId;
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
77
|
async function resolveChannelOrReleaseChannelAsync(ctx) {
|
package/build/build/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { BuildProfile } from '@expo/eas-json';
|
|
2
1
|
import { ProfileData } from '../../utils/profiles';
|
|
3
2
|
export declare function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, nonInteractive, buildProfiles, }: {
|
|
4
3
|
projectDir: string;
|
|
5
4
|
nonInteractive?: boolean;
|
|
6
|
-
buildProfiles?: ProfileData<
|
|
5
|
+
buildProfiles?: ProfileData<'build'>[];
|
|
7
6
|
}): Promise<void>;
|
|
@@ -113,6 +113,7 @@ async function reviewAndCommitChangesAsync(initialCommitMessage, { nonInteractiv
|
|
|
113
113
|
await (0, vcs_1.getVcsClient)().commitAsync({
|
|
114
114
|
commitMessage: initialCommitMessage,
|
|
115
115
|
commitAllFiles: false,
|
|
116
|
+
nonInteractive,
|
|
116
117
|
});
|
|
117
118
|
log_1.default.withTick('Committed changes.');
|
|
118
119
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Platform } from '@expo/eas-build-job';
|
|
2
|
-
import {
|
|
3
|
-
export declare function checkNodeEnvVariable(ctx:
|
|
4
|
-
export declare function checkGoogleServicesFileAsync<T extends Platform>(ctx:
|
|
2
|
+
import { CommonContext } from './context';
|
|
3
|
+
export declare function checkNodeEnvVariable(ctx: CommonContext<Platform>): void;
|
|
4
|
+
export declare function checkGoogleServicesFileAsync<T extends Platform>(ctx: CommonContext<T>): Promise<void>;
|