eas-cli 9.0.2 → 9.0.4
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 +59 -59
- package/build/analytics/AnalyticsManager.js +4 -5
- package/build/api.js +1 -2
- package/build/branch/actions/SelectBranch.js +2 -3
- package/build/branch/queries.js +3 -5
- package/build/branch/utils.js +1 -1
- package/build/build/android/build.js +3 -5
- package/build/build/android/graphql.js +1 -2
- package/build/build/android/prepareJob.js +1 -2
- package/build/build/android/syncProjectConfiguration.js +1 -1
- package/build/build/android/version.js +14 -16
- package/build/build/build.js +8 -10
- package/build/build/createContext.js +7 -8
- package/build/build/ios/build.js +2 -4
- package/build/build/ios/credentials.js +1 -2
- package/build/build/ios/graphql.js +4 -6
- package/build/build/ios/prepareJob.js +5 -6
- package/build/build/ios/syncProjectConfiguration.js +1 -1
- package/build/build/ios/version.js +17 -20
- package/build/build/local.js +2 -3
- package/build/build/metadata.js +9 -10
- package/build/build/queries.js +6 -9
- package/build/build/runBuildAndSubmit.d.ts +3 -1
- package/build/build/runBuildAndSubmit.js +19 -13
- package/build/build/utils/appJson.js +1 -2
- package/build/build/utils/formatBuild.js +5 -8
- package/build/build/utils/printBuildInfo.js +1 -2
- package/build/build/utils/resourceClass.js +3 -4
- package/build/build/utils/url.js +1 -2
- package/build/build/validate.js +8 -11
- package/build/channel/actions/SelectChannel.js +2 -3
- package/build/channel/errors.js +1 -1
- package/build/channel/queries.js +6 -10
- package/build/channel/utils.js +1 -1
- package/build/commandUtils/EasCommand.js +7 -6
- package/build/commandUtils/builds.js +3 -3
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +2 -2
- package/build/commandUtils/context/LoggedInContextField.js +1 -2
- package/build/commandUtils/context/MaybeLoggedInContextField.js +2 -3
- package/build/commandUtils/context/VcsClientContextField.js +1 -1
- package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +4 -6
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +2 -4
- package/build/commandUtils/gating/FeatureGateEnvOverrides.js +1 -2
- package/build/commandUtils/pagination.js +3 -4
- package/build/commands/account/view.js +1 -2
- package/build/commands/branch/delete.js +1 -2
- package/build/commands/build/configure.js +1 -2
- package/build/commands/build/index.js +1 -2
- package/build/commands/build/internal.js +1 -2
- package/build/commands/build/resign.js +7 -7
- package/build/commands/build/run.js +2 -3
- package/build/commands/build/version/get.js +3 -4
- package/build/commands/build/version/set.js +5 -6
- package/build/commands/build/version/sync.js +5 -7
- package/build/commands/channel/rollout.js +1 -2
- package/build/commands/config.js +16 -14
- package/build/commands/credentials/configure-build.js +3 -3
- package/build/commands/credentials/index.js +1 -1
- package/build/commands/device/create.js +1 -1
- package/build/commands/device/rename.js +1 -1
- package/build/commands/diagnostics.js +6 -2
- package/build/commands/project/init.js +11 -9
- package/build/commands/project/onboarding.js +204 -32
- package/build/commands/secret/delete.js +5 -5
- package/build/commands/update/index.js +6 -7
- package/build/commands/update/republish.js +1 -2
- package/build/commands/update/roll-back-to-embedded.js +4 -5
- package/build/credentials/android/AndroidCredentialsProvider.js +4 -5
- package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -3
- package/build/credentials/android/actions/DownloadKeystore.js +2 -3
- package/build/credentials/android/actions/RemoveFcm.js +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentials.js +3 -5
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.js +3 -3
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.js +3 -3
- package/build/credentials/android/api/GraphqlClient.js +4 -8
- package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.js +1 -2
- package/build/credentials/android/utils/printCredentials.js +4 -4
- package/build/credentials/context.js +2 -3
- package/build/credentials/credentialsJson/update.js +14 -16
- package/build/credentials/errors.js +7 -5
- package/build/credentials/ios/IosCredentialsProvider.js +3 -4
- package/build/credentials/ios/actions/AscApiKeyUtils.js +5 -9
- package/build/credentials/ios/actions/AssignAscApiKey.js +2 -3
- package/build/credentials/ios/actions/AssignPushKey.js +2 -3
- package/build/credentials/ios/actions/BuildCredentialsUtils.js +3 -5
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -3
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +3 -4
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +2 -3
- package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +3 -4
- package/build/credentials/ios/actions/SetUpAscApiKey.js +1 -1
- package/build/credentials/ios/actions/SetUpBuildCredentials.js +3 -4
- package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -2
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +2 -3
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +2 -3
- package/build/credentials/ios/api/GraphqlClient.js +11 -15
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +2 -4
- package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.js +1 -2
- package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.js +2 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +1 -2
- package/build/credentials/ios/appstore/ascApiKey.js +6 -8
- package/build/credentials/ios/appstore/authenticate.js +2 -4
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
- package/build/credentials/ios/appstore/contractMessages.js +3 -5
- package/build/credentials/ios/appstore/distributionCertificate.js +2 -3
- package/build/credentials/ios/appstore/ensureAppExists.js +1 -2
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +5 -7
- package/build/credentials/ios/appstore/pushKey.js +2 -3
- package/build/credentials/ios/appstore/resolveCredentials.js +8 -9
- package/build/credentials/ios/errors.js +1 -1
- package/build/credentials/ios/utils/p12Certificate.js +1 -2
- package/build/credentials/ios/utils/provisioningProfile.js +1 -2
- package/build/credentials/ios/validators/validateProvisioningProfile.js +5 -7
- package/build/credentials/manager/ManageAndroid.js +2 -2
- package/build/credentials/manager/ManageIos.js +3 -4
- package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -2
- package/build/credentials/manager/SetDefaultAndroidKeystore.js +1 -1
- package/build/credentials/manager/SetUpAndroidBuildCredentials.js +2 -2
- package/build/credentials/manager/SetUpIosBuildCredentials.js +2 -2
- package/build/credentials/utils/promptForCredentials.js +2 -3
- package/build/devices/actions/create/currentMachineMethod.js +4 -5
- package/build/devices/actions/create/developerPortalMethod.js +1 -2
- package/build/devices/actions/create/inputMethod.js +1 -1
- package/build/devices/context.js +1 -1
- package/build/devices/queries.js +3 -6
- package/build/devices/utils/errors.js +2 -2
- package/build/devices/utils/formatDevice.js +4 -6
- package/build/graphql/client.js +5 -8
- package/build/graphql/generated.d.ts +42 -0
- package/build/graphql/mutations/AppMutation.js +1 -2
- package/build/graphql/mutations/AppVersionMutation.js +1 -2
- package/build/graphql/mutations/BuildMutation.js +4 -8
- package/build/graphql/mutations/UserPreferencesMutation.js +2 -3
- package/build/graphql/queries/AppVersionQuery.js +1 -2
- package/build/graphql/queries/BranchQuery.js +1 -2
- package/build/graphql/queries/BuildQuery.js +1 -2
- package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -3
- package/build/graphql/queries/SubmissionQuery.js +1 -2
- package/build/graphql/queries/WebhookQuery.js +1 -2
- package/build/graphql/types/App.js +1 -0
- package/build/log.js +2 -2
- package/build/metadata/apple/config/reader.js +26 -32
- package/build/metadata/apple/config/writer.js +35 -39
- package/build/metadata/apple/rules/infoKeywordLength.js +2 -4
- package/build/metadata/apple/rules/infoRestrictedWords.js +2 -4
- package/build/metadata/apple/tasks/app-review-detail.js +1 -2
- package/build/metadata/apple/tasks/app-version.js +6 -8
- package/build/metadata/auth.js +1 -2
- package/build/metadata/config/resolve.js +2 -3
- package/build/metadata/config/validate.js +2 -4
- package/build/metadata/errors.js +3 -5
- package/build/metadata/upload.js +1 -2
- package/build/metadata/utils/retry.js +1 -2
- package/build/metadata/utils/telemetry.js +8 -11
- package/build/onboarding/runCommand.js +2 -2
- package/build/ora.js +18 -2
- package/build/project/android/applicationId.js +3 -4
- package/build/project/android/gradle.js +3 -4
- package/build/project/android/gradleUtils.js +4 -5
- package/build/project/expoConfig.js +3 -4
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +3 -5
- package/build/project/ios/bundleIdentifier.js +7 -8
- package/build/project/ios/entitlements.js +1 -2
- package/build/project/ios/scheme.js +7 -6
- package/build/project/ios/target.js +17 -23
- package/build/project/metroConfig.js +1 -2
- package/build/project/projectUtils.js +5 -7
- package/build/project/publish.js +18 -27
- package/build/project/remoteVersionSource.js +6 -7
- package/build/project/resolveRuntimeVersionAsync.d.ts +2 -1
- package/build/project/resolveRuntimeVersionAsync.js +3 -4
- package/build/prompts.js +5 -7
- package/build/rollout/actions/CreateRollout.js +4 -5
- package/build/rollout/actions/EditRollout.js +1 -2
- package/build/rollout/actions/EndRollout.js +2 -4
- package/build/rollout/actions/ManageRollout.js +1 -2
- package/build/rollout/actions/NonInteractiveRollout.js +1 -2
- package/build/rollout/actions/SelectRuntime.js +2 -4
- package/build/rollout/utils.js +4 -5
- package/build/run/android/adb.js +4 -7
- package/build/run/ios/xcode.js +1 -2
- package/build/run/ios/xcrun.js +1 -2
- package/build/run/utils.js +2 -4
- package/build/submit/ArchiveSource.js +1 -1
- package/build/submit/android/AndroidSubmitCommand.js +3 -5
- package/build/submit/android/AndroidSubmitter.js +3 -3
- package/build/submit/android/ServiceAccountSource.js +1 -2
- package/build/submit/ios/AppProduce.js +5 -4
- package/build/submit/ios/AppSpecificPasswordSource.js +2 -2
- package/build/submit/ios/AscApiKeySource.js +5 -3
- package/build/submit/ios/IosSubmitCommand.js +2 -3
- package/build/submit/ios/IosSubmitter.js +1 -1
- package/build/submit/ios/utils/language.js +3 -4
- package/build/submit/submit.js +2 -3
- package/build/submit/utils/errors.js +1 -2
- package/build/submit/utils/wait.js +1 -1
- package/build/update/android/UpdatesModule.js +1 -2
- package/build/update/configure.js +11 -14
- package/build/update/ios/UpdatesModule.js +2 -4
- package/build/update/queries.js +6 -10
- package/build/update/republish.js +1 -1
- package/build/update/utils.js +28 -39
- package/build/user/SessionManager.js +5 -8
- package/build/user/User.js +2 -2
- package/build/user/expoSsoLauncher.js +1 -2
- package/build/utils/code-signing.js +4 -7
- package/build/utils/expoCli.js +1 -2
- package/build/utils/expoUpdatesCli.d.ts +1 -0
- package/build/utils/expoUpdatesCli.js +3 -2
- package/build/utils/profiles.js +3 -3
- package/build/utils/progress.js +2 -2
- package/build/utils/relay.js +10 -14
- package/build/utils/timer.js +1 -2
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/clients/git.js +24 -20
- package/build/vcs/git.d.ts +1 -1
- package/build/vcs/git.js +4 -2
- package/build/vcs/local.js +1 -2
- package/build/webhooks/input.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
|
@@ -21,9 +21,8 @@ const graphql_2 = require("../graphql");
|
|
|
21
21
|
const credentials_1 = require("../utils/credentials");
|
|
22
22
|
const validate_1 = require("../validate");
|
|
23
23
|
async function createAndroidContextAsync(ctx) {
|
|
24
|
-
var _a, _b;
|
|
25
24
|
const { buildProfile } = ctx;
|
|
26
|
-
if (buildProfile.distribution === 'internal' &&
|
|
25
|
+
if (buildProfile.distribution === 'internal' && buildProfile.gradleCommand?.match(/bundle/)) {
|
|
27
26
|
log_1.default.addNewLineIfNone();
|
|
28
27
|
log_1.default.warn(`You're building your Android app for internal distribution. However, we've detected that the Gradle command you defined (${chalk_1.default.underline(buildProfile.gradleCommand)}) includes string 'bundle'.
|
|
29
28
|
This means that it will most likely produce an AAB and you will not be able to install it on your Android devices straight from the Expo website.`);
|
|
@@ -42,7 +41,7 @@ This means that it will most likely produce an AAB and you will not be able to i
|
|
|
42
41
|
await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(ctx);
|
|
43
42
|
}
|
|
44
43
|
const applicationId = await (0, applicationId_1.getApplicationIdAsync)(ctx.projectDir, ctx.exp, ctx.vcsClient, gradleContext);
|
|
45
|
-
const versionCodeOverride =
|
|
44
|
+
const versionCodeOverride = ctx.easJsonCliConfig?.appVersionSource === eas_json_1.AppVersionSource.REMOTE
|
|
46
45
|
? await (0, version_1.resolveRemoteVersionCodeAsync)(ctx.graphqlClient, {
|
|
47
46
|
projectDir: ctx.projectDir,
|
|
48
47
|
projectId: ctx.projectId,
|
|
@@ -62,11 +61,10 @@ async function prepareAndroidBuildAsync(ctx) {
|
|
|
62
61
|
return await ensureAndroidCredentialsAsync(ctx);
|
|
63
62
|
},
|
|
64
63
|
syncProjectConfigurationAsync: async () => {
|
|
65
|
-
var _a;
|
|
66
64
|
await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
|
|
67
65
|
projectDir: ctx.projectDir,
|
|
68
66
|
exp: ctx.exp,
|
|
69
|
-
localAutoIncrement:
|
|
67
|
+
localAutoIncrement: ctx.easJsonCliConfig?.appVersionSource === eas_json_1.AppVersionSource.REMOTE
|
|
70
68
|
? false
|
|
71
69
|
: ctx.buildProfile.autoIncrement,
|
|
72
70
|
vcsClient: ctx.vcsClient,
|
|
@@ -5,7 +5,6 @@ const eas_build_job_1 = require("@expo/eas-build-job");
|
|
|
5
5
|
const generated_1 = require("../../graphql/generated");
|
|
6
6
|
const graphql_1 = require("../graphql");
|
|
7
7
|
function transformJob(job) {
|
|
8
|
-
var _a;
|
|
9
8
|
return {
|
|
10
9
|
type: (0, graphql_1.transformWorkflow)(job.type),
|
|
11
10
|
triggeredBy: (0, graphql_1.transformBuildTrigger)(job.triggeredBy),
|
|
@@ -15,7 +14,7 @@ function transformJob(job) {
|
|
|
15
14
|
secrets: job.secrets,
|
|
16
15
|
builderEnvironment: job.builderEnvironment,
|
|
17
16
|
cache: job.cache,
|
|
18
|
-
version:
|
|
17
|
+
version: job.version?.versionCode ? { versionCode: job.version.versionCode } : undefined,
|
|
19
18
|
gradleCommand: job.gradleCommand,
|
|
20
19
|
applicationArchivePath: job.applicationArchivePath,
|
|
21
20
|
buildArtifactPaths: job.buildArtifactPaths,
|
|
@@ -12,7 +12,6 @@ const cacheDefaults = {
|
|
|
12
12
|
paths: [],
|
|
13
13
|
};
|
|
14
14
|
async function prepareJobAsync(ctx, jobData) {
|
|
15
|
-
var _a;
|
|
16
15
|
const username = (0, projectUtils_1.getUsername)(ctx.exp, ctx.user);
|
|
17
16
|
const buildProfile = ctx.buildProfile;
|
|
18
17
|
const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await ctx.vcsClient.getRootPathAsync(), ctx.projectDir)) || '.';
|
|
@@ -61,7 +60,7 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
61
60
|
updates: { channel: buildProfile.channel },
|
|
62
61
|
developmentClient: buildProfile.developmentClient,
|
|
63
62
|
gradleCommand: buildProfile.gradleCommand,
|
|
64
|
-
applicationArchivePath:
|
|
63
|
+
applicationArchivePath: buildProfile.applicationArchivePath ?? buildProfile.artifactPath,
|
|
65
64
|
buildArtifactPaths: buildProfile.buildArtifactPaths,
|
|
66
65
|
buildType,
|
|
67
66
|
username,
|
|
@@ -14,7 +14,7 @@ const workflow_1 = require("../../project/workflow");
|
|
|
14
14
|
const UpdatesModule_1 = require("../../update/android/UpdatesModule");
|
|
15
15
|
async function syncProjectConfigurationAsync({ projectDir, exp, localAutoIncrement, vcsClient, env, }) {
|
|
16
16
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient);
|
|
17
|
-
const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement
|
|
17
|
+
const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement ?? false);
|
|
18
18
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
19
19
|
await cleanUpOldEasBuildGradleScriptAsync(projectDir);
|
|
20
20
|
if ((0, projectUtils_1.isExpoUpdatesInstalled)(projectDir)) {
|
|
@@ -23,13 +23,12 @@ var BumpStrategy;
|
|
|
23
23
|
BumpStrategy[BumpStrategy["NOOP"] = 2] = "NOOP";
|
|
24
24
|
})(BumpStrategy || (exports.BumpStrategy = BumpStrategy = {}));
|
|
25
25
|
async function bumpVersionAsync({ bumpStrategy, projectDir, exp, }) {
|
|
26
|
-
var _a, _b, _c;
|
|
27
26
|
if (bumpStrategy === BumpStrategy.NOOP) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
29
|
(0, version_1.ensureStaticConfigExists)(projectDir);
|
|
31
30
|
const buildGradle = await (0, gradleUtils_1.getAppBuildGradleAsync)(projectDir);
|
|
32
|
-
const isMultiFlavor =
|
|
31
|
+
const isMultiFlavor = buildGradle.android?.productFlavors || buildGradle.android?.flavorDimensions;
|
|
33
32
|
if (isMultiFlavor) {
|
|
34
33
|
throw new Error('Automatic version bumping is not supported for multi-flavor Android projects.');
|
|
35
34
|
}
|
|
@@ -38,20 +37,19 @@ async function bumpVersionAsync({ bumpStrategy, projectDir, exp, }) {
|
|
|
38
37
|
await updateNativeVersionsAsync({
|
|
39
38
|
projectDir,
|
|
40
39
|
version: exp.version,
|
|
41
|
-
versionCode:
|
|
40
|
+
versionCode: exp.android?.versionCode,
|
|
42
41
|
});
|
|
43
42
|
log_1.default.log('Synchronized versions with build gradle');
|
|
44
43
|
}
|
|
45
44
|
exports.bumpVersionAsync = bumpVersionAsync;
|
|
46
45
|
async function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }) {
|
|
47
|
-
var _a;
|
|
48
46
|
if (bumpStrategy === BumpStrategy.NOOP) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
51
49
|
(0, version_1.ensureStaticConfigExists)(projectDir);
|
|
52
50
|
log_1.default.addNewLineIfNone();
|
|
53
51
|
if (bumpStrategy === BumpStrategy.APP_VERSION) {
|
|
54
|
-
const appVersion =
|
|
52
|
+
const appVersion = config_plugins_1.AndroidConfig.Version.getVersionName(exp) ?? '1.0.0';
|
|
55
53
|
await (0, version_1.bumpAppVersionAsync)({ appVersion, projectDir, exp });
|
|
56
54
|
}
|
|
57
55
|
else {
|
|
@@ -65,7 +63,6 @@ async function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }) {
|
|
|
65
63
|
}
|
|
66
64
|
exports.bumpVersionInAppJsonAsync = bumpVersionInAppJsonAsync;
|
|
67
65
|
async function maybeResolveVersionsAsync(projectDir, exp, buildProfile, vcsClient) {
|
|
68
|
-
var _a, _b;
|
|
69
66
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient);
|
|
70
67
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
71
68
|
const buildGradle = await (0, gradleUtils_1.getAppBuildGradleAsync)(projectDir);
|
|
@@ -74,8 +71,8 @@ async function maybeResolveVersionsAsync(projectDir, exp, buildProfile, vcsClien
|
|
|
74
71
|
? (0, gradleUtils_1.parseGradleCommand)(buildProfile.gradleCommand, buildGradle)
|
|
75
72
|
: undefined;
|
|
76
73
|
return {
|
|
77
|
-
appVersion: (
|
|
78
|
-
appBuildVersion: (
|
|
74
|
+
appVersion: (0, gradleUtils_1.resolveConfigValue)(buildGradle, 'versionName', parsedGradleCommand?.flavor) ?? '1.0.0',
|
|
75
|
+
appBuildVersion: (0, gradleUtils_1.resolveConfigValue)(buildGradle, 'versionCode', parsedGradleCommand?.flavor) ?? '1',
|
|
79
76
|
};
|
|
80
77
|
}
|
|
81
78
|
catch {
|
|
@@ -121,11 +118,10 @@ async function writeBuildGradleAsync({ projectDir, buildGradle, }) {
|
|
|
121
118
|
* has an 'autoIncrement' option set, it increments the version on server.
|
|
122
119
|
*/
|
|
123
120
|
async function resolveRemoteVersionCodeAsync(graphqlClient, { projectDir, projectId, exp, applicationId, buildProfile, vcsClient, }) {
|
|
124
|
-
var _a, _b, _c, _d, _e, _f;
|
|
125
121
|
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, generated_1.AppPlatform.Android, applicationId);
|
|
126
122
|
const localVersions = await maybeResolveVersionsAsync(projectDir, exp, buildProfile, vcsClient);
|
|
127
123
|
let currentBuildVersion;
|
|
128
|
-
if (remoteVersions
|
|
124
|
+
if (remoteVersions?.buildVersion) {
|
|
129
125
|
currentBuildVersion = remoteVersions.buildVersion;
|
|
130
126
|
}
|
|
131
127
|
else {
|
|
@@ -138,19 +134,20 @@ async function resolveRemoteVersionCodeAsync(graphqlClient, { projectDir, projec
|
|
|
138
134
|
throw new Error('Remote versions are not configured.');
|
|
139
135
|
}
|
|
140
136
|
}
|
|
141
|
-
if (!buildProfile.autoIncrement &&
|
|
137
|
+
if (!buildProfile.autoIncrement && remoteVersions?.buildVersion) {
|
|
142
138
|
return currentBuildVersion;
|
|
143
139
|
}
|
|
144
|
-
else if (!buildProfile.autoIncrement && !
|
|
140
|
+
else if (!buildProfile.autoIncrement && !remoteVersions?.buildVersion) {
|
|
145
141
|
const spinner = (0, ora_1.ora)(`Initializing versionCode with ${chalk_1.default.bold(currentBuildVersion)}.`).start();
|
|
146
142
|
try {
|
|
147
143
|
await AppVersionMutation_1.AppVersionMutation.createAppVersionAsync(graphqlClient, {
|
|
148
144
|
appId: projectId,
|
|
149
145
|
platform: generated_1.AppPlatform.Android,
|
|
150
146
|
applicationIdentifier: applicationId,
|
|
151
|
-
storeVersion:
|
|
147
|
+
storeVersion: localVersions.appVersion ?? exp.version ?? '1.0.0',
|
|
152
148
|
buildVersion: currentBuildVersion,
|
|
153
|
-
runtimeVersion: (
|
|
149
|
+
runtimeVersion: (await config_plugins_1.Updates.getRuntimeVersionNullableAsync(projectDir, exp, eas_build_job_1.Platform.ANDROID)) ??
|
|
150
|
+
undefined,
|
|
154
151
|
});
|
|
155
152
|
spinner.succeed(`Initialized versionCode with ${chalk_1.default.bold(currentBuildVersion)}.`);
|
|
156
153
|
}
|
|
@@ -168,9 +165,10 @@ async function resolveRemoteVersionCodeAsync(graphqlClient, { projectDir, projec
|
|
|
168
165
|
appId: projectId,
|
|
169
166
|
platform: generated_1.AppPlatform.Android,
|
|
170
167
|
applicationIdentifier: applicationId,
|
|
171
|
-
storeVersion:
|
|
168
|
+
storeVersion: localVersions.appVersion ?? exp.version ?? '1.0.0',
|
|
172
169
|
buildVersion: String(nextBuildVersion),
|
|
173
|
-
runtimeVersion: (
|
|
170
|
+
runtimeVersion: (await config_plugins_1.Updates.getRuntimeVersionNullableAsync(projectDir, exp, eas_build_job_1.Platform.ANDROID)) ??
|
|
171
|
+
undefined,
|
|
174
172
|
});
|
|
175
173
|
spinner.succeed(`Incremented versionCode from ${chalk_1.default.bold(currentBuildVersion)} to ${chalk_1.default.bold(nextBuildVersion)}.`);
|
|
176
174
|
}
|
package/build/build/build.js
CHANGED
|
@@ -78,7 +78,7 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
78
78
|
const buildParams = resolveBuildParamsInput(ctx, metadata);
|
|
79
79
|
const job = await builder.prepareJobAsync(ctx, {
|
|
80
80
|
projectArchive,
|
|
81
|
-
credentials: credentialsResult
|
|
81
|
+
credentials: credentialsResult?.credentials,
|
|
82
82
|
});
|
|
83
83
|
return async () => {
|
|
84
84
|
if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
|
|
@@ -119,12 +119,11 @@ const SERVER_SIDE_DEFINED_ERRORS = {
|
|
|
119
119
|
VALIDATION_ERROR: errors_1.RequestValidationError,
|
|
120
120
|
};
|
|
121
121
|
function handleBuildRequestError(error, platform) {
|
|
122
|
-
var _a, _b, _c, _d, _e;
|
|
123
122
|
log_1.default.debug(JSON.stringify(error.graphQLErrors, null, 2));
|
|
124
|
-
const graphQLErrorCode =
|
|
123
|
+
const graphQLErrorCode = error?.graphQLErrors?.[0]?.extensions?.errorCode;
|
|
125
124
|
if (graphQLErrorCode in SERVER_SIDE_DEFINED_ERRORS) {
|
|
126
125
|
const ErrorClass = SERVER_SIDE_DEFINED_ERRORS[graphQLErrorCode];
|
|
127
|
-
throw new ErrorClass(
|
|
126
|
+
throw new ErrorClass(error?.graphQLErrors?.[0]?.message);
|
|
128
127
|
}
|
|
129
128
|
else if (graphQLErrorCode === 'EAS_BUILD_DOWN_FOR_MAINTENANCE') {
|
|
130
129
|
throw new errors_1.EasBuildDownForMaintenanceError(`EAS Build is down for maintenance. Try again later. Check ${(0, log_1.link)('https://status.expo.dev/')} for updates.`);
|
|
@@ -132,14 +131,13 @@ function handleBuildRequestError(error, platform) {
|
|
|
132
131
|
else if (graphQLErrorCode === 'EAS_BUILD_TOO_MANY_PENDING_BUILDS') {
|
|
133
132
|
throw new errors_1.EasBuildTooManyPendingBuildsError(`You have already reached the maximum number of pending ${platform_1.requestedPlatformDisplayNames[platform]} builds for your account. Try again later.`);
|
|
134
133
|
}
|
|
135
|
-
else if (error
|
|
134
|
+
else if (error?.graphQLErrors) {
|
|
136
135
|
const errorMessage = error.graphQLErrors
|
|
137
136
|
.map((graphQLError) => {
|
|
138
|
-
|
|
139
|
-
const requestIdLine = ((_a = graphQLError === null || graphQLError === void 0 ? void 0 : graphQLError.extensions) === null || _a === void 0 ? void 0 : _a.requestId)
|
|
137
|
+
const requestIdLine = graphQLError?.extensions?.requestId
|
|
140
138
|
? `\nRequest ID: ${graphQLError.extensions.requestId}`
|
|
141
139
|
: '';
|
|
142
|
-
const errorMessageLine =
|
|
140
|
+
const errorMessageLine = graphQLError?.message
|
|
143
141
|
? `\nError message: ${graphQLError.message}`
|
|
144
142
|
: '';
|
|
145
143
|
return `${requestIdLine}${errorMessageLine}`;
|
|
@@ -278,7 +276,7 @@ async function handleSingleBuildProgressAsync({ build, accountName, }, { spinner
|
|
|
278
276
|
spinner.text = 'Could not fetch the build status. Check your network connection.';
|
|
279
277
|
return { refetch: true };
|
|
280
278
|
}
|
|
281
|
-
if (queueProgressBarStarted &&
|
|
279
|
+
if (queueProgressBarStarted && build?.status && build.status !== generated_1.BuildStatus.InQueue) {
|
|
282
280
|
if (build.status === generated_1.BuildStatus.InProgress) {
|
|
283
281
|
queueProgressBar.update(queueProgressBar.getTotal(), {
|
|
284
282
|
estimatedWaitTime: '',
|
|
@@ -396,7 +394,7 @@ function formatPendingBuildsText(originalSpinnerText, builds) {
|
|
|
396
394
|
const build = builds.find(build => build.platform === platform);
|
|
397
395
|
const status = build ? statusToDisplayName[build.status] : 'unknown';
|
|
398
396
|
let extraInfo = '';
|
|
399
|
-
if (
|
|
397
|
+
if (build?.status === generated_1.BuildStatus.InQueue &&
|
|
400
398
|
typeof build.initialQueuePosition === 'number' &&
|
|
401
399
|
typeof build.queuePosition === 'number') {
|
|
402
400
|
const percent = Math.floor(((build.initialQueuePosition - build.queuePosition + 1) /
|
|
@@ -16,16 +16,17 @@ const context_1 = require("../credentials/context");
|
|
|
16
16
|
const projectUtils_1 = require("../project/projectUtils");
|
|
17
17
|
const workflow_1 = require("../project/workflow");
|
|
18
18
|
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, }) {
|
|
19
|
-
var _a, _b;
|
|
20
19
|
const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({ env: buildProfile.env });
|
|
21
20
|
const projectName = exp.slug;
|
|
22
21
|
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
|
|
23
22
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform, vcsClient);
|
|
24
23
|
const accountId = account.id;
|
|
25
24
|
const runFromCI = getenv_1.default.boolish('CI', false);
|
|
26
|
-
const developmentClient =
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const developmentClient = buildProfile.developmentClient ??
|
|
26
|
+
(platform === eas_build_job_1.Platform.ANDROID
|
|
27
|
+
? buildProfile?.gradleCommand === ':app:assembleDebug'
|
|
28
|
+
: buildProfile?.buildConfiguration === 'Debug') ??
|
|
29
|
+
false;
|
|
29
30
|
const requiredPackageManager = (0, package_manager_1.resolvePackageManager)(projectDir);
|
|
30
31
|
const credentialsCtx = new context_1.CredentialsContext({
|
|
31
32
|
projectInfo: { exp, projectId },
|
|
@@ -103,11 +104,10 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
|
|
|
103
104
|
}
|
|
104
105
|
exports.createBuildContextAsync = createBuildContextAsync;
|
|
105
106
|
function getDevClientEventProperties({ platform, projectDir, buildProfile, }) {
|
|
106
|
-
var _a;
|
|
107
107
|
let includesDevClient;
|
|
108
108
|
const version = tryGetDevClientVersion(projectDir);
|
|
109
109
|
if (platform === eas_build_job_1.Platform.ANDROID && 'gradleCommand' in buildProfile) {
|
|
110
|
-
includesDevClient = Boolean(version &&
|
|
110
|
+
includesDevClient = Boolean(version && buildProfile.gradleCommand?.includes('Debug'));
|
|
111
111
|
}
|
|
112
112
|
else if (platform === eas_build_job_1.Platform.IOS && 'buildConfiguration' in buildProfile) {
|
|
113
113
|
includesDevClient = Boolean(version && buildProfile.buildConfiguration === 'Debug');
|
|
@@ -126,10 +126,9 @@ function getDevClientEventProperties({ platform, projectDir, buildProfile, }) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
function tryGetDevClientVersion(projectDir) {
|
|
129
|
-
var _a, _b;
|
|
130
129
|
try {
|
|
131
130
|
const pkg = json_file_1.default.read((0, resolve_from_1.default)(projectDir, 'expo-dev-client/package.json'));
|
|
132
|
-
return
|
|
131
|
+
return pkg.version?.toString() ?? null;
|
|
133
132
|
}
|
|
134
133
|
catch {
|
|
135
134
|
return null;
|
package/build/build/ios/build.js
CHANGED
|
@@ -16,7 +16,6 @@ const build_1 = require("../build");
|
|
|
16
16
|
const graphql_2 = require("../graphql");
|
|
17
17
|
const validate_1 = require("../validate");
|
|
18
18
|
async function createIosContextAsync(ctx) {
|
|
19
|
-
var _a;
|
|
20
19
|
const { buildProfile } = ctx;
|
|
21
20
|
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
22
21
|
await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx);
|
|
@@ -38,7 +37,7 @@ async function createIosContextAsync(ctx) {
|
|
|
38
37
|
vcsClient: ctx.vcsClient,
|
|
39
38
|
});
|
|
40
39
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
41
|
-
const buildNumberOverride =
|
|
40
|
+
const buildNumberOverride = ctx.easJsonCliConfig?.appVersionSource === eas_json_1.AppVersionSource.REMOTE
|
|
42
41
|
? await (0, version_1.resolveRemoteBuildNumberAsync)(ctx.graphqlClient, {
|
|
43
42
|
projectDir: ctx.projectDir,
|
|
44
43
|
projectId: ctx.projectId,
|
|
@@ -64,12 +63,11 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
64
63
|
return (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
|
|
65
64
|
},
|
|
66
65
|
syncProjectConfigurationAsync: async () => {
|
|
67
|
-
var _a;
|
|
68
66
|
await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
|
|
69
67
|
projectDir: ctx.projectDir,
|
|
70
68
|
exp: ctx.exp,
|
|
71
69
|
targets: ctx.ios.targets,
|
|
72
|
-
localAutoIncrement:
|
|
70
|
+
localAutoIncrement: ctx.easJsonCliConfig?.appVersionSource === eas_json_1.AppVersionSource.REMOTE
|
|
73
71
|
? false
|
|
74
72
|
: ctx.buildProfile.autoIncrement,
|
|
75
73
|
vcsClient: ctx.vcsClient,
|
|
@@ -7,14 +7,13 @@ const IosCredentialsProvider_1 = tslib_1.__importDefault(require("../../credenti
|
|
|
7
7
|
const BuildCredentialsUtils_1 = require("../../credentials/ios/actions/BuildCredentialsUtils");
|
|
8
8
|
const credentials_1 = require("../utils/credentials");
|
|
9
9
|
async function ensureIosCredentialsAsync(buildCtx, targets) {
|
|
10
|
-
var _a;
|
|
11
10
|
if (!shouldProvideCredentials(buildCtx)) {
|
|
12
11
|
return;
|
|
13
12
|
}
|
|
14
13
|
const provider = new IosCredentialsProvider_1.default(buildCtx.credentialsCtx, {
|
|
15
14
|
app: await (0, BuildCredentialsUtils_1.getAppFromContextAsync)(buildCtx.credentialsCtx),
|
|
16
15
|
targets,
|
|
17
|
-
distribution:
|
|
16
|
+
distribution: buildCtx.buildProfile.distribution ?? 'store',
|
|
18
17
|
enterpriseProvisioning: buildCtx.buildProfile.enterpriseProvisioning,
|
|
19
18
|
});
|
|
20
19
|
const { credentialsSource } = buildCtx.buildProfile;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
6
|
const graphql_1 = require("../graphql");
|
|
7
7
|
function transformJob(job) {
|
|
8
|
-
var _a;
|
|
9
8
|
return {
|
|
10
9
|
type: (0, graphql_1.transformWorkflow)(job.type),
|
|
11
10
|
triggeredBy: (0, graphql_1.transformBuildTrigger)(job.triggeredBy),
|
|
@@ -15,7 +14,7 @@ function transformJob(job) {
|
|
|
15
14
|
secrets: job.secrets ? transformIosSecrets(job.secrets) : undefined,
|
|
16
15
|
builderEnvironment: job.builderEnvironment,
|
|
17
16
|
cache: job.cache,
|
|
18
|
-
version:
|
|
17
|
+
version: job.version?.buildNumber ? { buildNumber: job.version.buildNumber } : undefined,
|
|
19
18
|
scheme: job.scheme,
|
|
20
19
|
buildConfiguration: job.buildConfiguration,
|
|
21
20
|
applicationArchivePath: job.applicationArchivePath,
|
|
@@ -33,14 +32,13 @@ function transformJob(job) {
|
|
|
33
32
|
}
|
|
34
33
|
exports.transformJob = transformJob;
|
|
35
34
|
function transformIosSecrets(secrets) {
|
|
36
|
-
var _a, _b, _c;
|
|
37
35
|
const buildCredentials = [];
|
|
38
|
-
for (const targetName of Object.keys(
|
|
36
|
+
for (const targetName of Object.keys(secrets.buildCredentials ?? {})) {
|
|
39
37
|
buildCredentials.push({
|
|
40
38
|
targetName,
|
|
41
|
-
provisioningProfileBase64: (0, nullthrows_1.default)(
|
|
39
|
+
provisioningProfileBase64: (0, nullthrows_1.default)(secrets.buildCredentials?.[targetName])
|
|
42
40
|
.provisioningProfileBase64,
|
|
43
|
-
distributionCertificate: (0, nullthrows_1.default)(
|
|
41
|
+
distributionCertificate: (0, nullthrows_1.default)(secrets.buildCredentials?.[targetName])
|
|
44
42
|
.distributionCertificate,
|
|
45
43
|
});
|
|
46
44
|
}
|
|
@@ -13,7 +13,6 @@ const cacheDefaults = {
|
|
|
13
13
|
paths: [],
|
|
14
14
|
};
|
|
15
15
|
async function prepareJobAsync(ctx, jobData) {
|
|
16
|
-
var _a;
|
|
17
16
|
const username = (0, projectUtils_1.getUsername)(ctx.exp, ctx.user);
|
|
18
17
|
const buildProfile = ctx.buildProfile;
|
|
19
18
|
const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await ctx.vcsClient.getRootPathAsync(), ctx.projectDir)) || '.';
|
|
@@ -56,7 +55,7 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
56
55
|
simulator: buildProfile.simulator,
|
|
57
56
|
scheme: jobData.buildScheme,
|
|
58
57
|
buildConfiguration: buildProfile.buildConfiguration,
|
|
59
|
-
applicationArchivePath:
|
|
58
|
+
applicationArchivePath: buildProfile.applicationArchivePath ?? buildProfile.artifactPath,
|
|
60
59
|
buildArtifactPaths: buildProfile.buildArtifactPaths,
|
|
61
60
|
username,
|
|
62
61
|
...(ctx.ios.buildNumberOverride && {
|
|
@@ -81,13 +80,13 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
81
80
|
exports.prepareJobAsync = prepareJobAsync;
|
|
82
81
|
function prepareCredentialsToResign(credentials) {
|
|
83
82
|
const buildCredentials = [];
|
|
84
|
-
for (const targetName of Object.keys(credentials
|
|
83
|
+
for (const targetName of Object.keys(credentials ?? {})) {
|
|
85
84
|
buildCredentials.push({
|
|
86
85
|
targetName,
|
|
87
|
-
provisioningProfileBase64: (0, nullthrows_1.default)(credentials
|
|
86
|
+
provisioningProfileBase64: (0, nullthrows_1.default)(credentials?.[targetName].provisioningProfile),
|
|
88
87
|
distributionCertificate: {
|
|
89
|
-
dataBase64: (0, nullthrows_1.default)(credentials
|
|
90
|
-
password: (0, nullthrows_1.default)(credentials
|
|
88
|
+
dataBase64: (0, nullthrows_1.default)(credentials?.[targetName].distributionCertificate.certificateP12),
|
|
89
|
+
password: (0, nullthrows_1.default)(credentials?.[targetName].distributionCertificate.certificatePassword),
|
|
91
90
|
},
|
|
92
91
|
});
|
|
93
92
|
}
|
|
@@ -8,7 +8,7 @@ const workflow_1 = require("../../project/workflow");
|
|
|
8
8
|
const UpdatesModule_1 = require("../../update/ios/UpdatesModule");
|
|
9
9
|
async function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, vcsClient, env, }) {
|
|
10
10
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
|
|
11
|
-
const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement
|
|
11
|
+
const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement ?? false);
|
|
12
12
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
13
13
|
if ((0, projectUtils_1.isExpoUpdatesInstalled)(projectDir)) {
|
|
14
14
|
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)({ vcsClient, projectDir, exp, workflow, env });
|
|
@@ -27,7 +27,6 @@ var BumpStrategy;
|
|
|
27
27
|
BumpStrategy[BumpStrategy["NOOP"] = 2] = "NOOP";
|
|
28
28
|
})(BumpStrategy || (exports.BumpStrategy = BumpStrategy = {}));
|
|
29
29
|
async function bumpVersionAsync({ bumpStrategy, projectDir, exp, targets, }) {
|
|
30
|
-
var _a;
|
|
31
30
|
if (bumpStrategy === BumpStrategy.NOOP) {
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
@@ -37,7 +36,7 @@ async function bumpVersionAsync({ bumpStrategy, projectDir, exp, targets, }) {
|
|
|
37
36
|
await updateNativeVersionsAsync({
|
|
38
37
|
projectDir,
|
|
39
38
|
version: exp.version,
|
|
40
|
-
buildNumber:
|
|
39
|
+
buildNumber: exp.ios?.buildNumber,
|
|
41
40
|
targets,
|
|
42
41
|
});
|
|
43
42
|
log_1.default.log('Synchronized versions with Info.plist');
|
|
@@ -108,12 +107,11 @@ async function readBuildNumberAsync(projectDir, exp, buildSettings, vcsClient) {
|
|
|
108
107
|
}
|
|
109
108
|
exports.readBuildNumberAsync = readBuildNumberAsync;
|
|
110
109
|
async function maybeResolveVersionsAsync(projectDir, exp, targets, vcsClient) {
|
|
111
|
-
var _a, _b;
|
|
112
110
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
113
111
|
try {
|
|
114
112
|
return {
|
|
115
|
-
appBuildVersion: await readBuildNumberAsync(projectDir, exp,
|
|
116
|
-
appVersion: await readShortVersionAsync(projectDir, exp,
|
|
113
|
+
appBuildVersion: await readBuildNumberAsync(projectDir, exp, applicationTarget.buildSettings ?? {}, vcsClient),
|
|
114
|
+
appVersion: await readShortVersionAsync(projectDir, exp, applicationTarget.buildSettings ?? {}, vcsClient),
|
|
117
115
|
};
|
|
118
116
|
}
|
|
119
117
|
catch (err) {
|
|
@@ -143,12 +141,10 @@ function getInfoPlistPath(projectDir, buildSettings) {
|
|
|
143
141
|
}
|
|
144
142
|
exports.getInfoPlistPath = getInfoPlistPath;
|
|
145
143
|
async function readInfoPlistAsync(projectDir, buildSettings) {
|
|
146
|
-
var _a;
|
|
147
144
|
const infoPlistPath = getInfoPlistPath(projectDir, buildSettings);
|
|
148
|
-
return ((
|
|
145
|
+
return ((await (0, plist_1.readPlistAsync)(infoPlistPath)) ?? {});
|
|
149
146
|
}
|
|
150
147
|
async function updateNativeVersionsAsync({ projectDir, version, buildNumber, targets, }) {
|
|
151
|
-
var _a;
|
|
152
148
|
const project = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(projectDir);
|
|
153
149
|
const iosDir = path_1.default.join(projectDir, 'ios');
|
|
154
150
|
const infoPlistFiles = [];
|
|
@@ -158,7 +154,7 @@ async function updateNativeVersionsAsync({ projectDir, version, buildNumber, tar
|
|
|
158
154
|
targetName,
|
|
159
155
|
buildConfiguration,
|
|
160
156
|
});
|
|
161
|
-
const infoPlist =
|
|
157
|
+
const infoPlist = xcBuildConfiguration?.buildSettings?.INFOPLIST_FILE;
|
|
162
158
|
if (infoPlist) {
|
|
163
159
|
const evaluatedInfoPlistPath = trimQuotes(evaluateTemplateString(infoPlist, {
|
|
164
160
|
SRCROOT: iosDir,
|
|
@@ -183,7 +179,7 @@ async function updateNativeVersionsAsync({ projectDir, version, buildNumber, tar
|
|
|
183
179
|
}
|
|
184
180
|
exports.updateNativeVersionsAsync = updateNativeVersionsAsync;
|
|
185
181
|
function trimQuotes(s) {
|
|
186
|
-
return
|
|
182
|
+
return s?.startsWith('"') && s.endsWith('"') ? s.slice(1, -1) : s;
|
|
187
183
|
}
|
|
188
184
|
function evaluateTemplateString(s, buildSettings) {
|
|
189
185
|
// necessary because XCBuildConfiguration['buildSettings'] is not a plain object
|
|
@@ -204,12 +200,11 @@ exports.evaluateTemplateString = evaluateTemplateString;
|
|
|
204
200
|
* has an 'autoIncrement' option set, it increments the version on server.
|
|
205
201
|
*/
|
|
206
202
|
async function resolveRemoteBuildNumberAsync(graphqlClient, { projectDir, projectId, exp, applicationTarget, buildProfile, vcsClient, }) {
|
|
207
|
-
var _a, _b, _c, _d;
|
|
208
203
|
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, generated_1.AppPlatform.Ios, applicationTarget.bundleIdentifier);
|
|
209
|
-
const localBuildNumber = await readBuildNumberAsync(projectDir, exp,
|
|
210
|
-
const localShortVersion = await readShortVersionAsync(projectDir, exp,
|
|
204
|
+
const localBuildNumber = await readBuildNumberAsync(projectDir, exp, applicationTarget.buildSettings ?? {}, vcsClient);
|
|
205
|
+
const localShortVersion = await readShortVersionAsync(projectDir, exp, applicationTarget.buildSettings ?? {}, vcsClient);
|
|
211
206
|
let currentBuildVersion;
|
|
212
|
-
if (remoteVersions
|
|
207
|
+
if (remoteVersions?.buildVersion) {
|
|
213
208
|
currentBuildVersion = remoteVersions.buildVersion;
|
|
214
209
|
}
|
|
215
210
|
else {
|
|
@@ -222,19 +217,20 @@ async function resolveRemoteBuildNumberAsync(graphqlClient, { projectDir, projec
|
|
|
222
217
|
throw new Error('Remote versions are not configured.');
|
|
223
218
|
}
|
|
224
219
|
}
|
|
225
|
-
if (!buildProfile.autoIncrement &&
|
|
220
|
+
if (!buildProfile.autoIncrement && remoteVersions?.buildVersion) {
|
|
226
221
|
return currentBuildVersion;
|
|
227
222
|
}
|
|
228
|
-
else if (!buildProfile.autoIncrement && !
|
|
223
|
+
else if (!buildProfile.autoIncrement && !remoteVersions?.buildVersion) {
|
|
229
224
|
const spinner = (0, ora_1.ora)(`Initializing buildNumber with ${chalk_1.default.bold(currentBuildVersion)}.`).start();
|
|
230
225
|
try {
|
|
231
226
|
await AppVersionMutation_1.AppVersionMutation.createAppVersionAsync(graphqlClient, {
|
|
232
227
|
appId: projectId,
|
|
233
228
|
platform: generated_1.AppPlatform.Ios,
|
|
234
229
|
applicationIdentifier: applicationTarget.bundleIdentifier,
|
|
235
|
-
storeVersion: localShortVersion
|
|
230
|
+
storeVersion: localShortVersion ?? '1.0.0',
|
|
236
231
|
buildVersion: currentBuildVersion,
|
|
237
|
-
runtimeVersion: (
|
|
232
|
+
runtimeVersion: (await config_plugins_1.Updates.getRuntimeVersionNullableAsync(projectDir, exp, eas_build_job_1.Platform.IOS)) ??
|
|
233
|
+
undefined,
|
|
238
234
|
});
|
|
239
235
|
spinner.succeed(`Initialized buildNumber with ${chalk_1.default.bold(currentBuildVersion)}.`);
|
|
240
236
|
}
|
|
@@ -252,9 +248,10 @@ async function resolveRemoteBuildNumberAsync(graphqlClient, { projectDir, projec
|
|
|
252
248
|
appId: projectId,
|
|
253
249
|
platform: generated_1.AppPlatform.Ios,
|
|
254
250
|
applicationIdentifier: applicationTarget.bundleIdentifier,
|
|
255
|
-
storeVersion: localShortVersion
|
|
251
|
+
storeVersion: localShortVersion ?? '1.0.0',
|
|
256
252
|
buildVersion: nextBuildVersion,
|
|
257
|
-
runtimeVersion: (
|
|
253
|
+
runtimeVersion: (await config_plugins_1.Updates.getRuntimeVersionNullableAsync(projectDir, exp, eas_build_job_1.Platform.IOS)) ??
|
|
254
|
+
undefined,
|
|
258
255
|
});
|
|
259
256
|
spinner.succeed(`Incremented buildNumber from ${chalk_1.default.bold(currentBuildVersion)} to ${chalk_1.default.bold(nextBuildVersion)}.`);
|
|
260
257
|
}
|
package/build/build/local.js
CHANGED
|
@@ -26,7 +26,6 @@ var LocalBuildMode;
|
|
|
26
26
|
LocalBuildMode["INTERNAL"] = "internal";
|
|
27
27
|
})(LocalBuildMode || (exports.LocalBuildMode = LocalBuildMode = {}));
|
|
28
28
|
async function runLocalBuildAsync(job, metadata, options) {
|
|
29
|
-
var _a;
|
|
30
29
|
const { command, args } = await getCommandAndArgsAsync(job, metadata);
|
|
31
30
|
let spinner;
|
|
32
31
|
if (!options.verbose) {
|
|
@@ -44,7 +43,7 @@ async function runLocalBuildAsync(job, metadata, options) {
|
|
|
44
43
|
stdio: options.verbose ? 'inherit' : 'pipe',
|
|
45
44
|
env: {
|
|
46
45
|
...process.env,
|
|
47
|
-
EAS_LOCAL_BUILD_WORKINGDIR:
|
|
46
|
+
EAS_LOCAL_BUILD_WORKINGDIR: options.workingdir ?? process.env.EAS_LOCAL_BUILD_WORKINGDIR,
|
|
48
47
|
...(options.skipCleanup || options.skipNativeBuild
|
|
49
48
|
? { EAS_LOCAL_BUILD_SKIP_CLEANUP: '1' }
|
|
50
49
|
: {}),
|
|
@@ -58,7 +57,7 @@ async function runLocalBuildAsync(job, metadata, options) {
|
|
|
58
57
|
}
|
|
59
58
|
finally {
|
|
60
59
|
process.removeListener('SIGINT', interruptHandler);
|
|
61
|
-
spinner
|
|
60
|
+
spinner?.stop();
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
exports.runLocalBuildAsync = runLocalBuildAsync;
|