eas-cli 0.54.1 → 0.56.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 +44 -44
- package/build/build/android/build.js +2 -1
- package/build/build/android/version.d.ts +5 -0
- package/build/build/android/version.js +16 -9
- package/build/build/build.d.ts +2 -2
- package/build/build/build.js +16 -5
- package/build/build/context.d.ts +4 -3
- package/build/build/createContext.d.ts +5 -2
- package/build/build/createContext.js +3 -1
- package/build/build/ios/build.js +3 -17
- package/build/build/ios/syncProjectConfiguration.d.ts +3 -3
- package/build/build/ios/syncProjectConfiguration.js +2 -2
- package/build/build/ios/version.d.ts +10 -3
- package/build/build/ios/version.js +57 -28
- package/build/build/metadata.js +1 -1
- package/build/build/runBuildAndSubmit.d.ts +2 -0
- package/build/build/runBuildAndSubmit.js +19 -3
- package/build/build/types.d.ts +4 -0
- package/build/build/types.js +6 -1
- package/build/commands/build/index.d.ts +2 -0
- package/build/commands/build/index.js +8 -1
- package/build/commands/build/version/set.d.ts +10 -0
- package/build/commands/build/version/set.js +82 -0
- package/build/commands/build/version/sync.d.ts +12 -0
- package/build/commands/build/version/sync.js +124 -0
- package/build/commands/update/index.d.ts +1 -0
- package/build/commands/update/index.js +15 -4
- package/build/credentials/ios/types.d.ts +2 -0
- package/build/env.d.ts +11 -0
- package/build/env.js +12 -0
- package/build/graphql/generated.d.ts +102 -2
- package/build/graphql/generated.js +10 -1
- package/build/graphql/mutations/AppVersionMutation.d.ts +11 -0
- package/build/graphql/mutations/AppVersionMutation.js +28 -0
- package/build/graphql/mutations/BuildMutation.d.ts +3 -1
- package/build/graphql/mutations/BuildMutation.js +14 -2
- package/build/graphql/queries/AppVersionQuery.d.ts +4 -0
- package/build/graphql/queries/AppVersionQuery.js +37 -0
- package/build/graphql/queries/WebhookQuery.d.ts +1 -1
- package/build/metadata/apple/config/reader.d.ts +2 -1
- package/build/metadata/apple/config/reader.js +66 -9
- package/build/metadata/apple/config/writer.d.ts +3 -2
- package/build/metadata/apple/config/writer.js +64 -12
- package/build/metadata/apple/data.d.ts +2 -1
- package/build/metadata/apple/tasks/app-review-detail.d.ts +14 -0
- package/build/metadata/apple/tasks/app-review-detail.js +49 -0
- package/build/metadata/apple/tasks/app-version.js +2 -2
- package/build/metadata/apple/tasks/index.js +2 -1
- package/build/metadata/apple/types.d.ts +9 -11
- package/build/metadata/errors.d.ts +5 -0
- package/build/metadata/errors.js +18 -9
- package/build/metadata/upload.js +13 -3
- package/build/platform.d.ts +1 -0
- package/build/platform.js +17 -1
- package/build/project/android/applicationId.js +6 -2
- package/build/project/android/versions.d.ts +3 -0
- package/build/project/android/versions.js +23 -0
- package/build/project/applicationIdentifier.d.ts +4 -0
- package/build/project/applicationIdentifier.js +37 -0
- package/build/project/ios/bundleIdentifier.js +2 -2
- package/build/project/ios/target.js +14 -1
- package/build/project/ios/versions.d.ts +3 -0
- package/build/project/ios/versions.js +17 -0
- package/build/project/publish.d.ts +1 -2
- package/build/project/publish.js +15 -14
- package/build/project/remoteVersionSource.d.ts +6 -0
- package/build/project/remoteVersionSource.js +52 -0
- package/build/project/workflow.js +13 -11
- package/build/submit/utils/files.js +1 -1
- package/build/uploads.d.ts +9 -2
- package/build/uploads.js +21 -7
- package/oclif.manifest.json +1 -1
- package/package.json +9 -5
- package/schema/metadata-0.json +396 -336
package/build/build/ios/build.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareIosBuildAsync = exports.createIosContextAsync = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
4
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
5
|
const BuildMutation_1 = require("../../graphql/mutations/BuildMutation");
|
|
7
6
|
const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
|
|
@@ -33,11 +32,9 @@ async function createIosContextAsync(ctx) {
|
|
|
33
32
|
env: buildProfile.env,
|
|
34
33
|
});
|
|
35
34
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
36
|
-
const applicationTargetBuildSettings = resolveBuildSettings(ctx, applicationTarget);
|
|
37
35
|
return {
|
|
38
36
|
bundleIdentifier: applicationTarget.bundleIdentifier,
|
|
39
37
|
applicationTarget,
|
|
40
|
-
applicationTargetBuildSettings,
|
|
41
38
|
targets,
|
|
42
39
|
xcodeBuildContext,
|
|
43
40
|
};
|
|
@@ -54,7 +51,7 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
54
51
|
projectDir: ctx.projectDir,
|
|
55
52
|
exp: ctx.exp,
|
|
56
53
|
buildProfile: ctx.buildProfile,
|
|
57
|
-
|
|
54
|
+
targets: ctx.ios.targets,
|
|
58
55
|
});
|
|
59
56
|
},
|
|
60
57
|
prepareJobAsync: async (ctx, jobData) => {
|
|
@@ -63,27 +60,16 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
63
60
|
buildScheme: ctx.ios.xcodeBuildContext.buildScheme,
|
|
64
61
|
});
|
|
65
62
|
},
|
|
66
|
-
sendBuildRequestAsync: async (appId, job, metadata) => {
|
|
63
|
+
sendBuildRequestAsync: async (appId, job, metadata, buildParams) => {
|
|
67
64
|
const graphqlMetadata = (0, graphql_1.transformMetadata)(metadata);
|
|
68
65
|
const graphqlJob = (0, graphql_2.transformJob)(job);
|
|
69
66
|
return await BuildMutation_1.BuildMutation.createIosBuildAsync({
|
|
70
67
|
appId,
|
|
71
68
|
job: graphqlJob,
|
|
72
69
|
metadata: graphqlMetadata,
|
|
70
|
+
buildParams,
|
|
73
71
|
});
|
|
74
72
|
},
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
exports.prepareIosBuildAsync = prepareIosBuildAsync;
|
|
78
|
-
function resolveBuildSettings(ctx, applicationTarget) {
|
|
79
|
-
var _a;
|
|
80
|
-
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
81
|
-
return {};
|
|
82
|
-
}
|
|
83
|
-
const project = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(ctx.projectDir);
|
|
84
|
-
const xcBuildConfiguration = config_plugins_1.IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {
|
|
85
|
-
targetName: applicationTarget.targetName,
|
|
86
|
-
buildConfiguration: applicationTarget.buildConfiguration,
|
|
87
|
-
});
|
|
88
|
-
return (_a = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : xcBuildConfiguration.buildSettings) !== null && _a !== void 0 ? _a : {};
|
|
89
|
-
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
2
|
import { Platform } from '@expo/eas-build-job';
|
|
3
3
|
import { BuildProfile } from '@expo/eas-json';
|
|
4
|
-
import
|
|
5
|
-
export declare function syncProjectConfigurationAsync({ projectDir, exp, buildProfile,
|
|
4
|
+
import { Target } from '../../credentials/ios/types';
|
|
5
|
+
export declare function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, targets, }: {
|
|
6
6
|
projectDir: string;
|
|
7
7
|
exp: ExpoConfig;
|
|
8
8
|
buildProfile: BuildProfile<Platform.IOS>;
|
|
9
|
-
|
|
9
|
+
targets: Target[];
|
|
10
10
|
}): Promise<void>;
|
|
@@ -6,7 +6,7 @@ const projectUtils_1 = require("../../project/projectUtils");
|
|
|
6
6
|
const workflow_1 = require("../../project/workflow");
|
|
7
7
|
const UpdatesModule_1 = require("../../update/ios/UpdatesModule");
|
|
8
8
|
const version_1 = require("./version");
|
|
9
|
-
async function syncProjectConfigurationAsync({ projectDir, exp, buildProfile,
|
|
9
|
+
async function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, targets, }) {
|
|
10
10
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
11
11
|
const { autoIncrement } = buildProfile;
|
|
12
12
|
const versionBumpStrategy = resolveVersionBumpStrategy(autoIncrement !== null && autoIncrement !== void 0 ? autoIncrement : false);
|
|
@@ -14,7 +14,7 @@ async function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, bu
|
|
|
14
14
|
if ((0, projectUtils_1.isExpoUpdatesInstalled)(projectDir)) {
|
|
15
15
|
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp);
|
|
16
16
|
}
|
|
17
|
-
await (0, version_1.bumpVersionAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy,
|
|
17
|
+
await (0, version_1.bumpVersionAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy, targets });
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
await (0, version_1.bumpVersionInAppJsonAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy });
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
2
|
import type { XCBuildConfiguration } from 'xcode';
|
|
3
|
+
import { Target } from '../../credentials/ios/types';
|
|
3
4
|
export declare enum BumpStrategy {
|
|
4
5
|
APP_VERSION = 0,
|
|
5
6
|
BUILD_NUMBER = 1,
|
|
6
7
|
NOOP = 2
|
|
7
8
|
}
|
|
8
|
-
export declare function bumpVersionAsync({ bumpStrategy, projectDir, exp,
|
|
9
|
+
export declare function bumpVersionAsync({ bumpStrategy, projectDir, exp, targets, }: {
|
|
9
10
|
projectDir: string;
|
|
10
11
|
exp: ExpoConfig;
|
|
11
12
|
bumpStrategy: BumpStrategy;
|
|
12
|
-
|
|
13
|
+
targets: Target[];
|
|
13
14
|
}): Promise<void>;
|
|
14
15
|
export declare function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }: {
|
|
15
16
|
bumpStrategy: BumpStrategy;
|
|
@@ -18,9 +19,15 @@ export declare function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, ex
|
|
|
18
19
|
}): Promise<void>;
|
|
19
20
|
export declare function readShortVersionAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings']): Promise<string | undefined>;
|
|
20
21
|
export declare function readBuildNumberAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings']): Promise<string | undefined>;
|
|
21
|
-
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig,
|
|
22
|
+
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig, targets: Target[]): Promise<{
|
|
22
23
|
appVersion?: string;
|
|
23
24
|
appBuildVersion?: string;
|
|
24
25
|
}>;
|
|
25
26
|
export declare function getInfoPlistPath(projectDir: string, buildSettings: XCBuildConfiguration['buildSettings']): string;
|
|
27
|
+
export declare function updateNativeVersionsAsync({ projectDir, version, buildNumber, targets, }: {
|
|
28
|
+
projectDir: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
buildNumber?: string;
|
|
31
|
+
targets: Target[];
|
|
32
|
+
}): Promise<void>;
|
|
26
33
|
export declare function evaluateTemplateString(s: string, buildSettings: XCBuildConfiguration['buildSettings']): string;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.evaluateTemplateString = exports.getInfoPlistPath = exports.maybeResolveVersionsAsync = exports.readBuildNumberAsync = exports.readShortVersionAsync = exports.bumpVersionInAppJsonAsync = exports.bumpVersionAsync = exports.BumpStrategy = void 0;
|
|
3
|
+
exports.evaluateTemplateString = exports.updateNativeVersionsAsync = exports.getInfoPlistPath = exports.maybeResolveVersionsAsync = exports.readBuildNumberAsync = exports.readShortVersionAsync = exports.bumpVersionInAppJsonAsync = exports.bumpVersionAsync = exports.BumpStrategy = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const config_1 = require("@expo/config");
|
|
6
5
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
7
6
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
8
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
9
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
+
const target_1 = require("../../project/ios/target");
|
|
11
|
+
const versions_1 = require("../../project/ios/versions");
|
|
11
12
|
const workflow_1 = require("../../project/workflow");
|
|
12
13
|
const prompts_1 = require("../../prompts");
|
|
14
|
+
const uniqBy_1 = tslib_1.__importDefault(require("../../utils/expodash/uniqBy"));
|
|
13
15
|
const plist_1 = require("../../utils/plist");
|
|
14
16
|
const appJson_1 = require("../utils/appJson");
|
|
15
17
|
const version_1 = require("../utils/version");
|
|
@@ -19,15 +21,20 @@ var BumpStrategy;
|
|
|
19
21
|
BumpStrategy[BumpStrategy["BUILD_NUMBER"] = 1] = "BUILD_NUMBER";
|
|
20
22
|
BumpStrategy[BumpStrategy["NOOP"] = 2] = "NOOP";
|
|
21
23
|
})(BumpStrategy = exports.BumpStrategy || (exports.BumpStrategy = {}));
|
|
22
|
-
async function bumpVersionAsync({ bumpStrategy, projectDir, exp,
|
|
24
|
+
async function bumpVersionAsync({ bumpStrategy, projectDir, exp, targets, }) {
|
|
25
|
+
var _a;
|
|
23
26
|
if (bumpStrategy === BumpStrategy.NOOP) {
|
|
24
27
|
return;
|
|
25
28
|
}
|
|
26
|
-
ensureStaticConfigExists(projectDir);
|
|
27
|
-
const infoPlist = await readInfoPlistAsync(projectDir, buildSettings);
|
|
29
|
+
(0, version_1.ensureStaticConfigExists)(projectDir);
|
|
28
30
|
await bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp });
|
|
29
31
|
log_1.default.log('Updated versions in app.json');
|
|
30
|
-
await
|
|
32
|
+
await updateNativeVersionsAsync({
|
|
33
|
+
projectDir,
|
|
34
|
+
version: exp.version,
|
|
35
|
+
buildNumber: (_a = exp.ios) === null || _a === void 0 ? void 0 : _a.buildNumber,
|
|
36
|
+
targets,
|
|
37
|
+
});
|
|
31
38
|
log_1.default.log('Synchronized versions with Info.plist');
|
|
32
39
|
}
|
|
33
40
|
exports.bumpVersionAsync = bumpVersionAsync;
|
|
@@ -35,7 +42,7 @@ async function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }) {
|
|
|
35
42
|
if (bumpStrategy === BumpStrategy.NOOP) {
|
|
36
43
|
return;
|
|
37
44
|
}
|
|
38
|
-
ensureStaticConfigExists(projectDir);
|
|
45
|
+
(0, version_1.ensureStaticConfigExists)(projectDir);
|
|
39
46
|
log_1.default.addNewLineIfNone();
|
|
40
47
|
if (bumpStrategy === BumpStrategy.APP_VERSION) {
|
|
41
48
|
const appVersion = config_plugins_1.IOSConfig.Version.getVersion(exp);
|
|
@@ -43,10 +50,8 @@ async function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }) {
|
|
|
43
50
|
}
|
|
44
51
|
else {
|
|
45
52
|
const buildNumber = config_plugins_1.IOSConfig.Version.getBuildNumber(exp);
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
comps[comps.length - 1] = String(Number(comps[comps.length - 1]) + 1);
|
|
49
|
-
const bumpedBuildNumber = comps.join('.');
|
|
53
|
+
if ((0, versions_1.isValidBuildNumber)(buildNumber)) {
|
|
54
|
+
const bumpedBuildNumber = (0, versions_1.getNextBuildNumber)(buildNumber);
|
|
50
55
|
log_1.default.log(`Bumping ${chalk_1.default.bold('expo.ios.buildNumber')} from ${chalk_1.default.bold(buildNumber)} to ${chalk_1.default.bold(bumpedBuildNumber)}`);
|
|
51
56
|
await (0, appJson_1.updateAppJsonConfigAsync)({ projectDir, exp }, config => {
|
|
52
57
|
config.ios = { ...config.ios, buildNumber: String(bumpedBuildNumber) };
|
|
@@ -89,11 +94,13 @@ async function readBuildNumberAsync(projectDir, exp, buildSettings) {
|
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
96
|
exports.readBuildNumberAsync = readBuildNumberAsync;
|
|
92
|
-
async function maybeResolveVersionsAsync(projectDir, exp,
|
|
97
|
+
async function maybeResolveVersionsAsync(projectDir, exp, targets) {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
93
100
|
try {
|
|
94
101
|
return {
|
|
95
|
-
appBuildVersion: await readBuildNumberAsync(projectDir, exp, buildSettings),
|
|
96
|
-
appVersion: await readShortVersionAsync(projectDir, exp, buildSettings),
|
|
102
|
+
appBuildVersion: await readBuildNumberAsync(projectDir, exp, (_a = applicationTarget.buildSettings) !== null && _a !== void 0 ? _a : {}),
|
|
103
|
+
appVersion: await readShortVersionAsync(projectDir, exp, (_b = applicationTarget.buildSettings) !== null && _b !== void 0 ? _b : {}),
|
|
97
104
|
};
|
|
98
105
|
}
|
|
99
106
|
catch (err) {
|
|
@@ -105,12 +112,6 @@ async function maybeResolveVersionsAsync(projectDir, exp, buildSettings) {
|
|
|
105
112
|
}
|
|
106
113
|
}
|
|
107
114
|
exports.maybeResolveVersionsAsync = maybeResolveVersionsAsync;
|
|
108
|
-
async function writeVersionsToInfoPlistAsync({ projectDir, exp, infoPlist, buildSettings, }) {
|
|
109
|
-
let updatedInfoPlist = config_plugins_1.IOSConfig.Version.setVersion(exp, infoPlist);
|
|
110
|
-
updatedInfoPlist = config_plugins_1.IOSConfig.Version.setBuildNumber(exp, updatedInfoPlist);
|
|
111
|
-
await writeInfoPlistAsync({ projectDir, infoPlist: updatedInfoPlist, buildSettings });
|
|
112
|
-
return updatedInfoPlist;
|
|
113
|
-
}
|
|
114
115
|
function getInfoPlistPath(projectDir, buildSettings) {
|
|
115
116
|
if (buildSettings.INFOPLIST_FILE) {
|
|
116
117
|
const infoPlistFile = buildSettings.INFOPLIST_FILE.startsWith('"')
|
|
@@ -133,16 +134,44 @@ async function readInfoPlistAsync(projectDir, buildSettings) {
|
|
|
133
134
|
const infoPlistPath = getInfoPlistPath(projectDir, buildSettings);
|
|
134
135
|
return ((_a = (await (0, plist_1.readPlistAsync)(infoPlistPath))) !== null && _a !== void 0 ? _a : {});
|
|
135
136
|
}
|
|
136
|
-
async function
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
async function updateNativeVersionsAsync({ projectDir, version, buildNumber, targets, }) {
|
|
138
|
+
var _a;
|
|
139
|
+
const project = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(projectDir);
|
|
140
|
+
const iosDir = path_1.default.join(projectDir, 'ios');
|
|
141
|
+
const infoPlistFiles = [];
|
|
142
|
+
for (const target of targets) {
|
|
143
|
+
const { targetName, buildConfiguration } = target;
|
|
144
|
+
const xcBuildConfiguration = config_plugins_1.IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {
|
|
145
|
+
targetName,
|
|
146
|
+
buildConfiguration,
|
|
147
|
+
});
|
|
148
|
+
const infoPlist = (_a = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : xcBuildConfiguration.buildSettings) === null || _a === void 0 ? void 0 : _a.INFOPLIST_FILE;
|
|
149
|
+
if (infoPlist) {
|
|
150
|
+
const evaluatedInfoPlistPath = trimQuotes(evaluateTemplateString(infoPlist, {
|
|
151
|
+
SRCROOT: iosDir,
|
|
152
|
+
}));
|
|
153
|
+
const absolutePath = path_1.default.isAbsolute(evaluatedInfoPlistPath)
|
|
154
|
+
? evaluatedInfoPlistPath
|
|
155
|
+
: path_1.default.join(iosDir, evaluatedInfoPlistPath);
|
|
156
|
+
infoPlistFiles.push(path_1.default.normalize(absolutePath));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const uniqueInfoPlistPaths = (0, uniqBy_1.default)(infoPlistFiles, i => i);
|
|
160
|
+
for (const infoPlistPath of uniqueInfoPlistPaths) {
|
|
161
|
+
const infoPlist = (await (0, plist_1.readPlistAsync)(infoPlistPath));
|
|
162
|
+
if (buildNumber) {
|
|
163
|
+
infoPlist.CFBundleVersion = buildNumber;
|
|
164
|
+
}
|
|
165
|
+
if (version) {
|
|
166
|
+
infoPlist.CFBundleShortVersionString = version;
|
|
167
|
+
}
|
|
168
|
+
await (0, plist_1.writePlistAsync)(infoPlistPath, infoPlist);
|
|
144
169
|
}
|
|
145
170
|
}
|
|
171
|
+
exports.updateNativeVersionsAsync = updateNativeVersionsAsync;
|
|
172
|
+
function trimQuotes(s) {
|
|
173
|
+
return (s === null || s === void 0 ? void 0 : s.startsWith('"')) && s.endsWith('"') ? s.slice(1, -1) : s;
|
|
174
|
+
}
|
|
146
175
|
function evaluateTemplateString(s, buildSettings) {
|
|
147
176
|
// necessary because XCBuildConfiguration['buildSettings'] is not a plain object
|
|
148
177
|
const vars = { ...buildSettings };
|
package/build/build/metadata.js
CHANGED
|
@@ -48,7 +48,7 @@ exports.collectMetadataAsync = collectMetadataAsync;
|
|
|
48
48
|
async function maybeResolveVersionsAsync(ctx) {
|
|
49
49
|
if (ctx.platform === eas_build_job_1.Platform.IOS) {
|
|
50
50
|
const iosContext = ctx;
|
|
51
|
-
return await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, iosContext.ios.
|
|
51
|
+
return await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, iosContext.ios.targets);
|
|
52
52
|
}
|
|
53
53
|
else if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
|
|
54
54
|
const androidCtx = ctx;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RequestedPlatform } from '../platform';
|
|
2
2
|
import { LocalBuildOptions } from './local';
|
|
3
|
+
import { UserInputResourceClass } from './types';
|
|
3
4
|
export interface BuildFlags {
|
|
4
5
|
requestedPlatform: RequestedPlatform;
|
|
5
6
|
profile?: string;
|
|
@@ -10,5 +11,6 @@ export interface BuildFlags {
|
|
|
10
11
|
autoSubmit: boolean;
|
|
11
12
|
submitProfile?: string;
|
|
12
13
|
localBuildOptions: LocalBuildOptions;
|
|
14
|
+
userInputResourceClass?: UserInputResourceClass;
|
|
13
15
|
}
|
|
14
16
|
export declare function runBuildAndSubmitAsync(projectDir: string, flags: BuildFlags): Promise<void>;
|
|
@@ -23,13 +23,24 @@ const build_2 = require("./build");
|
|
|
23
23
|
const configure_1 = require("./configure");
|
|
24
24
|
const createContext_1 = require("./createContext");
|
|
25
25
|
const build_3 = require("./ios/build");
|
|
26
|
+
const types_1 = require("./types");
|
|
26
27
|
const devClient_1 = require("./utils/devClient");
|
|
27
28
|
const printBuildInfo_1 = require("./utils/printBuildInfo");
|
|
28
29
|
const repository_1 = require("./utils/repository");
|
|
29
30
|
let metroConfigValidated = false;
|
|
30
31
|
let sdkVersionChecked = false;
|
|
32
|
+
const platformToGraphQLResourceClassMapping = {
|
|
33
|
+
[eas_build_job_1.Platform.ANDROID]: {
|
|
34
|
+
[types_1.UserInputResourceClass.DEFAULT]: generated_1.BuildResourceClass.AndroidDefault,
|
|
35
|
+
[types_1.UserInputResourceClass.LARGE]: generated_1.BuildResourceClass.AndroidLarge,
|
|
36
|
+
},
|
|
37
|
+
[eas_build_job_1.Platform.IOS]: {
|
|
38
|
+
[types_1.UserInputResourceClass.DEFAULT]: generated_1.BuildResourceClass.IosDefault,
|
|
39
|
+
[types_1.UserInputResourceClass.LARGE]: generated_1.BuildResourceClass.IosLarge,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
31
42
|
async function runBuildAndSubmitAsync(projectDir, flags) {
|
|
32
|
-
var _a;
|
|
43
|
+
var _a, _b, _c;
|
|
33
44
|
await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
|
|
34
45
|
await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
|
|
35
46
|
await (0, configure_1.ensureProjectConfiguredAsync)({
|
|
@@ -37,12 +48,13 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
|
|
|
37
48
|
nonInteractive: flags.nonInteractive,
|
|
38
49
|
});
|
|
39
50
|
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
51
|
+
const easJsonCliConfig = (_a = (await easJsonReader.getCliConfigAsync())) !== null && _a !== void 0 ? _a : {};
|
|
40
52
|
const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
|
|
41
53
|
const buildProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
42
54
|
type: 'build',
|
|
43
55
|
easJsonReader,
|
|
44
56
|
platforms,
|
|
45
|
-
profileName: (
|
|
57
|
+
profileName: (_b = flags.profile) !== null && _b !== void 0 ? _b : undefined,
|
|
46
58
|
});
|
|
47
59
|
await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
|
|
48
60
|
projectDir,
|
|
@@ -57,6 +69,8 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
|
|
|
57
69
|
flags,
|
|
58
70
|
moreBuilds: platforms.length > 1,
|
|
59
71
|
buildProfile,
|
|
72
|
+
resourceClass: platformToGraphQLResourceClassMapping[buildProfile.platform][(_c = flags.userInputResourceClass) !== null && _c !== void 0 ? _c : types_1.UserInputResourceClass.DEFAULT],
|
|
73
|
+
easJsonCliConfig,
|
|
60
74
|
});
|
|
61
75
|
if (maybeBuild) {
|
|
62
76
|
startedBuilds.push({ build: maybeBuild, buildProfile });
|
|
@@ -116,15 +130,17 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
|
|
|
116
130
|
}
|
|
117
131
|
}
|
|
118
132
|
exports.runBuildAndSubmitAsync = runBuildAndSubmitAsync;
|
|
119
|
-
async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, }) {
|
|
133
|
+
async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, resourceClass, easJsonCliConfig, }) {
|
|
120
134
|
const buildCtx = await (0, createContext_1.createBuildContextAsync)({
|
|
121
135
|
buildProfileName: buildProfile.profileName,
|
|
136
|
+
resourceClass,
|
|
122
137
|
clearCache: flags.clearCache,
|
|
123
138
|
buildProfile: buildProfile.profile,
|
|
124
139
|
nonInteractive: flags.nonInteractive,
|
|
125
140
|
platform: buildProfile.platform,
|
|
126
141
|
projectDir,
|
|
127
142
|
localBuildOptions: flags.localBuildOptions,
|
|
143
|
+
easJsonCliConfig,
|
|
128
144
|
});
|
|
129
145
|
if (moreBuilds) {
|
|
130
146
|
log_1.default.newLine();
|
package/build/build/types.d.ts
CHANGED
package/build/build/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BuildDistributionType = exports.BuildStatus = void 0;
|
|
3
|
+
exports.UserInputResourceClass = exports.BuildDistributionType = exports.BuildStatus = void 0;
|
|
4
4
|
var BuildStatus;
|
|
5
5
|
(function (BuildStatus) {
|
|
6
6
|
BuildStatus["NEW"] = "new";
|
|
@@ -16,3 +16,8 @@ var BuildDistributionType;
|
|
|
16
16
|
BuildDistributionType["INTERNAL"] = "internal";
|
|
17
17
|
BuildDistributionType["SIMULATOR"] = "simulator";
|
|
18
18
|
})(BuildDistributionType = exports.BuildDistributionType || (exports.BuildDistributionType = {}));
|
|
19
|
+
var UserInputResourceClass;
|
|
20
|
+
(function (UserInputResourceClass) {
|
|
21
|
+
UserInputResourceClass["DEFAULT"] = "default";
|
|
22
|
+
UserInputResourceClass["LARGE"] = "large";
|
|
23
|
+
})(UserInputResourceClass = exports.UserInputResourceClass || (exports.UserInputResourceClass = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserInputResourceClass } from '../../build/types';
|
|
1
2
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
3
|
export default class Build extends EasCommand {
|
|
3
4
|
static description: string;
|
|
@@ -14,6 +15,7 @@ export default class Build extends EasCommand {
|
|
|
14
15
|
'clear-cache': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
'auto-submit': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
'auto-submit-with-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
18
|
+
'resource-class': import("@oclif/core/lib/interfaces").OptionFlag<UserInputResourceClass>;
|
|
17
19
|
};
|
|
18
20
|
runAsync(): Promise<void>;
|
|
19
21
|
private sanitizeFlagsAsync;
|
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
|
|
7
|
+
const types_1 = require("../../build/types");
|
|
7
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
8
9
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
9
10
|
const platform_1 = require("../../platform");
|
|
@@ -20,7 +21,7 @@ class Build extends EasCommand_1.default {
|
|
|
20
21
|
await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, flags);
|
|
21
22
|
}
|
|
22
23
|
async sanitizeFlagsAsync(flags) {
|
|
23
|
-
var _a;
|
|
24
|
+
var _a, _b;
|
|
24
25
|
const nonInteractive = flags['non-interactive'];
|
|
25
26
|
if (!flags.local && flags.output) {
|
|
26
27
|
core_1.Errors.error('--output is allowed only for local builds', { exit: 1 });
|
|
@@ -73,6 +74,7 @@ class Build extends EasCommand_1.default {
|
|
|
73
74
|
json: flags['json'],
|
|
74
75
|
autoSubmit: flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined,
|
|
75
76
|
submitProfile: (_a = flags['auto-submit-with-profile']) !== null && _a !== void 0 ? _a : profile,
|
|
77
|
+
userInputResourceClass: (_b = flags['resource-class']) !== null && _b !== void 0 ? _b : types_1.UserInputResourceClass.DEFAULT,
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
}
|
|
@@ -129,4 +131,9 @@ Build.flags = {
|
|
|
129
131
|
helpValue: 'PROFILE_NAME',
|
|
130
132
|
exclusive: ['auto-submit'],
|
|
131
133
|
}),
|
|
134
|
+
'resource-class': core_1.Flags.enum({
|
|
135
|
+
options: Object.values(types_1.UserInputResourceClass),
|
|
136
|
+
hidden: true,
|
|
137
|
+
description: 'The instance type that will be used to run this build [experimental]',
|
|
138
|
+
}),
|
|
132
139
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import EasCommand from '../../../commandUtils/EasCommand';
|
|
2
|
+
export default class BuildVersionSetView extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static hidden: boolean;
|
|
5
|
+
static flags: {
|
|
6
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
+
};
|
|
9
|
+
runAsync(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Updates_1 = require("@expo/config-plugins/build/utils/Updates");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
+
const eas_json_1 = require("@expo/eas-json");
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
10
|
+
const AppVersionMutation_1 = require("../../../graphql/mutations/AppVersionMutation");
|
|
11
|
+
const AppVersionQuery_1 = require("../../../graphql/queries/AppVersionQuery");
|
|
12
|
+
const AppPlatform_1 = require("../../../graphql/types/AppPlatform");
|
|
13
|
+
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
14
|
+
const platform_1 = require("../../../platform");
|
|
15
|
+
const versions_1 = require("../../../project/android/versions");
|
|
16
|
+
const applicationIdentifier_1 = require("../../../project/applicationIdentifier");
|
|
17
|
+
const expoConfig_1 = require("../../../project/expoConfig");
|
|
18
|
+
const versions_2 = require("../../../project/ios/versions");
|
|
19
|
+
const projectUtils_1 = require("../../../project/projectUtils");
|
|
20
|
+
const remoteVersionSource_1 = require("../../../project/remoteVersionSource");
|
|
21
|
+
const prompts_1 = require("../../../prompts");
|
|
22
|
+
class BuildVersionSetView extends EasCommand_1.default {
|
|
23
|
+
async runAsync() {
|
|
24
|
+
var _a, _b, _c;
|
|
25
|
+
const { flags } = await this.parse(BuildVersionSetView);
|
|
26
|
+
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
27
|
+
const platform = await (0, platform_1.selectPlatformAsync)(flags.platform);
|
|
28
|
+
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
29
|
+
await (0, remoteVersionSource_1.ensureRemoteVersionPolicyAsync)(projectDir, easJsonReader);
|
|
30
|
+
const profile = await easJsonReader.getBuildProfileAsync(platform, (_a = flags.profile) !== null && _a !== void 0 ? _a : undefined);
|
|
31
|
+
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: profile.env });
|
|
32
|
+
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
33
|
+
const projectFullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
|
|
34
|
+
await (0, remoteVersionSource_1.validateAppConfigForRemoteVersionPolicyAsync)(exp);
|
|
35
|
+
const applicationIdentifier = await (0, applicationIdentifier_1.getApplicationIdentifierAsync)(projectDir, exp, profile, platform);
|
|
36
|
+
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(projectId, (0, AppPlatform_1.toAppPlatform)(platform), applicationIdentifier);
|
|
37
|
+
const currentStateMessage = (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion)
|
|
38
|
+
? `Project ${chalk_1.default.bold(projectFullName)} with ${getApplicationIdentifierName(platform)} "${applicationIdentifier}" is configured with ${(0, remoteVersionSource_1.getBuildVersionName)(platform)} ${remoteVersions.buildVersion}.`
|
|
39
|
+
: `Project ${chalk_1.default.bold(projectFullName)} with ${getApplicationIdentifierName(platform)} "${applicationIdentifier}" does not have any ${(0, remoteVersionSource_1.getBuildVersionName)(platform)} configured.`;
|
|
40
|
+
const versionPromptMessage = (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion)
|
|
41
|
+
? `What version would you like to set?`
|
|
42
|
+
: `What version would you like to initialize it with?`;
|
|
43
|
+
log_1.default.log(currentStateMessage);
|
|
44
|
+
const { version } = await (0, prompts_1.promptAsync)({
|
|
45
|
+
type: platform === eas_build_job_1.Platform.ANDROID ? 'number' : 'text',
|
|
46
|
+
name: 'version',
|
|
47
|
+
message: versionPromptMessage,
|
|
48
|
+
validate: platform === eas_build_job_1.Platform.ANDROID
|
|
49
|
+
? value => (0, versions_1.isValidVersionCode)(value) || `Invalid value: ${versions_1.VERSION_CODE_REQUIREMENTS}.`
|
|
50
|
+
: value => (0, versions_2.isValidBuildNumber)(value) || `Invalid value: ${versions_2.BUILD_NUMBER_REQUIREMENTS}.`,
|
|
51
|
+
});
|
|
52
|
+
await AppVersionMutation_1.AppVersionMutation.createAppVersionAsync({
|
|
53
|
+
appId: projectId,
|
|
54
|
+
platform: (0, AppPlatform_1.toAppPlatform)(platform),
|
|
55
|
+
applicationIdentifier,
|
|
56
|
+
storeVersion: (_b = exp.version) !== null && _b !== void 0 ? _b : '1.0.0',
|
|
57
|
+
buildVersion: String(version),
|
|
58
|
+
runtimeVersion: (_c = (0, Updates_1.getRuntimeVersionNullable)(exp, platform)) !== null && _c !== void 0 ? _c : undefined,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = BuildVersionSetView;
|
|
63
|
+
BuildVersionSetView.description = 'Update version of an app.';
|
|
64
|
+
BuildVersionSetView.hidden = true;
|
|
65
|
+
BuildVersionSetView.flags = {
|
|
66
|
+
platform: core_1.Flags.enum({
|
|
67
|
+
char: 'p',
|
|
68
|
+
options: ['android', 'ios'],
|
|
69
|
+
}),
|
|
70
|
+
profile: core_1.Flags.string({
|
|
71
|
+
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
72
|
+
helpValue: 'PROFILE_NAME',
|
|
73
|
+
}),
|
|
74
|
+
};
|
|
75
|
+
function getApplicationIdentifierName(platform) {
|
|
76
|
+
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
77
|
+
return 'application ID';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return 'bundle identifier';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import EasCommand from '../../../commandUtils/EasCommand';
|
|
2
|
+
export default class BuildVersionSyncView extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static hidden: boolean;
|
|
5
|
+
static flags: {
|
|
6
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
+
};
|
|
9
|
+
runAsync(): Promise<void>;
|
|
10
|
+
private syncIosAsync;
|
|
11
|
+
private syncAndroidAsync;
|
|
12
|
+
}
|