eas-cli 5.4.0 → 5.5.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 +103 -55
- package/build/branch/utils.d.ts +2 -1
- package/build/branch/utils.js +2 -4
- package/build/build/android/build.js +5 -3
- package/build/build/android/prepareJob.js +1 -2
- package/build/build/android/syncProjectConfiguration.d.ts +3 -1
- package/build/build/android/syncProjectConfiguration.js +2 -2
- package/build/build/android/version.d.ts +4 -2
- package/build/build/android/version.js +4 -4
- package/build/build/build.d.ts +1 -3
- package/build/build/build.js +7 -58
- package/build/build/configure.d.ts +2 -0
- package/build/build/configure.js +9 -10
- package/build/build/context.d.ts +4 -0
- package/build/build/createContext.d.ts +3 -1
- package/build/build/createContext.js +7 -2
- package/build/build/ios/build.js +4 -0
- package/build/build/ios/prepareJob.js +1 -2
- package/build/build/ios/syncProjectConfiguration.d.ts +3 -1
- package/build/build/ios/syncProjectConfiguration.js +3 -3
- package/build/build/ios/version.d.ts +6 -4
- package/build/build/ios/version.js +10 -10
- package/build/build/metadata.js +7 -8
- package/build/build/runBuildAndSubmit.d.ts +2 -1
- package/build/build/runBuildAndSubmit.js +12 -8
- package/build/build/utils/devClient.d.ts +3 -1
- package/build/build/utils/devClient.js +6 -7
- package/build/build/utils/repository.d.ts +6 -5
- package/build/build/utils/repository.js +14 -15
- package/build/build/utils/resourceClass.js +3 -12
- package/build/build/validate.js +2 -3
- package/build/commandUtils/EasCommand.d.ts +4 -0
- package/build/commandUtils/EasCommand.js +4 -0
- package/build/commandUtils/context/VcsClientContextField.d.ts +5 -0
- package/build/commandUtils/context/VcsClientContextField.js +11 -0
- package/build/commands/branch/create.d.ts +1 -0
- package/build/commands/branch/create.js +3 -2
- package/build/commands/build/cancel.d.ts +1 -0
- package/build/commands/build/cancel.js +1 -0
- package/build/commands/build/configure.d.ts +1 -0
- package/build/commands/build/configure.js +8 -6
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/index.js +3 -2
- package/build/commands/build/inspect.d.ts +1 -0
- package/build/commands/build/inspect.js +5 -6
- package/build/commands/build/internal.d.ts +1 -0
- package/build/commands/build/internal.js +3 -2
- package/build/commands/build/list.d.ts +1 -0
- package/build/commands/build/list.js +1 -0
- package/build/commands/build/resign.d.ts +1 -0
- package/build/commands/build/resign.js +5 -3
- package/build/commands/build/run.d.ts +1 -0
- package/build/commands/build/run.js +1 -0
- package/build/commands/build/version/get.d.ts +1 -0
- package/build/commands/build/version/get.js +3 -1
- package/build/commands/build/version/set.d.ts +1 -0
- package/build/commands/build/version/set.js +3 -1
- package/build/commands/build/version/sync.d.ts +1 -0
- package/build/commands/build/version/sync.js +9 -4
- package/build/commands/build/view.d.ts +1 -0
- package/build/commands/build/view.js +1 -0
- package/build/commands/credentials.d.ts +1 -0
- package/build/commands/credentials.js +3 -2
- package/build/commands/diagnostics.d.ts +1 -0
- package/build/commands/diagnostics.js +6 -5
- package/build/commands/metadata/pull.d.ts +1 -0
- package/build/commands/metadata/pull.js +4 -2
- package/build/commands/metadata/push.d.ts +1 -0
- package/build/commands/metadata/push.js +4 -2
- package/build/commands/project/init.d.ts +1 -0
- package/build/commands/project/init.js +43 -11
- package/build/commands/submit.d.ts +1 -0
- package/build/commands/submit.js +3 -1
- package/build/commands/update/configure.d.ts +1 -0
- package/build/commands/update/configure.js +4 -3
- package/build/commands/update/index.d.ts +1 -0
- package/build/commands/update/index.js +17 -11
- package/build/commands/update/roll-back-to-embedded.d.ts +1 -1
- package/build/commands/update/roll-back-to-embedded.js +8 -6
- package/build/commands/update/rollback.d.ts +0 -1
- package/build/commands/update/rollback.js +0 -1
- package/build/credentials/android/actions/BuildCredentialsUtils.js +1 -1
- package/build/credentials/android/api/GraphqlClient.js +0 -1
- package/build/credentials/context.d.ts +3 -0
- package/build/credentials/context.js +1 -0
- package/build/credentials/credentialsJson/update.js +6 -8
- package/build/credentials/ios/actions/DeviceUtils.js +1 -1
- package/build/credentials/manager/HelperActions.d.ts +2 -0
- package/build/credentials/manager/ManageAndroid.js +2 -1
- package/build/credentials/manager/ManageIos.js +3 -0
- package/build/credentials/manager/SelectPlatform.d.ts +3 -1
- package/build/credentials/manager/SelectPlatform.js +2 -1
- package/build/graphql/generated.d.ts +457 -4
- package/build/graphql/generated.js +7 -2
- package/build/graphql/types/Account.js +4 -0
- package/build/graphql/types/credentials/AppleDevice.js +1 -0
- package/build/metadata/auth.js +4 -4
- package/build/project/android/applicationId.d.ts +4 -2
- package/build/project/android/applicationId.js +5 -5
- package/build/project/android/gradle.d.ts +2 -1
- package/build/project/android/gradle.js +2 -2
- package/build/project/applicationIdentifier.d.ts +3 -1
- package/build/project/applicationIdentifier.js +10 -7
- package/build/project/ios/bundleIdentifier.d.ts +4 -2
- package/build/project/ios/bundleIdentifier.js +5 -5
- package/build/project/ios/entitlements.d.ts +2 -1
- package/build/project/ios/entitlements.js +2 -2
- package/build/project/ios/scheme.d.ts +3 -1
- package/build/project/ios/scheme.js +2 -2
- package/build/project/ios/target.d.ts +4 -2
- package/build/project/ios/target.js +10 -8
- package/build/project/projectUtils.d.ts +1 -0
- package/build/project/projectUtils.js +12 -1
- package/build/project/publish.d.ts +6 -4
- package/build/project/publish.js +10 -11
- package/build/project/workflow.d.ts +4 -3
- package/build/project/workflow.js +5 -8
- package/build/submit/android/AndroidSubmitCommand.js +1 -1
- package/build/submit/context.d.ts +3 -0
- package/build/submit/context.js +2 -1
- package/build/submit/ios/AppProduce.js +1 -1
- package/build/submit/ios/AscApiKeySource.js +1 -1
- package/build/update/configure.d.ts +3 -1
- package/build/update/configure.js +5 -5
- package/build/update/ios/UpdatesModule.d.ts +2 -1
- package/build/update/ios/UpdatesModule.js +4 -5
- package/build/uploads.d.ts +1 -1
- package/build/uploads.js +2 -1
- package/oclif.manifest.json +1 -1
- package/package.json +6 -6
|
@@ -2,6 +2,7 @@ import { ExpoConfig } from '@expo/config';
|
|
|
2
2
|
import { Platform } from '@expo/eas-build-job';
|
|
3
3
|
import { BuildProfile } from '@expo/eas-json';
|
|
4
4
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
5
|
+
import { Client } from '../../vcs/vcs';
|
|
5
6
|
export declare enum BumpStrategy {
|
|
6
7
|
APP_VERSION = 0,
|
|
7
8
|
VERSION_CODE = 1,
|
|
@@ -17,7 +18,7 @@ export declare function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, ex
|
|
|
17
18
|
projectDir: string;
|
|
18
19
|
exp: ExpoConfig;
|
|
19
20
|
}): Promise<void>;
|
|
20
|
-
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig, buildProfile: BuildProfile<Platform.ANDROID
|
|
21
|
+
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig, buildProfile: BuildProfile<Platform.ANDROID>, vcsClient: Client): Promise<{
|
|
21
22
|
appVersion?: string;
|
|
22
23
|
appBuildVersion?: string;
|
|
23
24
|
}>;
|
|
@@ -30,10 +31,11 @@ export declare function updateNativeVersionsAsync({ projectDir, version, version
|
|
|
30
31
|
* Returns buildNumber that will be used for the next build. If current build profile
|
|
31
32
|
* has an 'autoIncrement' option set, it increments the version on server.
|
|
32
33
|
*/
|
|
33
|
-
export declare function resolveRemoteVersionCodeAsync(graphqlClient: ExpoGraphqlClient, { projectDir, projectId, exp, applicationId, buildProfile, }: {
|
|
34
|
+
export declare function resolveRemoteVersionCodeAsync(graphqlClient: ExpoGraphqlClient, { projectDir, projectId, exp, applicationId, buildProfile, vcsClient, }: {
|
|
34
35
|
projectDir: string;
|
|
35
36
|
projectId: string;
|
|
36
37
|
exp: ExpoConfig;
|
|
37
38
|
applicationId: string;
|
|
38
39
|
buildProfile: BuildProfile<Platform.ANDROID>;
|
|
40
|
+
vcsClient: Client;
|
|
39
41
|
}): Promise<string>;
|
|
@@ -64,9 +64,9 @@ async function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
exports.bumpVersionInAppJsonAsync = bumpVersionInAppJsonAsync;
|
|
67
|
-
async function maybeResolveVersionsAsync(projectDir, exp, buildProfile) {
|
|
67
|
+
async function maybeResolveVersionsAsync(projectDir, exp, buildProfile, vcsClient) {
|
|
68
68
|
var _a, _b;
|
|
69
|
-
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
|
|
69
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient);
|
|
70
70
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
71
71
|
const buildGradle = await (0, gradleUtils_1.getAppBuildGradleAsync)(projectDir);
|
|
72
72
|
try {
|
|
@@ -120,10 +120,10 @@ async function writeBuildGradleAsync({ projectDir, buildGradle, }) {
|
|
|
120
120
|
* Returns buildNumber that will be used for the next build. If current build profile
|
|
121
121
|
* has an 'autoIncrement' option set, it increments the version on server.
|
|
122
122
|
*/
|
|
123
|
-
async function resolveRemoteVersionCodeAsync(graphqlClient, { projectDir, projectId, exp, applicationId, buildProfile, }) {
|
|
123
|
+
async function resolveRemoteVersionCodeAsync(graphqlClient, { projectDir, projectId, exp, applicationId, buildProfile, vcsClient, }) {
|
|
124
124
|
var _a, _b, _c, _d, _e, _f;
|
|
125
125
|
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, generated_1.AppPlatform.Android, applicationId);
|
|
126
|
-
const localVersions = await maybeResolveVersionsAsync(projectDir, exp, buildProfile);
|
|
126
|
+
const localVersions = await maybeResolveVersionsAsync(projectDir, exp, buildProfile, vcsClient);
|
|
127
127
|
let currentBuildVersion;
|
|
128
128
|
if (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion) {
|
|
129
129
|
currentBuildVersion = remoteVersions.buildVersion;
|
package/build/build/build.d.ts
CHANGED
|
@@ -23,11 +23,9 @@ export type BuildRequestSender = () => Promise<BuildFragment | undefined>;
|
|
|
23
23
|
export declare function prepareBuildRequestForPlatformAsync<TPlatform extends Platform, Credentials, TJob extends Job>(builder: Builder<TPlatform, Credentials, TJob>): Promise<BuildRequestSender>;
|
|
24
24
|
export declare function handleBuildRequestError(error: any, platform: Platform): never;
|
|
25
25
|
export type MaybeBuildFragment = BuildFragment | null;
|
|
26
|
-
export declare function waitForBuildEndAsync(graphqlClient: ExpoGraphqlClient, { buildIds, accountName
|
|
26
|
+
export declare function waitForBuildEndAsync(graphqlClient: ExpoGraphqlClient, { buildIds, accountName }: {
|
|
27
27
|
buildIds: string[];
|
|
28
28
|
accountName: string;
|
|
29
|
-
projectDir: string;
|
|
30
|
-
nonInteractive: boolean;
|
|
31
29
|
}, { intervalSec }?: {
|
|
32
30
|
intervalSec?: number | undefined;
|
|
33
31
|
}): Promise<MaybeBuildFragment[]>;
|
package/build/build/build.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.waitForBuildEndAsync = exports.handleBuildRequestError = exports.prepareBuildRequestForPlatformAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
-
const eas_json_1 = require("@expo/eas-json");
|
|
7
6
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
8
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
8
|
const cli_progress_1 = tslib_1.__importDefault(require("cli-progress"));
|
|
@@ -18,13 +17,11 @@ const BuildQuery_1 = require("../graphql/queries/BuildQuery");
|
|
|
18
17
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
19
18
|
const ora_1 = require("../ora");
|
|
20
19
|
const platform_1 = require("../platform");
|
|
21
|
-
const prompts_1 = require("../prompts");
|
|
22
20
|
const uploads_1 = require("../uploads");
|
|
23
21
|
const files_1 = require("../utils/files");
|
|
24
22
|
const json_1 = require("../utils/json");
|
|
25
23
|
const progress_1 = require("../utils/progress");
|
|
26
24
|
const promise_1 = require("../utils/promise");
|
|
27
|
-
const vcs_1 = require("../vcs");
|
|
28
25
|
const errors_1 = require("./errors");
|
|
29
26
|
const graphql_1 = require("./graphql");
|
|
30
27
|
const local_1 = require("./local");
|
|
@@ -52,15 +49,15 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
52
49
|
failureEvent: AnalyticsManager_1.BuildEvent.CONFIGURE_PROJECT_FAIL,
|
|
53
50
|
properties: ctx.analyticsEventProperties,
|
|
54
51
|
});
|
|
55
|
-
if (await
|
|
52
|
+
if (await ctx.vcsClient.isCommitRequiredAsync()) {
|
|
56
53
|
log_1.default.addNewLineIfNone();
|
|
57
|
-
await (0, repository_1.reviewAndCommitChangesAsync)(`[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[ctx.platform]}`, { nonInteractive: ctx.nonInteractive });
|
|
54
|
+
await (0, repository_1.reviewAndCommitChangesAsync)(ctx.vcsClient, `[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[ctx.platform]}`, { nonInteractive: ctx.nonInteractive });
|
|
58
55
|
}
|
|
59
56
|
let projectArchive;
|
|
60
57
|
if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
|
|
61
58
|
projectArchive = {
|
|
62
59
|
type: eas_build_job_1.ArchiveSourceType.PATH,
|
|
63
|
-
path: (await (0, repository_1.makeProjectTarballAsync)()).path,
|
|
60
|
+
path: (await (0, repository_1.makeProjectTarballAsync)(ctx.vcsClient)).path,
|
|
64
61
|
};
|
|
65
62
|
}
|
|
66
63
|
else if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.INTERNAL) {
|
|
@@ -158,7 +155,7 @@ async function uploadProjectAsync(ctx) {
|
|
|
158
155
|
return await (0, common_1.withAnalyticsAsync)(ctx.analytics, async () => {
|
|
159
156
|
log_1.default.newLine();
|
|
160
157
|
log_1.default.log(`Compressing project files and uploading to EAS Build. ${(0, log_1.learnMore)('https://expo.fyi/eas-build-archive')}`);
|
|
161
|
-
const projectTarball = await (0, repository_1.makeProjectTarballAsync)();
|
|
158
|
+
const projectTarball = await (0, repository_1.makeProjectTarballAsync)(ctx.vcsClient);
|
|
162
159
|
if (projectTarball.size > 1024 * 1024 * 100) {
|
|
163
160
|
log_1.default.warn(`Your project archive is ${(0, files_1.formatBytes)(projectTarball.size)}. You can reduce its size and the time it takes to upload by excluding files that are unnecessary for the build process in ${chalk_1.default.bold('.easignore')} file. ${(0, log_1.learnMore)('https://expo.fyi/eas-build-archive')}`);
|
|
164
161
|
}
|
|
@@ -208,7 +205,7 @@ async function sendBuildRequestAsync(builder, job, metadata, buildParams) {
|
|
|
208
205
|
properties: ctx.analyticsEventProperties,
|
|
209
206
|
});
|
|
210
207
|
}
|
|
211
|
-
async function waitForBuildEndAsync(graphqlClient, { buildIds, accountName
|
|
208
|
+
async function waitForBuildEndAsync(graphqlClient, { buildIds, accountName }, { intervalSec = 10 } = {}) {
|
|
212
209
|
let spinner;
|
|
213
210
|
let originalSpinnerText;
|
|
214
211
|
if (buildIds.length === 1) {
|
|
@@ -223,7 +220,7 @@ async function waitForBuildEndAsync(graphqlClient, { buildIds, accountName, proj
|
|
|
223
220
|
while (true) {
|
|
224
221
|
const builds = await getBuildsSafelyAsync(graphqlClient, buildIds);
|
|
225
222
|
const { refetch } = builds.length === 1
|
|
226
|
-
? await handleSingleBuildProgressAsync({ build: builds[0], accountName
|
|
223
|
+
? await handleSingleBuildProgressAsync({ build: builds[0], accountName }, { spinner })
|
|
227
224
|
: await handleMultipleBuildsProgressAsync({ builds }, { spinner, originalSpinnerText });
|
|
228
225
|
if (!refetch) {
|
|
229
226
|
return builds;
|
|
@@ -246,7 +243,7 @@ async function getBuildsSafelyAsync(graphqlClient, buildIds) {
|
|
|
246
243
|
}
|
|
247
244
|
let queueProgressBarStarted = false;
|
|
248
245
|
const queueProgressBar = new cli_progress_1.default.SingleBar({ format: '|{bar}| {estimatedWaitTime}' }, cli_progress_1.default.Presets.rect);
|
|
249
|
-
async function handleSingleBuildProgressAsync({ build, accountName,
|
|
246
|
+
async function handleSingleBuildProgressAsync({ build, accountName, }, { spinner }) {
|
|
250
247
|
if (build === null) {
|
|
251
248
|
spinner.text = 'Could not fetch the build status. Check your network connection.';
|
|
252
249
|
return { refetch: true };
|
|
@@ -284,38 +281,6 @@ async function handleSingleBuildProgressAsync({ build, accountName, projectDir,
|
|
|
284
281
|
log_1.default.log('Start builds sooner in the priority queue.');
|
|
285
282
|
log_1.default.log(`Sign up for EAS Production or Enterprise at ${(0, log_1.link)(formatAccountSubscriptionsUrl(accountName))}`);
|
|
286
283
|
}
|
|
287
|
-
if (build.platform === generated_1.AppPlatform.Ios &&
|
|
288
|
-
[generated_1.BuildResourceClass.IosIntelLarge, generated_1.BuildResourceClass.IosIntelMedium].includes(build.resourceClass)) {
|
|
289
|
-
let askToSwitchToM1 = false;
|
|
290
|
-
if (build.priority === generated_1.BuildPriority.High &&
|
|
291
|
-
build.estimatedWaitTimeLeftSeconds >= /* 10 minutes */ 10 * 60) {
|
|
292
|
-
log_1.default.newLine();
|
|
293
|
-
log_1.default.warn(`Warning: Priority queue wait time for legacy iOS Intel workers is longer than usual (more than 10 minutes).`);
|
|
294
|
-
log_1.default.warn(`We recommend switching to the new, faster M1 workers for iOS builds.`);
|
|
295
|
-
log_1.default.warn((0, log_1.learnMore)('https://blog.expo.dev/m1-workers-on-eas-build-dcaa2c1333ad', {
|
|
296
|
-
learnMoreMessage: 'Learn more on switching to M1 workers.',
|
|
297
|
-
}));
|
|
298
|
-
askToSwitchToM1 = true;
|
|
299
|
-
}
|
|
300
|
-
else if (build.priority !== generated_1.BuildPriority.High &&
|
|
301
|
-
build.estimatedWaitTimeLeftSeconds >= /* 120 minutes */ 120 * 60) {
|
|
302
|
-
log_1.default.newLine();
|
|
303
|
-
log_1.default.warn(`Warning: Free tier queue wait time for legacy iOS Intel workers is longer than usual.`);
|
|
304
|
-
log_1.default.warn(`We recommend switching to the new, faster M1 workers for iOS builds.`);
|
|
305
|
-
log_1.default.warn((0, log_1.learnMore)('https://blog.expo.dev/m1-workers-on-eas-build-dcaa2c1333ad', {
|
|
306
|
-
learnMoreMessage: 'Learn more on switching to M1 workers.',
|
|
307
|
-
}));
|
|
308
|
-
askToSwitchToM1 = true;
|
|
309
|
-
}
|
|
310
|
-
if (!nonInteractive && askToSwitchToM1) {
|
|
311
|
-
const shouldSwitchToM1 = await (0, prompts_1.confirmAsync)({
|
|
312
|
-
message: `Switch iOS builds to M1 workers (modifies build profiles in eas.json)?`,
|
|
313
|
-
});
|
|
314
|
-
if (shouldSwitchToM1) {
|
|
315
|
-
await updateIosBuildProfilesToUseM1WorkersAsync(projectDir);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
284
|
log_1.default.newLine();
|
|
320
285
|
log_1.default.log(`Waiting in ${priorityToQueueDisplayName[build.priority]}`);
|
|
321
286
|
queueProgressBar.start(build.initialQueuePosition + 1, build.initialQueuePosition - build.queuePosition + 1, progressBarPayload);
|
|
@@ -431,19 +396,3 @@ function formatEstimatedWaitTime(estimatedWaitTimeLeftSeconds) {
|
|
|
431
396
|
function formatAccountSubscriptionsUrl(accountName) {
|
|
432
397
|
return new URL(`/accounts/${accountName}/settings/subscriptions`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
|
|
433
398
|
}
|
|
434
|
-
async function updateIosBuildProfilesToUseM1WorkersAsync(projectDir) {
|
|
435
|
-
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
436
|
-
await easJsonAccessor.readRawJsonAsync();
|
|
437
|
-
const profileNames = await eas_json_1.EasJsonUtils.getBuildProfileNamesAsync(easJsonAccessor);
|
|
438
|
-
easJsonAccessor.patch(easJsonRawObject => {
|
|
439
|
-
for (const profileName of profileNames) {
|
|
440
|
-
easJsonRawObject.build[profileName].ios = {
|
|
441
|
-
...easJsonRawObject.build[profileName].ios,
|
|
442
|
-
resourceClass: eas_json_1.ResourceClass.M_MEDIUM,
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
return easJsonRawObject;
|
|
446
|
-
});
|
|
447
|
-
await easJsonAccessor.writeAsync();
|
|
448
|
-
log_1.default.withTick('Updated eas.json. Your next builds will run on M1 workers.');
|
|
449
|
-
}
|
package/build/build/configure.js
CHANGED
|
@@ -9,7 +9,6 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
|
9
9
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
10
10
|
const workflow_1 = require("../project/workflow");
|
|
11
11
|
const easCli_1 = require("../utils/easCli");
|
|
12
|
-
const vcs_1 = require("../vcs");
|
|
13
12
|
const repository_1 = require("./utils/repository");
|
|
14
13
|
async function easJsonExistsAsync(projectDir) {
|
|
15
14
|
return await fs_extra_1.default.pathExists(eas_json_1.EasJsonAccessor.formatEasJsonPath(projectDir));
|
|
@@ -30,12 +29,12 @@ async function ensureProjectConfiguredAsync(configureParams) {
|
|
|
30
29
|
return true;
|
|
31
30
|
}
|
|
32
31
|
exports.ensureProjectConfiguredAsync = ensureProjectConfiguredAsync;
|
|
33
|
-
async function configureAsync({ projectDir, nonInteractive }) {
|
|
34
|
-
await (0, repository_1.maybeBailOnRepoStatusAsync)();
|
|
35
|
-
await createEasJsonAsync(projectDir);
|
|
36
|
-
if (await
|
|
32
|
+
async function configureAsync({ projectDir, nonInteractive, vcsClient, }) {
|
|
33
|
+
await (0, repository_1.maybeBailOnRepoStatusAsync)(vcsClient);
|
|
34
|
+
await createEasJsonAsync(projectDir, vcsClient);
|
|
35
|
+
if (await vcsClient.isCommitRequiredAsync()) {
|
|
37
36
|
log_1.default.newLine();
|
|
38
|
-
await (0, repository_1.reviewAndCommitChangesAsync)('Configure EAS Build', {
|
|
37
|
+
await (0, repository_1.reviewAndCommitChangesAsync)(vcsClient, 'Configure EAS Build', {
|
|
39
38
|
nonInteractive,
|
|
40
39
|
});
|
|
41
40
|
}
|
|
@@ -81,14 +80,14 @@ const EAS_JSON_BARE_DEFAULT = {
|
|
|
81
80
|
production: {},
|
|
82
81
|
},
|
|
83
82
|
};
|
|
84
|
-
async function createEasJsonAsync(projectDir) {
|
|
83
|
+
async function createEasJsonAsync(projectDir, vcsClient) {
|
|
85
84
|
const easJsonPath = eas_json_1.EasJsonAccessor.formatEasJsonPath(projectDir);
|
|
86
|
-
const hasAndroidNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID)) === eas_build_job_1.Workflow.GENERIC;
|
|
87
|
-
const hasIosNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS)) === eas_build_job_1.Workflow.GENERIC;
|
|
85
|
+
const hasAndroidNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient)) === eas_build_job_1.Workflow.GENERIC;
|
|
86
|
+
const hasIosNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient)) === eas_build_job_1.Workflow.GENERIC;
|
|
88
87
|
const easJson = hasAndroidNativeProject || hasIosNativeProject
|
|
89
88
|
? EAS_JSON_BARE_DEFAULT
|
|
90
89
|
: EAS_JSON_MANAGED_DEFAULT;
|
|
91
90
|
await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
|
|
92
|
-
await
|
|
91
|
+
await vcsClient.trackFileAsync(easJsonPath);
|
|
93
92
|
log_1.default.withTick(`Generated ${chalk_1.default.bold('eas.json')}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/eas-json/')}`);
|
|
94
93
|
}
|
package/build/build/context.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
2
|
import { Platform, Workflow } from '@expo/eas-build-job';
|
|
3
3
|
import { BuildProfile, EasJson } from '@expo/eas-json';
|
|
4
|
+
import { NodePackageManager } from '@expo/package-manager';
|
|
4
5
|
import { Analytics, AnalyticsEventProperties } from '../analytics/AnalyticsManager';
|
|
5
6
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
6
7
|
import { CredentialsContext } from '../credentials/context';
|
|
@@ -10,6 +11,7 @@ import { GradleBuildContext } from '../project/android/gradle';
|
|
|
10
11
|
import { CustomBuildConfigMetadata } from '../project/customBuildConfig';
|
|
11
12
|
import { XcodeBuildContext } from '../project/ios/scheme';
|
|
12
13
|
import { Actor } from '../user/User';
|
|
14
|
+
import { Client } from '../vcs/vcs';
|
|
13
15
|
import { LocalBuildOptions } from './local';
|
|
14
16
|
export type CommonContext<T extends Platform> = Omit<BuildContext<T>, 'android' | 'ios'>;
|
|
15
17
|
export interface AndroidBuildContext {
|
|
@@ -51,4 +53,6 @@ export interface BuildContext<T extends Platform> {
|
|
|
51
53
|
android: T extends Platform.ANDROID ? AndroidBuildContext : undefined;
|
|
52
54
|
ios: T extends Platform.IOS ? IosBuildContext : undefined;
|
|
53
55
|
developmentClient: boolean;
|
|
56
|
+
requiredPackageManager: NodePackageManager['name'] | null;
|
|
57
|
+
vcsClient: Client;
|
|
54
58
|
}
|
|
@@ -5,9 +5,10 @@ import { DynamicConfigContextFn } from '../commandUtils/context/DynamicProjectCo
|
|
|
5
5
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
6
6
|
import { CustomBuildConfigMetadata } from '../project/customBuildConfig';
|
|
7
7
|
import { Actor } from '../user/User';
|
|
8
|
+
import { Client } from '../vcs/vcs';
|
|
8
9
|
import { BuildContext } from './context';
|
|
9
10
|
import { LocalBuildOptions } from './local';
|
|
10
|
-
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }: {
|
|
11
|
+
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }: {
|
|
11
12
|
buildProfileName: string;
|
|
12
13
|
buildProfile: BuildProfile<T>;
|
|
13
14
|
easJsonCliConfig: EasJson['cli'];
|
|
@@ -22,6 +23,7 @@ export declare function createBuildContextAsync<T extends Platform>({ buildProfi
|
|
|
22
23
|
actor: Actor;
|
|
23
24
|
graphqlClient: ExpoGraphqlClient;
|
|
24
25
|
analytics: Analytics;
|
|
26
|
+
vcsClient: Client;
|
|
25
27
|
getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn;
|
|
26
28
|
customBuildConfigMetadata?: CustomBuildConfigMetadata;
|
|
27
29
|
}): Promise<BuildContext<T>>;
|
|
@@ -4,6 +4,7 @@ exports.createBuildContextAsync = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
6
|
const json_file_1 = tslib_1.__importDefault(require("@expo/json-file"));
|
|
7
|
+
const package_manager_1 = require("@expo/package-manager");
|
|
7
8
|
const getenv_1 = tslib_1.__importDefault(require("getenv"));
|
|
8
9
|
const resolve_from_1 = tslib_1.__importDefault(require("resolve-from"));
|
|
9
10
|
const uuid_1 = require("uuid");
|
|
@@ -14,17 +15,18 @@ const workflow_1 = require("../project/workflow");
|
|
|
14
15
|
const build_1 = require("./android/build");
|
|
15
16
|
const build_2 = require("./ios/build");
|
|
16
17
|
const resourceClass_1 = require("./utils/resourceClass");
|
|
17
|
-
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }) {
|
|
18
|
+
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }) {
|
|
18
19
|
var _a, _b;
|
|
19
20
|
const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({ env: buildProfile.env });
|
|
20
21
|
const projectName = exp.slug;
|
|
21
22
|
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
|
|
22
|
-
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform);
|
|
23
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform, vcsClient);
|
|
23
24
|
const accountId = account.id;
|
|
24
25
|
const runFromCI = getenv_1.default.boolish('CI', false);
|
|
25
26
|
const developmentClient = (_b = (_a = buildProfile.developmentClient) !== null && _a !== void 0 ? _a : (platform === eas_build_job_1.Platform.ANDROID
|
|
26
27
|
? (buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.gradleCommand) === ':app:assembleDebug'
|
|
27
28
|
: (buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.buildConfiguration) === 'Debug')) !== null && _b !== void 0 ? _b : false;
|
|
29
|
+
const requiredPackageManager = (0, package_manager_1.resolvePackageManager)(projectDir);
|
|
28
30
|
const credentialsCtx = new context_1.CredentialsContext({
|
|
29
31
|
projectInfo: { exp, projectId },
|
|
30
32
|
nonInteractive,
|
|
@@ -34,6 +36,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
|
|
|
34
36
|
analytics,
|
|
35
37
|
env: buildProfile.env,
|
|
36
38
|
easJsonCliConfig,
|
|
39
|
+
vcsClient,
|
|
37
40
|
});
|
|
38
41
|
const devClientProperties = getDevClientEventProperties({
|
|
39
42
|
platform,
|
|
@@ -73,11 +76,13 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
|
|
|
73
76
|
user: actor,
|
|
74
77
|
graphqlClient,
|
|
75
78
|
analytics,
|
|
79
|
+
vcsClient,
|
|
76
80
|
workflow,
|
|
77
81
|
message,
|
|
78
82
|
runFromCI,
|
|
79
83
|
customBuildConfigMetadata,
|
|
80
84
|
developmentClient,
|
|
85
|
+
requiredPackageManager,
|
|
81
86
|
};
|
|
82
87
|
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
83
88
|
const common = commonContext;
|
package/build/build/ios/build.js
CHANGED
|
@@ -28,12 +28,14 @@ async function createIosContextAsync(ctx) {
|
|
|
28
28
|
projectDir: ctx.projectDir,
|
|
29
29
|
nonInteractive: ctx.nonInteractive,
|
|
30
30
|
exp: ctx.exp,
|
|
31
|
+
vcsClient: ctx.vcsClient,
|
|
31
32
|
}, buildProfile);
|
|
32
33
|
const targets = await (0, target_1.resolveTargetsAsync)({
|
|
33
34
|
projectDir: ctx.projectDir,
|
|
34
35
|
exp: ctx.exp,
|
|
35
36
|
xcodeBuildContext,
|
|
36
37
|
env: buildProfile.env,
|
|
38
|
+
vcsClient: ctx.vcsClient,
|
|
37
39
|
});
|
|
38
40
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
39
41
|
const buildNumberOverride = ((_a = ctx.easJsonCliConfig) === null || _a === void 0 ? void 0 : _a.appVersionSource) === eas_json_1.AppVersionSource.REMOTE
|
|
@@ -43,6 +45,7 @@ async function createIosContextAsync(ctx) {
|
|
|
43
45
|
exp: ctx.exp,
|
|
44
46
|
applicationTarget,
|
|
45
47
|
buildProfile,
|
|
48
|
+
vcsClient: ctx.vcsClient,
|
|
46
49
|
})
|
|
47
50
|
: undefined;
|
|
48
51
|
return {
|
|
@@ -70,6 +73,7 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
70
73
|
? false
|
|
71
74
|
: ctx.buildProfile.autoIncrement,
|
|
72
75
|
projectId: ctx.projectId,
|
|
76
|
+
vcsClient: ctx.vcsClient,
|
|
73
77
|
});
|
|
74
78
|
},
|
|
75
79
|
prepareJobAsync: async (ctx, jobData) => {
|
|
@@ -8,7 +8,6 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
8
8
|
const slash_1 = tslib_1.__importDefault(require("slash"));
|
|
9
9
|
const customBuildConfig_1 = require("../../project/customBuildConfig");
|
|
10
10
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
11
|
-
const vcs_1 = require("../../vcs");
|
|
12
11
|
const cacheDefaults = {
|
|
13
12
|
disabled: false,
|
|
14
13
|
paths: [],
|
|
@@ -17,7 +16,7 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
17
16
|
var _a;
|
|
18
17
|
const username = (0, projectUtils_1.getUsername)(ctx.exp, ctx.user);
|
|
19
18
|
const buildProfile = ctx.buildProfile;
|
|
20
|
-
const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await
|
|
19
|
+
const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await ctx.vcsClient.getRootPathAsync(), ctx.projectDir)) || '.';
|
|
21
20
|
const buildCredentials = {};
|
|
22
21
|
if (jobData.credentials) {
|
|
23
22
|
const targetNames = Object.keys(jobData.credentials);
|
|
@@ -2,10 +2,12 @@ import { ExpoConfig } from '@expo/config';
|
|
|
2
2
|
import { IosVersionAutoIncrement } from '@expo/eas-json';
|
|
3
3
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
4
4
|
import { Target } from '../../credentials/ios/types';
|
|
5
|
-
|
|
5
|
+
import { Client } from '../../vcs/vcs';
|
|
6
|
+
export declare function syncProjectConfigurationAsync(graphqlClient: ExpoGraphqlClient, { projectDir, exp, targets, localAutoIncrement, projectId, vcsClient, }: {
|
|
6
7
|
projectDir: string;
|
|
7
8
|
exp: ExpoConfig;
|
|
8
9
|
targets: Target[];
|
|
9
10
|
localAutoIncrement?: IosVersionAutoIncrement;
|
|
10
11
|
projectId: string;
|
|
12
|
+
vcsClient: Client;
|
|
11
13
|
}): Promise<void>;
|
|
@@ -6,12 +6,12 @@ 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(graphqlClient, { projectDir, exp, targets, localAutoIncrement, projectId, }) {
|
|
10
|
-
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
9
|
+
async function syncProjectConfigurationAsync(graphqlClient, { projectDir, exp, targets, localAutoIncrement, projectId, vcsClient, }) {
|
|
10
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
|
|
11
11
|
const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement !== null && localAutoIncrement !== void 0 ? localAutoIncrement : false);
|
|
12
12
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
13
13
|
if ((0, projectUtils_1.isExpoUpdatesInstalled)(projectDir)) {
|
|
14
|
-
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(graphqlClient, projectDir, exp, projectId);
|
|
14
|
+
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(graphqlClient, vcsClient, projectDir, exp, projectId);
|
|
15
15
|
}
|
|
16
16
|
await (0, version_1.bumpVersionAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy, targets });
|
|
17
17
|
}
|
|
@@ -4,6 +4,7 @@ import { BuildProfile } from '@expo/eas-json';
|
|
|
4
4
|
import type { XCBuildConfiguration } from 'xcode';
|
|
5
5
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
6
6
|
import { Target } from '../../credentials/ios/types';
|
|
7
|
+
import { Client } from '../../vcs/vcs';
|
|
7
8
|
export declare enum BumpStrategy {
|
|
8
9
|
APP_VERSION = 0,
|
|
9
10
|
BUILD_NUMBER = 1,
|
|
@@ -20,9 +21,9 @@ export declare function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, ex
|
|
|
20
21
|
projectDir: string;
|
|
21
22
|
exp: ExpoConfig;
|
|
22
23
|
}): Promise<void>;
|
|
23
|
-
export declare function readShortVersionAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings']): Promise<string | undefined>;
|
|
24
|
-
export declare function readBuildNumberAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings']): Promise<string | undefined>;
|
|
25
|
-
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig, targets: Target[]): Promise<{
|
|
24
|
+
export declare function readShortVersionAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings'], vcsClient: Client): Promise<string | undefined>;
|
|
25
|
+
export declare function readBuildNumberAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings'], vcsClient: Client): Promise<string | undefined>;
|
|
26
|
+
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig, targets: Target[], vcsClient: Client): Promise<{
|
|
26
27
|
appVersion?: string;
|
|
27
28
|
appBuildVersion?: string;
|
|
28
29
|
}>;
|
|
@@ -38,10 +39,11 @@ export declare function evaluateTemplateString(s: string, buildSettings: XCBuild
|
|
|
38
39
|
* Returns buildNumber that will be used for the next build. If current build profile
|
|
39
40
|
* has an 'autoIncrement' option set, it increments the version on server.
|
|
40
41
|
*/
|
|
41
|
-
export declare function resolveRemoteBuildNumberAsync(graphqlClient: ExpoGraphqlClient, { projectDir, projectId, exp, applicationTarget, buildProfile, }: {
|
|
42
|
+
export declare function resolveRemoteBuildNumberAsync(graphqlClient: ExpoGraphqlClient, { projectDir, projectId, exp, applicationTarget, buildProfile, vcsClient, }: {
|
|
42
43
|
projectDir: string;
|
|
43
44
|
projectId: string;
|
|
44
45
|
exp: ExpoConfig;
|
|
45
46
|
applicationTarget: Target;
|
|
46
47
|
buildProfile: BuildProfile<Platform.IOS>;
|
|
48
|
+
vcsClient: Client;
|
|
47
49
|
}): Promise<string>;
|
|
@@ -81,8 +81,8 @@ function validateShortVersion(shortVersion) {
|
|
|
81
81
|
throw new Error(`CFBundleShortVersionString (version field in app.json/app.config.js) must be a period-separated list of three non-negative integers. Current value: ${shortVersion}`);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
async function readShortVersionAsync(projectDir, exp, buildSettings) {
|
|
85
|
-
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
84
|
+
async function readShortVersionAsync(projectDir, exp, buildSettings, vcsClient) {
|
|
85
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
|
|
86
86
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
87
87
|
const infoPlist = await readInfoPlistAsync(projectDir, buildSettings);
|
|
88
88
|
const shortVersion = infoPlist.CFBundleShortVersionString &&
|
|
@@ -96,8 +96,8 @@ async function readShortVersionAsync(projectDir, exp, buildSettings) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
exports.readShortVersionAsync = readShortVersionAsync;
|
|
99
|
-
async function readBuildNumberAsync(projectDir, exp, buildSettings) {
|
|
100
|
-
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
99
|
+
async function readBuildNumberAsync(projectDir, exp, buildSettings, vcsClient) {
|
|
100
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
|
|
101
101
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
102
102
|
const infoPlist = await readInfoPlistAsync(projectDir, buildSettings);
|
|
103
103
|
return (infoPlist.CFBundleVersion && evaluateTemplateString(infoPlist.CFBundleVersion, buildSettings));
|
|
@@ -107,13 +107,13 @@ async function readBuildNumberAsync(projectDir, exp, buildSettings) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
exports.readBuildNumberAsync = readBuildNumberAsync;
|
|
110
|
-
async function maybeResolveVersionsAsync(projectDir, exp, targets) {
|
|
110
|
+
async function maybeResolveVersionsAsync(projectDir, exp, targets, vcsClient) {
|
|
111
111
|
var _a, _b;
|
|
112
112
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
113
113
|
try {
|
|
114
114
|
return {
|
|
115
|
-
appBuildVersion: await readBuildNumberAsync(projectDir, exp, (_a = applicationTarget.buildSettings) !== null && _a !== void 0 ? _a : {}),
|
|
116
|
-
appVersion: await readShortVersionAsync(projectDir, exp, (_b = applicationTarget.buildSettings) !== null && _b !== void 0 ? _b : {}),
|
|
115
|
+
appBuildVersion: await readBuildNumberAsync(projectDir, exp, (_a = applicationTarget.buildSettings) !== null && _a !== void 0 ? _a : {}, vcsClient),
|
|
116
|
+
appVersion: await readShortVersionAsync(projectDir, exp, (_b = applicationTarget.buildSettings) !== null && _b !== void 0 ? _b : {}, vcsClient),
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
catch (err) {
|
|
@@ -203,11 +203,11 @@ exports.evaluateTemplateString = evaluateTemplateString;
|
|
|
203
203
|
* Returns buildNumber that will be used for the next build. If current build profile
|
|
204
204
|
* has an 'autoIncrement' option set, it increments the version on server.
|
|
205
205
|
*/
|
|
206
|
-
async function resolveRemoteBuildNumberAsync(graphqlClient, { projectDir, projectId, exp, applicationTarget, buildProfile, }) {
|
|
206
|
+
async function resolveRemoteBuildNumberAsync(graphqlClient, { projectDir, projectId, exp, applicationTarget, buildProfile, vcsClient, }) {
|
|
207
207
|
var _a, _b, _c, _d;
|
|
208
208
|
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, generated_1.AppPlatform.Ios, applicationTarget.bundleIdentifier);
|
|
209
|
-
const localBuildNumber = await readBuildNumberAsync(projectDir, exp, (_a = applicationTarget.buildSettings) !== null && _a !== void 0 ? _a : {});
|
|
210
|
-
const localShortVersion = await readShortVersionAsync(projectDir, exp, (_b = applicationTarget.buildSettings) !== null && _b !== void 0 ? _b : {});
|
|
209
|
+
const localBuildNumber = await readBuildNumberAsync(projectDir, exp, (_a = applicationTarget.buildSettings) !== null && _a !== void 0 ? _a : {}, vcsClient);
|
|
210
|
+
const localShortVersion = await readShortVersionAsync(projectDir, exp, (_b = applicationTarget.buildSettings) !== null && _b !== void 0 ? _b : {}, vcsClient);
|
|
211
211
|
let currentBuildVersion;
|
|
212
212
|
if (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion) {
|
|
213
213
|
currentBuildVersion = remoteVersions.buildVersion;
|
package/build/build/metadata.js
CHANGED
|
@@ -11,13 +11,11 @@ const projectUtils_1 = require("../project/projectUtils");
|
|
|
11
11
|
const UpdatesModule_1 = require("../update/android/UpdatesModule");
|
|
12
12
|
const UpdatesModule_2 = require("../update/ios/UpdatesModule");
|
|
13
13
|
const easCli_1 = require("../utils/easCli");
|
|
14
|
-
const vcs_1 = require("../vcs");
|
|
15
14
|
const version_1 = require("./android/version");
|
|
16
15
|
const version_2 = require("./ios/version");
|
|
17
16
|
const local_1 = require("./local");
|
|
18
17
|
async function collectMetadataAsync(ctx) {
|
|
19
|
-
var _a, _b, _c, _d;
|
|
20
|
-
const vcsClient = (0, vcs_1.getVcsClient)();
|
|
18
|
+
var _a, _b, _c, _d, _e;
|
|
21
19
|
const channelOrReleaseChannel = await resolveChannelOrReleaseChannelAsync(ctx);
|
|
22
20
|
const distribution = (_a = ('simulator' in ctx.buildProfile && ctx.buildProfile.simulator
|
|
23
21
|
? 'simulator'
|
|
@@ -36,11 +34,11 @@ async function collectMetadataAsync(ctx) {
|
|
|
36
34
|
appName: ctx.exp.name,
|
|
37
35
|
appIdentifier: resolveAppIdentifier(ctx),
|
|
38
36
|
buildProfile: ctx.buildProfileName,
|
|
39
|
-
gitCommitHash: await vcsClient.getCommitHashAsync(),
|
|
40
|
-
gitCommitMessage: truncateGitCommitMessage((_c = (await vcsClient.getLastCommitMessageAsync())) !== null && _c !== void 0 ? _c : undefined),
|
|
37
|
+
gitCommitHash: await ctx.vcsClient.getCommitHashAsync(),
|
|
38
|
+
gitCommitMessage: truncateGitCommitMessage((_c = (await ctx.vcsClient.getLastCommitMessageAsync())) !== null && _c !== void 0 ? _c : undefined),
|
|
41
39
|
isGitWorkingTreeDirty: ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.INTERNAL
|
|
42
40
|
? false
|
|
43
|
-
: await vcsClient.hasUncommittedChangesAsync(),
|
|
41
|
+
: await ctx.vcsClient.hasUncommittedChangesAsync(),
|
|
44
42
|
username: (0, projectUtils_1.getUsername)(ctx.exp, ctx.user),
|
|
45
43
|
message: ctx.message,
|
|
46
44
|
...(ctx.platform === eas_build_job_1.Platform.IOS && {
|
|
@@ -51,6 +49,7 @@ async function collectMetadataAsync(ctx) {
|
|
|
51
49
|
buildMode: ctx.buildProfile.config ? eas_build_job_1.BuildMode.CUSTOM : eas_build_job_1.BuildMode.BUILD,
|
|
52
50
|
customWorkflowName: (_d = ctx.customBuildConfigMetadata) === null || _d === void 0 ? void 0 : _d.workflowName,
|
|
53
51
|
developmentClient: ctx.developmentClient,
|
|
52
|
+
requiredPackageManager: (_e = ctx.requiredPackageManager) !== null && _e !== void 0 ? _e : undefined,
|
|
54
53
|
};
|
|
55
54
|
return (0, eas_build_job_1.sanitizeMetadata)(metadata);
|
|
56
55
|
}
|
|
@@ -58,7 +57,7 @@ exports.collectMetadataAsync = collectMetadataAsync;
|
|
|
58
57
|
async function maybeResolveVersionsAsync(ctx) {
|
|
59
58
|
if (ctx.platform === eas_build_job_1.Platform.IOS) {
|
|
60
59
|
const iosContext = ctx;
|
|
61
|
-
const resolvedVersion = await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, iosContext.ios.targets);
|
|
60
|
+
const resolvedVersion = await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, iosContext.ios.targets, ctx.vcsClient);
|
|
62
61
|
if (iosContext.ios.buildNumberOverride) {
|
|
63
62
|
return {
|
|
64
63
|
...resolvedVersion,
|
|
@@ -69,7 +68,7 @@ async function maybeResolveVersionsAsync(ctx) {
|
|
|
69
68
|
}
|
|
70
69
|
else if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
|
|
71
70
|
const androidCtx = ctx;
|
|
72
|
-
const resolvedVersion = await (0, version_1.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, androidCtx.buildProfile);
|
|
71
|
+
const resolvedVersion = await (0, version_1.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, androidCtx.buildProfile, ctx.vcsClient);
|
|
73
72
|
if (androidCtx.android.versionCodeOverride) {
|
|
74
73
|
return {
|
|
75
74
|
...resolvedVersion,
|
|
@@ -4,6 +4,7 @@ import { DynamicConfigContextFn } from '../commandUtils/context/DynamicProjectCo
|
|
|
4
4
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
5
5
|
import { RequestedPlatform } from '../platform';
|
|
6
6
|
import { Actor } from '../user/User';
|
|
7
|
+
import { Client } from '../vcs/vcs';
|
|
7
8
|
import { LocalBuildOptions } from './local';
|
|
8
9
|
export interface BuildFlags {
|
|
9
10
|
requestedPlatform: RequestedPlatform;
|
|
@@ -18,4 +19,4 @@ export interface BuildFlags {
|
|
|
18
19
|
resourceClass?: ResourceClass;
|
|
19
20
|
message?: string;
|
|
20
21
|
}
|
|
21
|
-
export declare function runBuildAndSubmitAsync(graphqlClient: ExpoGraphqlClient, analytics: Analytics, projectDir: string, flags: BuildFlags, actor: Actor, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn): Promise<void>;
|
|
22
|
+
export declare function runBuildAndSubmitAsync(graphqlClient: ExpoGraphqlClient, analytics: Analytics, vcsClient: Client, projectDir: string, flags: BuildFlags, actor: Actor, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn): Promise<void>;
|