eas-cli 0.36.0 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -37
- package/build/build/android/build.d.ts +2 -1
- package/build/build/android/build.js +11 -9
- package/build/build/build.d.ts +0 -2
- package/build/build/build.js +1 -2
- package/build/build/configure.js +0 -1
- package/build/build/context.d.ts +18 -10
- package/build/build/context.js +0 -96
- package/build/build/createContext.d.ts +13 -0
- package/build/build/createContext.js +114 -0
- package/build/build/ios/UpdatesModule.js +3 -2
- package/build/build/ios/build.d.ts +2 -1
- package/build/build/ios/build.js +24 -19
- package/build/build/ios/version.js +7 -3
- package/build/build/local.js +15 -4
- package/build/build/metadata.d.ts +1 -12
- package/build/build/metadata.js +24 -19
- package/build/build/utils/devClient.d.ts +1 -2
- package/build/build/utils/repository.js +1 -0
- package/build/build/validate.d.ts +3 -3
- package/build/commands/branch/publish.js +24 -2
- package/build/commands/build/configure.js +2 -0
- package/build/commands/build/index.js +11 -16
- package/build/commands/channel/create.d.ts +6 -0
- package/build/commands/channel/create.js +2 -0
- package/build/commands/secret/create.js +0 -6
- package/build/commands/secret/delete.js +0 -6
- package/build/commands/secret/list.js +0 -6
- package/build/commands/submit.js +2 -11
- package/build/commands/webhook/create.js +1 -2
- package/build/commands/webhook/list.js +1 -1
- package/build/commands/webhook/update.js +1 -2
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +11 -1
- package/build/credentials/ios/appstore/entitlements.js +9 -12
- package/build/graphql/generated.d.ts +2 -1
- package/build/graphql/generated.js +1 -0
- package/build/project/android/applicationId.d.ts +6 -0
- package/build/project/android/applicationId.js +39 -29
- package/build/project/android/gradle.js +3 -2
- package/build/project/android/gradleUtils.d.ts +1 -0
- package/build/project/ios/bundleIdentifier.d.ts +6 -1
- package/build/project/ios/bundleIdentifier.js +29 -18
- package/build/submit/android/AndroidSubmitCommand.d.ts +1 -2
- package/build/submit/android/AndroidSubmitCommand.js +23 -35
- package/build/submit/android/AndroidSubmitter.d.ts +0 -2
- package/build/submit/android/AndroidSubmitter.js +1 -3
- package/build/submit/android/ServiceAccountSource.d.ts +3 -2
- package/build/submit/android/ServiceAccountSource.js +16 -4
- package/build/submit/context.d.ts +2 -0
- package/build/submit/context.js +2 -1
- package/build/submit/ios/CredentialsServiceSource.d.ts +6 -3
- package/build/submit/ios/CredentialsServiceSource.js +13 -2
- package/build/submit/ios/IosSubmitCommand.d.ts +2 -1
- package/build/submit/ios/IosSubmitCommand.js +47 -17
- package/build/submit/ios/IosSubmitter.js +1 -1
- package/build/{build/ios → utils}/plist.d.ts +1 -1
- package/build/{build/ios → utils}/plist.js +8 -2
- package/build/utils/profiles.d.ts +9 -4
- package/build/utils/profiles.js +14 -7
- package/build/vcs/clients/git.d.ts +2 -1
- package/build/vcs/clients/git.js +87 -6
- package/build/vcs/vcs.d.ts +4 -3
- package/build/vcs/vcs.js +3 -3
- package/build/webhooks/input.d.ts +2 -2
- package/build/webhooks/input.js +19 -2
- package/oclif.manifest.json +1 -1
- package/package.json +13 -14
- package/build/project/isEasEnabledForProject.d.ts +0 -8
- package/build/project/isEasEnabledForProject.js +0 -33
- package/build/submit/android/AndroidPackageSource.d.ts +0 -17
- package/build/submit/android/AndroidPackageSource.js +0 -27
|
@@ -35,8 +35,7 @@ WebhookUpdate.flags = {
|
|
|
35
35
|
}),
|
|
36
36
|
event: command_1.flags.enum({
|
|
37
37
|
description: 'Event type that triggers the webhook',
|
|
38
|
-
options: [generated_1.WebhookType.Build],
|
|
39
|
-
default: generated_1.WebhookType.Build,
|
|
38
|
+
options: [generated_1.WebhookType.Build, generated_1.WebhookType.Submit],
|
|
40
39
|
}),
|
|
41
40
|
url: command_1.flags.string({
|
|
42
41
|
description: 'Webhook URL',
|
|
@@ -4,6 +4,7 @@ exports.CapabilityMapping = exports.assertValidOptions = exports.syncCapabilitie
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const apple_utils_1 = require("@expo/apple-utils");
|
|
6
6
|
const getenv_1 = (0, tslib_1.__importDefault)(require("getenv"));
|
|
7
|
+
const util_1 = require("util");
|
|
7
8
|
const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
|
|
8
9
|
exports.EXPO_NO_CAPABILITY_SYNC = getenv_1.default.boolish('EXPO_NO_CAPABILITY_SYNC', false);
|
|
9
10
|
const validateBooleanOptions = (options) => {
|
|
@@ -56,7 +57,16 @@ async function syncCapabilitiesForEntitlementsAsync(bundleId, entitlements = {})
|
|
|
56
57
|
const { enabledCapabilityNames, request, remainingCapabilities } = getCapabilitiesToEnable(currentCapabilities, entitlements);
|
|
57
58
|
const { disabledCapabilityNames, request: modifiedRequest } = getCapabilitiesToDisable(bundleId, remainingCapabilities, request);
|
|
58
59
|
if (modifiedRequest.length) {
|
|
59
|
-
|
|
60
|
+
log_1.default.debug(`Patch Request:`, (0, util_1.inspect)(modifiedRequest, { depth: null, colors: true }));
|
|
61
|
+
try {
|
|
62
|
+
await bundleId.updateBundleIdCapabilityAsync(modifiedRequest);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error.message.match(/bundle '[\w\d]+' cannot be deleted. Delete all the Apps/)) {
|
|
66
|
+
log_1.default.error('Failed to patch capabilities:', (0, util_1.inspect)(modifiedRequest, { depth: null, colors: true }));
|
|
67
|
+
throw new Error(`Unexpected error occurred while attempting to update capabilities for app "${bundleId.attributes.identifier}".\nCapabilities can be modified manually in the Apple developer console at https://developer.apple.com/account/resources/identifiers/bundleId/edit/${bundleId.id}.\nAuto capability syncing can be disabled with the environment variable \`EXPO_NO_CAPABILITY_SYNC=1\`.\n${error.message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
}
|
|
61
71
|
return { enabled: enabledCapabilityNames, disabled: disabledCapabilityNames };
|
|
62
72
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveEntitlementsJsonAsync = exports.getManagedEntitlementsJsonAsync = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
|
-
const plist_1 = (0, tslib_1.__importDefault)(require("@expo/plist"));
|
|
8
6
|
const prebuild_config_1 = require("@expo/prebuild-config");
|
|
9
|
-
const
|
|
7
|
+
const plist_1 = require("../../../utils/plist");
|
|
10
8
|
async function getManagedEntitlementsJsonAsync(projectDir, env) {
|
|
11
9
|
var _a;
|
|
12
10
|
const originalProcessEnv = process.env;
|
|
@@ -15,7 +13,7 @@ async function getManagedEntitlementsJsonAsync(projectDir, env) {
|
|
|
15
13
|
...process.env,
|
|
16
14
|
...env,
|
|
17
15
|
};
|
|
18
|
-
const { exp } = (0, prebuild_config_1.
|
|
16
|
+
const { exp } = await (0, prebuild_config_1.getPrebuildConfigAsync)(projectDir, { platforms: ['ios'] });
|
|
19
17
|
const expWithMods = await (0, config_plugins_1.compileModsAsync)(exp, {
|
|
20
18
|
projectRoot: projectDir,
|
|
21
19
|
platforms: ['ios'],
|
|
@@ -41,13 +39,12 @@ async function resolveEntitlementsJsonAsync(projectDir, workflow, env) {
|
|
|
41
39
|
}
|
|
42
40
|
exports.resolveEntitlementsJsonAsync = resolveEntitlementsJsonAsync;
|
|
43
41
|
async function getEntitlementsJsonAsync(projectDir) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
const entitlementsPath = config_plugins_1.IOSConfig.Paths.getEntitlementsPath(projectDir);
|
|
43
|
+
if (entitlementsPath) {
|
|
44
|
+
const plist = await (0, plist_1.readPlistAsync)(entitlementsPath);
|
|
45
|
+
return plist ? plist : null;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return null;
|
|
50
49
|
}
|
|
51
|
-
catch { }
|
|
52
|
-
return null;
|
|
53
50
|
}
|
|
@@ -1239,7 +1239,8 @@ export declare type WebhookFilter = {
|
|
|
1239
1239
|
event?: Maybe<WebhookType>;
|
|
1240
1240
|
};
|
|
1241
1241
|
export declare enum WebhookType {
|
|
1242
|
-
Build = "BUILD"
|
|
1242
|
+
Build = "BUILD",
|
|
1243
|
+
Submit = "SUBMIT"
|
|
1243
1244
|
}
|
|
1244
1245
|
export declare type Webhook = {
|
|
1245
1246
|
__typename?: 'Webhook';
|
|
@@ -176,6 +176,7 @@ var AndroidKeystoreType;
|
|
|
176
176
|
var WebhookType;
|
|
177
177
|
(function (WebhookType) {
|
|
178
178
|
WebhookType["Build"] = "BUILD";
|
|
179
|
+
WebhookType["Submit"] = "SUBMIT";
|
|
179
180
|
})(WebhookType = exports.WebhookType || (exports.WebhookType = {}));
|
|
180
181
|
var AppsFilter;
|
|
181
182
|
(function (AppsFilter) {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
2
|
import { GradleBuildContext } from './gradle';
|
|
3
|
+
export declare const INVALID_APPLICATION_ID_MESSAGE = "Invalid format of Android applicationId. Only alphanumeric characters, '.' and '_' are allowed, and each '.' must be followed by a letter.";
|
|
3
4
|
export declare function ensureApplicationIdIsDefinedForManagedProjectAsync(projectDir: string, exp: ExpoConfig): Promise<string>;
|
|
5
|
+
export declare class AmbiguousApplicationIdError extends Error {
|
|
6
|
+
constructor(message?: string);
|
|
7
|
+
}
|
|
8
|
+
export declare function getApplicationIdFromBareAsync(projectDir: string, gradleContext?: GradleBuildContext): Promise<string>;
|
|
4
9
|
export declare function getApplicationIdAsync(projectDir: string, exp: ExpoConfig, gradleContext?: GradleBuildContext): Promise<string>;
|
|
10
|
+
export declare function isApplicationIdValid(applicationId: string): boolean;
|
|
5
11
|
export declare function warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject(projectDir: string, exp: ExpoConfig): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject = exports.getApplicationIdAsync = exports.ensureApplicationIdIsDefinedForManagedProjectAsync = void 0;
|
|
3
|
+
exports.warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject = exports.isApplicationIdValid = exports.getApplicationIdAsync = exports.getApplicationIdFromBareAsync = exports.AmbiguousApplicationIdError = exports.ensureApplicationIdIsDefinedForManagedProjectAsync = exports.INVALID_APPLICATION_ID_MESSAGE = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_1 = require("@expo/config");
|
|
6
6
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
@@ -16,7 +16,7 @@ const prompts_1 = require("../../prompts");
|
|
|
16
16
|
const actions_1 = require("../../user/actions");
|
|
17
17
|
const workflow_1 = require("../workflow");
|
|
18
18
|
const gradleUtils = (0, tslib_1.__importStar)(require("./gradleUtils"));
|
|
19
|
-
|
|
19
|
+
exports.INVALID_APPLICATION_ID_MESSAGE = `Invalid format of Android applicationId. Only alphanumeric characters, '.' and '_' are allowed, and each '.' must be followed by a letter.`;
|
|
20
20
|
async function ensureApplicationIdIsDefinedForManagedProjectAsync(projectDir, exp) {
|
|
21
21
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
|
|
22
22
|
(0, assert_1.default)(workflow === eas_build_job_1.Workflow.MANAGED, 'This function should be called only for managed projects');
|
|
@@ -30,40 +30,49 @@ async function ensureApplicationIdIsDefinedForManagedProjectAsync(projectDir, ex
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
exports.ensureApplicationIdIsDefinedForManagedProjectAsync = ensureApplicationIdIsDefinedForManagedProjectAsync;
|
|
33
|
+
class AmbiguousApplicationIdError extends Error {
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(message !== null && message !== void 0 ? message : 'Could not resolve applicationId.');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.AmbiguousApplicationIdError = AmbiguousApplicationIdError;
|
|
39
|
+
async function getApplicationIdFromBareAsync(projectDir, gradleContext) {
|
|
40
|
+
const errorMessage = 'Could not read applicationId from Android project.';
|
|
41
|
+
if (gradleContext) {
|
|
42
|
+
const buildGradle = await gradleUtils.getAppBuildGradleAsync(projectDir);
|
|
43
|
+
const applicationIdSuffix = gradleUtils.resolveConfigValue(buildGradle, 'applicationIdSuffix', gradleContext.flavor);
|
|
44
|
+
if (applicationIdSuffix) {
|
|
45
|
+
throw new Error('"applicationIdSuffix" in app/build.gradle is not supported.');
|
|
46
|
+
}
|
|
47
|
+
const applicationId = gradleUtils.resolveConfigValue(buildGradle, 'applicationId', gradleContext.flavor);
|
|
48
|
+
return (0, nullthrows_1.default)(applicationId, errorMessage);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// should return value only if productFlavors are not used
|
|
52
|
+
const buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
|
|
53
|
+
const buildGradle = await fs_extra_1.default.readFile(buildGradlePath, 'utf8');
|
|
54
|
+
const matchResult = buildGradle.match(/applicationId ['"](.*)['"]/);
|
|
55
|
+
if (buildGradle.match(/applicationIdSuffix/)) {
|
|
56
|
+
throw new Error('"applicationIdSuffix" in app/build.gradle is not supported.');
|
|
57
|
+
}
|
|
58
|
+
if (buildGradle.match(/productFlavors/)) {
|
|
59
|
+
throw new AmbiguousApplicationIdError('Failed to autodetect applicationId in multi-flavor project.');
|
|
60
|
+
}
|
|
61
|
+
return (0, nullthrows_1.default)(matchResult === null || matchResult === void 0 ? void 0 : matchResult[1], errorMessage);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.getApplicationIdFromBareAsync = getApplicationIdFromBareAsync;
|
|
33
65
|
async function getApplicationIdAsync(projectDir, exp, gradleContext) {
|
|
34
66
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
|
|
35
67
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
36
68
|
warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject(projectDir, exp);
|
|
37
|
-
|
|
38
|
-
if (gradleContext) {
|
|
39
|
-
const buildGradle = await gradleUtils.getAppBuildGradleAsync(projectDir);
|
|
40
|
-
const applicationId = gradleUtils.resolveConfigValue(buildGradle, 'applicationId', gradleContext.flavor);
|
|
41
|
-
return (0, nullthrows_1.default)(applicationId, errorMessage);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
// fallback to best effort approach, this logic can be dropped when we start supporting
|
|
45
|
-
// modules different than 'app' and 'flavorDimensions'
|
|
46
|
-
let buildGradlePath = null;
|
|
47
|
-
try {
|
|
48
|
-
buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
|
|
49
|
-
}
|
|
50
|
-
catch { }
|
|
51
|
-
if (!buildGradlePath || !(await fs_extra_1.default.pathExists(buildGradlePath))) {
|
|
52
|
-
throw new Error(errorMessage);
|
|
53
|
-
}
|
|
54
|
-
const buildGradle = await fs_extra_1.default.readFile(buildGradlePath, 'utf8');
|
|
55
|
-
const matchResult = buildGradle.match(/applicationId ['"](.*)['"]/);
|
|
56
|
-
const applicationId = (0, nullthrows_1.default)(matchResult === null || matchResult === void 0 ? void 0 : matchResult[1], errorMessage);
|
|
57
|
-
log_1.default.warn(`Unable to detect applicationId`);
|
|
58
|
-
log_1.default.warn(`Falling back to best effort approach, using applicationId ${applicationId}`);
|
|
59
|
-
return applicationId;
|
|
60
|
-
}
|
|
69
|
+
return getApplicationIdFromBareAsync(projectDir, gradleContext);
|
|
61
70
|
}
|
|
62
71
|
else {
|
|
63
72
|
const applicationId = config_plugins_1.AndroidConfig.Package.getPackage(exp);
|
|
64
73
|
if (!applicationId || !isApplicationIdValid(applicationId)) {
|
|
65
74
|
if (applicationId) {
|
|
66
|
-
log_1.default.warn(INVALID_APPLICATION_ID_MESSAGE);
|
|
75
|
+
log_1.default.warn(exports.INVALID_APPLICATION_ID_MESSAGE);
|
|
67
76
|
}
|
|
68
77
|
throw new Error(`Specify "android.package" in ${(0, projectUtils_1.getProjectConfigDescription)(projectDir)} and run this command again.`);
|
|
69
78
|
}
|
|
@@ -78,7 +87,7 @@ async function configureApplicationIdAsync(projectDir, exp) {
|
|
|
78
87
|
const paths = (0, config_1.getConfigFilePaths)(projectDir);
|
|
79
88
|
// we can't automatically update app.config.js
|
|
80
89
|
if (paths.dynamicConfigPath) {
|
|
81
|
-
throw new Error(`"android.package" is not defined in your app.config.js and we can't update this file
|
|
90
|
+
throw new Error(`"android.package" is not defined in your app.config.js and we can't update this file programmatically. Add the value on your own and run this command again.`);
|
|
82
91
|
}
|
|
83
92
|
(0, assert_1.default)(paths.staticConfigPath, 'app.json must exist');
|
|
84
93
|
log_1.default.addNewLineIfNone();
|
|
@@ -89,7 +98,7 @@ async function configureApplicationIdAsync(projectDir, exp) {
|
|
|
89
98
|
type: 'text',
|
|
90
99
|
message: `What would you like your Android application id to be?`,
|
|
91
100
|
initial: suggestedAndroidApplicationId,
|
|
92
|
-
validate: value => (isApplicationIdValid(value) ? true : INVALID_APPLICATION_ID_MESSAGE),
|
|
101
|
+
validate: value => (isApplicationIdValid(value) ? true : exports.INVALID_APPLICATION_ID_MESSAGE),
|
|
93
102
|
});
|
|
94
103
|
const rawStaticConfig = (0, appJson_1.readAppJson)(paths.staticConfigPath);
|
|
95
104
|
rawStaticConfig.expo = {
|
|
@@ -103,6 +112,7 @@ async function configureApplicationIdAsync(projectDir, exp) {
|
|
|
103
112
|
function isApplicationIdValid(applicationId) {
|
|
104
113
|
return /^[a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*)+$/.test(applicationId);
|
|
105
114
|
}
|
|
115
|
+
exports.isApplicationIdValid = isApplicationIdValid;
|
|
106
116
|
let warnPrinted = false;
|
|
107
117
|
function warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject(projectDir, exp) {
|
|
108
118
|
if (config_plugins_1.AndroidConfig.Package.getPackage(exp) && !warnPrinted) {
|
|
@@ -18,7 +18,7 @@ async function resolveGradleBuildContextAsync(projectDir, buildProfile) {
|
|
|
18
18
|
: undefined;
|
|
19
19
|
if ((parsedGradleCommand === null || parsedGradleCommand === void 0 ? void 0 : parsedGradleCommand.moduleName) &&
|
|
20
20
|
parsedGradleCommand.moduleName !== gradleUtils.DEFAULT_MODULE_NAME) {
|
|
21
|
-
log_1.default.warn(`Building modules different than "${gradleUtils.DEFAULT_MODULE_NAME}" might result in unexpected behavior
|
|
21
|
+
log_1.default.warn(`Building modules different than "${gradleUtils.DEFAULT_MODULE_NAME}" might result in unexpected behavior.`);
|
|
22
22
|
}
|
|
23
23
|
return {
|
|
24
24
|
moduleName: (_a = parsedGradleCommand === null || parsedGradleCommand === void 0 ? void 0 : parsedGradleCommand.moduleName) !== null && _a !== void 0 ? _a : gradleUtils.DEFAULT_MODULE_NAME,
|
|
@@ -30,7 +30,8 @@ async function resolveGradleBuildContextAsync(projectDir, buildProfile) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
catch (err) {
|
|
33
|
-
log_1.default.warn(`Unable to read project config
|
|
33
|
+
log_1.default.warn(`Unable to read gradle project config: ${err.message}.`);
|
|
34
|
+
log_1.default.warn('Values from app/build.gradle might be resolved incorrectly.');
|
|
34
35
|
return undefined;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
|
+
export declare const INVALID_BUNDLE_IDENTIFIER_MESSAGE = "Invalid format of iOS bundle identifier. Only alphanumeric characters, '.' and '-' are allowed, and each '.' must be followed by a letter.";
|
|
2
3
|
export declare function ensureBundleIdentifierIsDefinedForManagedProjectAsync(projectDir: string, exp: ExpoConfig): Promise<string>;
|
|
3
|
-
export declare
|
|
4
|
+
export declare class AmbiguousBundleIdentifierError extends Error {
|
|
5
|
+
constructor(message?: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function getBundleIdentifierAsync(projectDir: string, exp: ExpoConfig, xcodeContext?: {
|
|
4
8
|
targetName?: string;
|
|
5
9
|
buildConfiguration?: string;
|
|
6
10
|
}): Promise<string>;
|
|
11
|
+
export declare function isBundleIdentifierValid(bundleIdentifier: string): boolean;
|
|
7
12
|
export declare function warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject(projectDir: string, exp: ExpoConfig): void;
|
|
8
13
|
export declare function isWildcardBundleIdentifier(bundleIdentifier: string): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isWildcardBundleIdentifier = exports.warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject = exports.getBundleIdentifierAsync = exports.ensureBundleIdentifierIsDefinedForManagedProjectAsync = void 0;
|
|
3
|
+
exports.isWildcardBundleIdentifier = exports.warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject = exports.isBundleIdentifierValid = exports.getBundleIdentifierAsync = exports.AmbiguousBundleIdentifierError = exports.ensureBundleIdentifierIsDefinedForManagedProjectAsync = exports.INVALID_BUNDLE_IDENTIFIER_MESSAGE = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_1 = require("@expo/config");
|
|
6
6
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
@@ -14,7 +14,7 @@ const prompts_1 = require("../../prompts");
|
|
|
14
14
|
const actions_1 = require("../../user/actions");
|
|
15
15
|
const projectUtils_1 = require("../projectUtils");
|
|
16
16
|
const workflow_1 = require("../workflow");
|
|
17
|
-
|
|
17
|
+
exports.INVALID_BUNDLE_IDENTIFIER_MESSAGE = `Invalid format of iOS bundle identifier. Only alphanumeric characters, '.' and '-' are allowed, and each '.' must be followed by a letter.`;
|
|
18
18
|
async function ensureBundleIdentifierIsDefinedForManagedProjectAsync(projectDir, exp) {
|
|
19
19
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
20
20
|
(0, assert_1.default)(workflow === eas_build_job_1.Workflow.MANAGED, 'This function should be called only for managed projects');
|
|
@@ -26,16 +26,25 @@ async function ensureBundleIdentifierIsDefinedForManagedProjectAsync(projectDir,
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
exports.ensureBundleIdentifierIsDefinedForManagedProjectAsync = ensureBundleIdentifierIsDefinedForManagedProjectAsync;
|
|
29
|
-
|
|
29
|
+
class AmbiguousBundleIdentifierError extends Error {
|
|
30
|
+
constructor(message) {
|
|
31
|
+
super(message !== null && message !== void 0 ? message : 'Could not resolve bundle identifier.');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.AmbiguousBundleIdentifierError = AmbiguousBundleIdentifierError;
|
|
35
|
+
async function getBundleIdentifierAsync(projectDir, exp, xcodeContext) {
|
|
30
36
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
31
37
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
32
38
|
warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject(projectDir, exp);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
const xcodeProject = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(projectDir);
|
|
40
|
+
const isMultiScheme = config_plugins_1.IOSConfig.BuildScheme.getSchemesFromXcodeproj(projectDir).length > 1;
|
|
41
|
+
const isMultiTarget = config_plugins_1.IOSConfig.Target.getNativeTargets(xcodeProject).filter(([, target]) => config_plugins_1.IOSConfig.Target.isTargetOfType(target, config_plugins_1.IOSConfig.Target.TargetType.APPLICATION)).length > 1;
|
|
42
|
+
if (!xcodeContext && isMultiScheme && isMultiTarget) {
|
|
43
|
+
throw new AmbiguousBundleIdentifierError("Multiple schemes and targets found in Xcode project, bundle identifier couldn't be resolved.");
|
|
44
|
+
}
|
|
45
|
+
const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifierFromPbxproj(projectDir, xcodeContext !== null && xcodeContext !== void 0 ? xcodeContext : {});
|
|
46
|
+
const buildConfigurationDesc = (xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.targetName) && (xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.buildConfiguration)
|
|
47
|
+
? ` (target = ${xcodeContext.targetName}, build configuration = ${xcodeContext.buildConfiguration})`
|
|
39
48
|
: '';
|
|
40
49
|
(0, assert_1.default)(bundleIdentifier, `Could not read bundle identifier from Xcode project${buildConfigurationDesc}.`);
|
|
41
50
|
if (!isBundleIdentifierValid(bundleIdentifier)) {
|
|
@@ -45,17 +54,18 @@ async function getBundleIdentifierAsync(projectDir, exp, { targetName, buildConf
|
|
|
45
54
|
}
|
|
46
55
|
else {
|
|
47
56
|
// TODO: the following asserts are only temporary until we support app extensions in managed projects
|
|
48
|
-
(0, assert_1.default)(!
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
(0, assert_1.default)(!(xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.targetName) ||
|
|
58
|
+
(xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.targetName) === config_plugins_1.IOSConfig.XcodeUtils.sanitizedName(exp.name), 'targetName cannot be set to an arbitrary value for managed projects.');
|
|
59
|
+
(0, assert_1.default)(!(xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.buildConfiguration), 'buildConfiguration cannot be passed for managed projects.');
|
|
60
|
+
const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifier(exp);
|
|
61
|
+
if (!bundleIdentifier || !isBundleIdentifierValid(bundleIdentifier)) {
|
|
62
|
+
if (bundleIdentifier) {
|
|
63
|
+
log_1.default.warn(exports.INVALID_BUNDLE_IDENTIFIER_MESSAGE);
|
|
54
64
|
}
|
|
55
65
|
throw new Error(`Specify "ios.bundleIdentifier" in ${(0, projectUtils_1.getProjectConfigDescription)(projectDir)} and run this command again.`);
|
|
56
66
|
}
|
|
57
67
|
else {
|
|
58
|
-
return
|
|
68
|
+
return bundleIdentifier;
|
|
59
69
|
}
|
|
60
70
|
}
|
|
61
71
|
}
|
|
@@ -65,7 +75,7 @@ async function configureBundleIdentifierAsync(projectDir, exp) {
|
|
|
65
75
|
const paths = (0, config_1.getConfigFilePaths)(projectDir);
|
|
66
76
|
// we can't automatically update app.config.js
|
|
67
77
|
if (paths.dynamicConfigPath) {
|
|
68
|
-
throw new Error(`"ios.bundleIdentifier" is not defined in your app.config.js and we can't update this file
|
|
78
|
+
throw new Error(`"ios.bundleIdentifier" is not defined in your app.config.js and we can't update this file programmatically. Add the value on your own and run this command again.`);
|
|
69
79
|
}
|
|
70
80
|
(0, assert_1.default)(paths.staticConfigPath, 'app.json must exist');
|
|
71
81
|
log_1.default.addNewLineIfNone();
|
|
@@ -76,7 +86,7 @@ async function configureBundleIdentifierAsync(projectDir, exp) {
|
|
|
76
86
|
type: 'text',
|
|
77
87
|
message: `What would you like your iOS bundle identifier to be?`,
|
|
78
88
|
initial: suggestedBundleIdentifier,
|
|
79
|
-
validate: value => (isBundleIdentifierValid(value) ? true : INVALID_BUNDLE_IDENTIFIER_MESSAGE),
|
|
89
|
+
validate: value => (isBundleIdentifierValid(value) ? true : exports.INVALID_BUNDLE_IDENTIFIER_MESSAGE),
|
|
80
90
|
});
|
|
81
91
|
const rawStaticConfig = (0, appJson_1.readAppJson)(paths.staticConfigPath);
|
|
82
92
|
rawStaticConfig.expo = {
|
|
@@ -90,6 +100,7 @@ async function configureBundleIdentifierAsync(projectDir, exp) {
|
|
|
90
100
|
function isBundleIdentifierValid(bundleIdentifier) {
|
|
91
101
|
return /^[a-zA-Z0-9-.]+$/.test(bundleIdentifier);
|
|
92
102
|
}
|
|
103
|
+
exports.isBundleIdentifierValid = isBundleIdentifierValid;
|
|
93
104
|
let warnPrinted = false;
|
|
94
105
|
function warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject(projectDir, exp) {
|
|
95
106
|
if (config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifier(exp) && !warnPrinted) {
|
|
@@ -7,9 +7,8 @@ export default class AndroidSubmitCommand {
|
|
|
7
7
|
runAsync(): Promise<SubmissionFragment>;
|
|
8
8
|
private getAndroidSubmissionOptionsAsync;
|
|
9
9
|
private maybeGetAndroidPackageFromCurrentProjectAsync;
|
|
10
|
-
private resolveAndroidPackageSourceAsync;
|
|
11
10
|
private resolveTrack;
|
|
12
11
|
private resolveReleaseStatus;
|
|
13
12
|
private resolveArchiveSource;
|
|
14
|
-
private
|
|
13
|
+
private resolveServiceAccountSourceAsync;
|
|
15
14
|
}
|
|
@@ -7,10 +7,8 @@ const results_1 = require("@expo/results");
|
|
|
7
7
|
const generated_1 = require("../../graphql/generated");
|
|
8
8
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
9
9
|
const applicationId_1 = require("../../project/android/applicationId");
|
|
10
|
-
const gradleUtils = (0, tslib_1.__importStar)(require("../../project/android/gradleUtils"));
|
|
11
10
|
const capitalize_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/capitalize"));
|
|
12
11
|
const commons_1 = require("../commons");
|
|
13
|
-
const AndroidPackageSource_1 = require("./AndroidPackageSource");
|
|
14
12
|
const AndroidSubmitter_1 = (0, tslib_1.__importDefault)(require("./AndroidSubmitter"));
|
|
15
13
|
const ServiceAccountSource_1 = require("./ServiceAccountSource");
|
|
16
14
|
class AndroidSubmitCommand {
|
|
@@ -24,18 +22,11 @@ class AndroidSubmitCommand {
|
|
|
24
22
|
return await submitter.submitAsync();
|
|
25
23
|
}
|
|
26
24
|
async getAndroidSubmissionOptionsAsync() {
|
|
27
|
-
const androidPackageSource = await this.resolveAndroidPackageSourceAsync();
|
|
28
25
|
const track = this.resolveTrack();
|
|
29
26
|
const releaseStatus = this.resolveReleaseStatus();
|
|
30
27
|
const archiveSource = this.resolveArchiveSource();
|
|
31
|
-
const serviceAccountSource = this.
|
|
32
|
-
const errored = [
|
|
33
|
-
androidPackageSource,
|
|
34
|
-
track,
|
|
35
|
-
releaseStatus,
|
|
36
|
-
archiveSource,
|
|
37
|
-
serviceAccountSource,
|
|
38
|
-
].filter(r => !r.ok);
|
|
28
|
+
const serviceAccountSource = await this.resolveServiceAccountSourceAsync();
|
|
29
|
+
const errored = [track, releaseStatus, archiveSource, serviceAccountSource].filter(r => !r.ok);
|
|
39
30
|
if (errored.length > 0) {
|
|
40
31
|
const message = errored.map(err => { var _a; return (_a = err.reason) === null || _a === void 0 ? void 0 : _a.message; }).join('\n');
|
|
41
32
|
log_1.default.error(message);
|
|
@@ -43,7 +34,6 @@ class AndroidSubmitCommand {
|
|
|
43
34
|
}
|
|
44
35
|
return {
|
|
45
36
|
projectId: this.ctx.projectId,
|
|
46
|
-
androidPackageSource: androidPackageSource.enforceValue(),
|
|
47
37
|
track: track.enforceValue(),
|
|
48
38
|
releaseStatus: releaseStatus.enforceValue(),
|
|
49
39
|
archiveSource: archiveSource.enforceValue(),
|
|
@@ -53,29 +43,14 @@ class AndroidSubmitCommand {
|
|
|
53
43
|
}
|
|
54
44
|
async maybeGetAndroidPackageFromCurrentProjectAsync() {
|
|
55
45
|
try {
|
|
56
|
-
return await (0, applicationId_1.getApplicationIdAsync)(this.ctx.projectDir, this.ctx.exp
|
|
57
|
-
moduleName: gradleUtils.DEFAULT_MODULE_NAME,
|
|
58
|
-
});
|
|
46
|
+
return (0, results_1.result)(await (0, applicationId_1.getApplicationIdAsync)(this.ctx.projectDir, this.ctx.exp));
|
|
59
47
|
}
|
|
60
|
-
catch {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (androidPackage) {
|
|
67
|
-
return (0, results_1.result)({
|
|
68
|
-
sourceType: AndroidPackageSource_1.AndroidPackageSourceType.userDefined,
|
|
69
|
-
androidPackage,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
else if (this.ctx.nonInteractive) {
|
|
73
|
-
return (0, results_1.result)(new Error("Couldn't resolve the Android package."));
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
return (0, results_1.result)({
|
|
77
|
-
sourceType: AndroidPackageSource_1.AndroidPackageSourceType.prompt,
|
|
78
|
-
});
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (error instanceof applicationId_1.AmbiguousApplicationIdError) {
|
|
50
|
+
log_1.default.warn('"applicationId" is ambiguous, specify it via "applicationId" field in the submit profile in the eas.json.');
|
|
51
|
+
return (0, results_1.result)(null);
|
|
52
|
+
}
|
|
53
|
+
return (0, results_1.result)(new Error(`Failed to resolve applicationId in Android project: ${error.message}.`));
|
|
79
54
|
}
|
|
80
55
|
}
|
|
81
56
|
resolveTrack() {
|
|
@@ -112,7 +87,8 @@ class AndroidSubmitCommand {
|
|
|
112
87
|
return (0, results_1.result)(err);
|
|
113
88
|
}
|
|
114
89
|
}
|
|
115
|
-
|
|
90
|
+
async resolveServiceAccountSourceAsync() {
|
|
91
|
+
var _a;
|
|
116
92
|
const { serviceAccountKeyPath } = this.ctx.profile;
|
|
117
93
|
if (serviceAccountKeyPath) {
|
|
118
94
|
return (0, results_1.result)({
|
|
@@ -120,8 +96,20 @@ class AndroidSubmitCommand {
|
|
|
120
96
|
path: serviceAccountKeyPath,
|
|
121
97
|
});
|
|
122
98
|
}
|
|
99
|
+
let androidApplicationIdentifier = (_a = this.ctx.applicationIdentifierOverride) !== null && _a !== void 0 ? _a : this.ctx.profile.applicationId;
|
|
100
|
+
if (!androidApplicationIdentifier) {
|
|
101
|
+
const androidApplicationIdentifierResult = await this.maybeGetAndroidPackageFromCurrentProjectAsync();
|
|
102
|
+
if (!androidApplicationIdentifierResult.ok) {
|
|
103
|
+
return (0, results_1.result)(androidApplicationIdentifierResult.reason);
|
|
104
|
+
}
|
|
105
|
+
const androidApplicationIdentifierValue = androidApplicationIdentifierResult.enforceValue();
|
|
106
|
+
if (androidApplicationIdentifierValue) {
|
|
107
|
+
androidApplicationIdentifier = androidApplicationIdentifierValue;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
123
110
|
return (0, results_1.result)({
|
|
124
111
|
sourceType: ServiceAccountSource_1.ServiceAccountSourceType.credentialsService,
|
|
112
|
+
androidApplicationIdentifier,
|
|
125
113
|
});
|
|
126
114
|
}
|
|
127
115
|
}
|
|
@@ -3,11 +3,9 @@ import { AndroidSubmissionConfigInput, SubmissionFragment } from '../../graphql/
|
|
|
3
3
|
import { Archive, ArchiveSource } from '../ArchiveSource';
|
|
4
4
|
import BaseSubmitter, { SubmissionInput } from '../BaseSubmitter';
|
|
5
5
|
import { SubmissionContext } from '../context';
|
|
6
|
-
import { AndroidPackageSource } from './AndroidPackageSource';
|
|
7
6
|
import { ServiceAccountKeyResult, ServiceAccountSource } from './ServiceAccountSource';
|
|
8
7
|
export interface AndroidSubmissionOptions extends Pick<AndroidSubmissionConfigInput, 'track' | 'releaseStatus' | 'changesNotSentForReview'> {
|
|
9
8
|
projectId: string;
|
|
10
|
-
androidPackageSource: AndroidPackageSource;
|
|
11
9
|
archiveSource: ArchiveSource;
|
|
12
10
|
serviceAccountSource: ServiceAccountSource;
|
|
13
11
|
}
|
|
@@ -8,7 +8,6 @@ const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatF
|
|
|
8
8
|
const ArchiveSource_1 = require("../ArchiveSource");
|
|
9
9
|
const BaseSubmitter_1 = (0, tslib_1.__importDefault)(require("../BaseSubmitter"));
|
|
10
10
|
const summary_1 = require("../utils/summary");
|
|
11
|
-
const AndroidPackageSource_1 = require("./AndroidPackageSource");
|
|
12
11
|
const ServiceAccountSource_1 = require("./ServiceAccountSource");
|
|
13
12
|
class AndroidSubmitter extends BaseSubmitter_1.default {
|
|
14
13
|
constructor(ctx, options) {
|
|
@@ -17,8 +16,7 @@ class AndroidSubmitter extends BaseSubmitter_1.default {
|
|
|
17
16
|
archive: async () => await (0, ArchiveSource_1.getArchiveAsync)(this.options.archiveSource),
|
|
18
17
|
// eslint-disable-next-line async-protect/async-suffix
|
|
19
18
|
serviceAccountKeyResult: async () => {
|
|
20
|
-
|
|
21
|
-
return await (0, ServiceAccountSource_1.getServiceAccountKeyResultAsync)(this.ctx, this.options.serviceAccountSource, androidPackage);
|
|
19
|
+
return await (0, ServiceAccountSource_1.getServiceAccountKeyResultAsync)(this.ctx, this.options.serviceAccountSource);
|
|
22
20
|
},
|
|
23
21
|
};
|
|
24
22
|
const sourceOptionsAnalytics = {
|
|
@@ -17,6 +17,7 @@ interface ServiceAccountPromptSource extends ServiceAccountSourceBase {
|
|
|
17
17
|
}
|
|
18
18
|
export interface ServiceAccountCredentialsServiceSource extends ServiceAccountSourceBase {
|
|
19
19
|
sourceType: ServiceAccountSourceType.credentialsService;
|
|
20
|
+
androidApplicationIdentifier?: string;
|
|
20
21
|
}
|
|
21
22
|
export declare type ServiceAccountKeyResult = {
|
|
22
23
|
result: ServiceAccountKeyFile | ServiceAccountKeyFromExpoServers;
|
|
@@ -34,7 +35,7 @@ declare type ServiceAccountKeyFromExpoServers = {
|
|
|
34
35
|
googleServiceAccountKeyId: string;
|
|
35
36
|
};
|
|
36
37
|
export declare type ServiceAccountSource = ServiceAccountPathSource | ServiceAccountPromptSource | ServiceAccountCredentialsServiceSource;
|
|
37
|
-
export declare function getServiceAccountKeyResultAsync(ctx: SubmissionContext<Platform.ANDROID>, source: ServiceAccountSource
|
|
38
|
+
export declare function getServiceAccountKeyResultAsync(ctx: SubmissionContext<Platform.ANDROID>, source: ServiceAccountSource): Promise<ServiceAccountKeyResult>;
|
|
38
39
|
export declare function getServiceAccountKeyPathAsync(source: ServiceAccountSource): Promise<string>;
|
|
39
|
-
export declare function getServiceAccountFromCredentialsServiceAsync(ctx: SubmissionContext<Platform.ANDROID>,
|
|
40
|
+
export declare function getServiceAccountFromCredentialsServiceAsync(ctx: SubmissionContext<Platform.ANDROID>, source: ServiceAccountCredentialsServiceSource): Promise<ServiceAccountKeyResult>;
|
|
40
41
|
export {};
|
|
@@ -8,6 +8,7 @@ const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
|
|
|
8
8
|
const SetUpGoogleServiceAccountKey_1 = require("../../credentials/android/actions/SetUpGoogleServiceAccountKey");
|
|
9
9
|
const googleServiceAccountKey_1 = require("../../credentials/android/utils/googleServiceAccountKey");
|
|
10
10
|
const log_1 = (0, tslib_1.__importStar)(require("../../log"));
|
|
11
|
+
const applicationId_1 = require("../../project/android/applicationId");
|
|
11
12
|
const prompts_1 = require("../../prompts");
|
|
12
13
|
const Account_1 = require("../../user/Account");
|
|
13
14
|
const files_1 = require("../utils/files");
|
|
@@ -17,9 +18,9 @@ var ServiceAccountSourceType;
|
|
|
17
18
|
ServiceAccountSourceType[ServiceAccountSourceType["prompt"] = 1] = "prompt";
|
|
18
19
|
ServiceAccountSourceType[ServiceAccountSourceType["credentialsService"] = 2] = "credentialsService";
|
|
19
20
|
})(ServiceAccountSourceType = exports.ServiceAccountSourceType || (exports.ServiceAccountSourceType = {}));
|
|
20
|
-
async function getServiceAccountKeyResultAsync(ctx, source
|
|
21
|
+
async function getServiceAccountKeyResultAsync(ctx, source) {
|
|
21
22
|
if (source.sourceType === ServiceAccountSourceType.credentialsService) {
|
|
22
|
-
return await getServiceAccountFromCredentialsServiceAsync(ctx,
|
|
23
|
+
return await getServiceAccountFromCredentialsServiceAsync(ctx, source);
|
|
23
24
|
}
|
|
24
25
|
else {
|
|
25
26
|
return await getServiceAccountLocallyAsync(source);
|
|
@@ -50,12 +51,23 @@ async function getServiceAccountKeyPathAsync(source) {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
exports.getServiceAccountKeyPathAsync = getServiceAccountKeyPathAsync;
|
|
53
|
-
async function
|
|
54
|
+
async function promptForApplicationIdAsync() {
|
|
55
|
+
const { androidPackage } = await (0, prompts_1.promptAsync)({
|
|
56
|
+
name: 'androidPackage',
|
|
57
|
+
message: 'Android package name:',
|
|
58
|
+
type: 'text',
|
|
59
|
+
validate: value => ((0, applicationId_1.isApplicationIdValid)(value) ? true : applicationId_1.INVALID_APPLICATION_ID_MESSAGE),
|
|
60
|
+
});
|
|
61
|
+
return androidPackage;
|
|
62
|
+
}
|
|
63
|
+
async function getServiceAccountFromCredentialsServiceAsync(ctx, source) {
|
|
64
|
+
var _a;
|
|
54
65
|
const appLookupParams = {
|
|
55
66
|
account: (0, nullthrows_1.default)((0, Account_1.findAccountByName)(ctx.user.accounts, ctx.accountName), `You do not have access to account: ${ctx.accountName}`),
|
|
56
67
|
projectName: ctx.projectName,
|
|
57
|
-
androidApplicationIdentifier,
|
|
68
|
+
androidApplicationIdentifier: (_a = source.androidApplicationIdentifier) !== null && _a !== void 0 ? _a : (await promptForApplicationIdAsync()),
|
|
58
69
|
};
|
|
70
|
+
log_1.default.log(`Looking up credentials configuration for ${appLookupParams.androidApplicationIdentifier}...`);
|
|
59
71
|
const setupGoogleServiceAccountKeyAction = new SetUpGoogleServiceAccountKey_1.SetUpGoogleServiceAccountKey(appLookupParams);
|
|
60
72
|
const androidAppCredentials = await setupGoogleServiceAccountKeyAction.runAsync(ctx.credentialsCtx);
|
|
61
73
|
const googleServiceAccountKey = (0, nullthrows_1.default)(androidAppCredentials.googleServiceAccountKeyForSubmissions, 'Credentials Service must provide a valid GoogleServiceAccountKey');
|
|
@@ -17,6 +17,7 @@ export interface SubmissionContext<T extends Platform> {
|
|
|
17
17
|
projectId: string;
|
|
18
18
|
projectName: string;
|
|
19
19
|
user: Actor;
|
|
20
|
+
applicationIdentifierOverride?: string;
|
|
20
21
|
}
|
|
21
22
|
export interface SubmitArchiveFlags {
|
|
22
23
|
latest?: boolean;
|
|
@@ -33,4 +34,5 @@ export declare function createSubmissionContextAsync<T extends Platform>(params:
|
|
|
33
34
|
profile: SubmitProfile<T>;
|
|
34
35
|
projectDir: string;
|
|
35
36
|
projectId: string;
|
|
37
|
+
applicationIdentifier?: string;
|
|
36
38
|
}): Promise<SubmissionContext<T>>;
|
package/build/submit/context.js
CHANGED
|
@@ -10,7 +10,7 @@ const Account_1 = require("../user/Account");
|
|
|
10
10
|
const actions_1 = require("../user/actions");
|
|
11
11
|
async function createSubmissionContextAsync(params) {
|
|
12
12
|
var _a;
|
|
13
|
-
const { projectDir, nonInteractive } = params;
|
|
13
|
+
const { applicationIdentifier, projectDir, nonInteractive } = params;
|
|
14
14
|
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: params.env });
|
|
15
15
|
const { env, ...rest } = params;
|
|
16
16
|
const user = await (0, actions_1.ensureLoggedInAsync)();
|
|
@@ -37,6 +37,7 @@ async function createSubmissionContextAsync(params) {
|
|
|
37
37
|
projectName,
|
|
38
38
|
user,
|
|
39
39
|
trackingCtx,
|
|
40
|
+
applicationIdentifierOverride: applicationIdentifier,
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
exports.createSubmissionContextAsync = createSubmissionContextAsync;
|