@expo/build-tools 18.4.0 → 18.6.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.
Files changed (46) hide show
  1. package/dist/builders/android.js +13 -1
  2. package/dist/builders/ios.js +1 -1
  3. package/dist/common/setup.js +4 -3
  4. package/dist/context.d.ts +1 -1
  5. package/dist/context.js +1 -1
  6. package/dist/ios/configure.js +4 -0
  7. package/dist/ios/credentials/provisioningProfile.d.ts +1 -0
  8. package/dist/ios/credentials/provisioningProfile.js +5 -0
  9. package/dist/steps/easFunctions.js +0 -2
  10. package/dist/steps/functionGroups/build.js +115 -34
  11. package/dist/steps/functionGroups/maestroTest.js +0 -3
  12. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +2 -2
  13. package/dist/steps/functions/configureEASUpdateIfInstalled.js +2 -2
  14. package/dist/steps/functions/repack.js +20 -3
  15. package/dist/steps/functions/restoreBuildCache.d.ts +8 -0
  16. package/dist/steps/functions/restoreBuildCache.js +85 -0
  17. package/dist/steps/functions/saveBuildCache.d.ts +8 -0
  18. package/dist/steps/functions/saveBuildCache.js +57 -0
  19. package/dist/steps/functions/startAndroidEmulator.js +19 -0
  20. package/dist/steps/functions/uploadToAsc.d.ts +3 -0
  21. package/dist/steps/functions/uploadToAsc.js +24 -1
  22. package/dist/steps/utils/ios/AscApiClient.d.ts +1 -1
  23. package/dist/steps/utils/ios/AscApiUtils.d.ts +5 -0
  24. package/dist/steps/utils/ios/AscApiUtils.js +16 -13
  25. package/dist/steps/utils/ios/configure.js +4 -0
  26. package/dist/steps/utils/ios/credentials/provisioningProfile.d.ts +1 -0
  27. package/dist/steps/utils/ios/credentials/provisioningProfile.js +5 -0
  28. package/dist/utils/AndroidEmulatorUtils.d.ts +5 -0
  29. package/dist/utils/AndroidEmulatorUtils.js +17 -0
  30. package/dist/utils/appConfig.d.ts +4 -2
  31. package/dist/utils/appConfig.js +36 -5
  32. package/dist/utils/expoCli.d.ts +4 -0
  33. package/dist/utils/expoCli.js +37 -0
  34. package/dist/utils/expoUpdates.d.ts +1 -1
  35. package/dist/utils/expoUpdates.js +4 -4
  36. package/dist/utils/gradleCacheKey.d.ts +2 -0
  37. package/dist/utils/gradleCacheKey.js +56 -0
  38. package/dist/utils/packageManager.d.ts +10 -0
  39. package/dist/utils/packageManager.js +21 -0
  40. package/dist/utils/project.d.ts +2 -1
  41. package/dist/utils/project.js +29 -2
  42. package/package.json +14 -13
  43. package/dist/steps/functions/internalMaestroTest.d.ts +0 -9
  44. package/dist/steps/functions/internalMaestroTest.js +0 -534
  45. package/dist/utils/findMaestroPathsFlowsToExecuteAsync.d.ts +0 -8
  46. package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js +0 -184
@@ -71,6 +71,12 @@ async function buildAsync(ctx) {
71
71
  env: ctx.env,
72
72
  secrets: ctx.job.secrets,
73
73
  });
74
+ await (0, restoreBuildCache_1.restoreGradleCacheAsync)({
75
+ logger: ctx.logger,
76
+ workingDirectory,
77
+ env: ctx.env,
78
+ secrets: ctx.job.secrets,
79
+ });
74
80
  });
75
81
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.POST_INSTALL_HOOK, async () => {
76
82
  await (0, hooks_1.runHookIfPresent)(ctx, hooks_1.Hook.POST_INSTALL);
@@ -79,7 +85,7 @@ async function buildAsync(ctx) {
79
85
  return await (0, expoUpdates_1.resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync)({
80
86
  cwd: ctx.getReactNativeProjectDirectory(),
81
87
  logger: ctx.logger,
82
- appConfig: ctx.appConfig,
88
+ appConfig: await ctx.appConfig,
83
89
  platform: ctx.job.platform,
84
90
  workflow: ctx.job.type,
85
91
  env: ctx.env,
@@ -169,6 +175,12 @@ async function buildAsync(ctx) {
169
175
  env: ctx.env,
170
176
  secrets: ctx.job.secrets,
171
177
  });
178
+ await (0, saveBuildCache_1.saveGradleCacheAsync)({
179
+ logger: ctx.logger,
180
+ workingDirectory,
181
+ env: ctx.env,
182
+ secrets: ctx.job.secrets,
183
+ });
172
184
  });
173
185
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.CACHE_STATS, async () => {
174
186
  await (0, restoreBuildCache_1.cacheStatsAsync)({
@@ -95,7 +95,7 @@ async function buildAsync(ctx) {
95
95
  return await (0, expoUpdates_1.resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync)({
96
96
  cwd: ctx.getReactNativeProjectDirectory(),
97
97
  logger: ctx.logger,
98
- appConfig: ctx.appConfig,
98
+ appConfig: await ctx.appConfig,
99
99
  platform: ctx.job.platform,
100
100
  workflow: ctx.job.type,
101
101
  env: ctx.env,
@@ -90,17 +90,18 @@ async function setupAsync(ctx) {
90
90
  });
91
91
  });
92
92
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.READ_APP_CONFIG, async () => {
93
- const appConfig = ctx.appConfig;
93
+ const appConfig = await ctx.appConfig;
94
94
  ctx.logger.info('Using app configuration:');
95
95
  ctx.logger.info(JSON.stringify(appConfig, null, 2));
96
96
  await validateAppConfigAsync(ctx, appConfig);
97
97
  });
98
98
  if (ctx.job.triggeredBy === eas_build_job_1.BuildTrigger.GIT_BASED_INTEGRATION) {
99
99
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.EAS_BUILD_INTERNAL, async () => {
100
- if (!ctx.appConfig.ios?.bundleIdentifier && ctx.job.platform === eas_build_job_1.Platform.IOS) {
100
+ const appConfig = await ctx.appConfig;
101
+ if (!appConfig.ios?.bundleIdentifier && ctx.job.platform === eas_build_job_1.Platform.IOS) {
101
102
  throw new Error('The "ios.bundleIdentifier" is required to be set in app config for builds triggered by GitHub integration. Learn more: https://docs.expo.dev/versions/latest/config/app/#bundleidentifier.');
102
103
  }
103
- if (!ctx.appConfig.android?.package && ctx.job.platform === eas_build_job_1.Platform.ANDROID) {
104
+ if (!appConfig.android?.package && ctx.job.platform === eas_build_job_1.Platform.ANDROID) {
104
105
  throw new Error('The "android.package" is required to be set in app config for builds triggered by GitHub integration. Learn more: https://docs.expo.dev/versions/latest/config/app/#package.');
105
106
  }
106
107
  const { newJob, newMetadata } = await (0, easBuildInternal_1.runEasBuildInternalAsync)({
package/dist/context.d.ts CHANGED
@@ -92,7 +92,7 @@ export declare class BuildContext<TJob extends Job = Job> {
92
92
  */
93
93
  get buildEnvsDirectory(): string;
94
94
  get packageManager(): PackageManager;
95
- get appConfig(): ExpoConfig;
95
+ get appConfig(): Promise<ExpoConfig>;
96
96
  runBuildPhase<T>(buildPhase: BuildPhase, phase: () => Promise<T>, { doNotMarkStart, doNotMarkEnd, }?: {
97
97
  doNotMarkStart?: boolean;
98
98
  doNotMarkEnd?: boolean;
package/dist/context.js CHANGED
@@ -113,7 +113,7 @@ class BuildContext {
113
113
  env: this.env,
114
114
  logger: this.logger,
115
115
  sdkVersion: this.metadata?.sdkVersion,
116
- }).exp;
116
+ }).then(config => config.exp);
117
117
  }
118
118
  return this._appConfig;
119
119
  }
@@ -10,6 +10,7 @@ const plist_1 = __importDefault(require("@expo/plist"));
10
10
  const fs_extra_1 = __importDefault(require("fs-extra"));
11
11
  const uniq_1 = __importDefault(require("lodash/uniq"));
12
12
  const path_1 = __importDefault(require("path"));
13
+ const provisioningProfile_1 = require("./credentials/provisioningProfile");
13
14
  async function configureXcodeProject(ctx, { credentials, buildConfiguration, }) {
14
15
  ctx.logger.info('Configuring Xcode project');
15
16
  await configureCredentialsAsync(ctx, {
@@ -35,6 +36,9 @@ async function configureCredentialsAsync(ctx, { credentials, buildConfiguration,
35
36
  profileName: profile.name,
36
37
  appleTeamId: profile.teamId,
37
38
  buildConfiguration,
39
+ ...(credentials.distributionType === provisioningProfile_1.DistributionType.DEVELOPMENT && {
40
+ codeSignIdentity: profile.certificateCommonName,
41
+ }),
38
42
  });
39
43
  }
40
44
  }
@@ -14,6 +14,7 @@ export interface ProvisioningProfileData {
14
14
  export declare enum DistributionType {
15
15
  AD_HOC = "ad-hoc",
16
16
  APP_STORE = "app-store",
17
+ DEVELOPMENT = "development",
17
18
  ENTERPRISE = "enterprise"
18
19
  }
19
20
  export default class ProvisioningProfile<TJob extends Ios.Job> {
@@ -16,6 +16,7 @@ var DistributionType;
16
16
  (function (DistributionType) {
17
17
  DistributionType["AD_HOC"] = "ad-hoc";
18
18
  DistributionType["APP_STORE"] = "app-store";
19
+ DistributionType["DEVELOPMENT"] = "development";
19
20
  DistributionType["ENTERPRISE"] = "enterprise";
20
21
  })(DistributionType || (exports.DistributionType = DistributionType = {}));
21
22
  const PROVISIONING_PROFILES_DIRECTORY = path_1.default.join(os_1.default.homedir(), 'Library/MobileDevice/Provisioning Profiles');
@@ -107,6 +108,10 @@ class ProvisioningProfile {
107
108
  return DistributionType.ENTERPRISE;
108
109
  }
109
110
  else if (plistData.ProvisionedDevices) {
111
+ const entitlements = plistData.Entitlements;
112
+ if (entitlements?.['get-task-allow']) {
113
+ return DistributionType.DEVELOPMENT;
114
+ }
110
115
  return DistributionType.AD_HOC;
111
116
  }
112
117
  else {
@@ -18,7 +18,6 @@ const injectAndroidCredentials_1 = require("./functions/injectAndroidCredentials
18
18
  const installMaestro_1 = require("./functions/installMaestro");
19
19
  const installNodeModules_1 = require("./functions/installNodeModules");
20
20
  const installPods_1 = require("./functions/installPods");
21
- const internalMaestroTest_1 = require("./functions/internalMaestroTest");
22
21
  const prebuild_1 = require("./functions/prebuild");
23
22
  const readIpaInfo_1 = require("./functions/readIpaInfo");
24
23
  const repack_1 = require("./functions/repack");
@@ -73,7 +72,6 @@ function getEasFunctions(ctx) {
73
72
  (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)(),
74
73
  (0, createSubmissionEntity_1.createSubmissionEntityFunction)(),
75
74
  (0, uploadToAsc_1.createUploadToAscBuildFunction)(),
76
- (0, internalMaestroTest_1.createInternalEasMaestroTestFunction)(ctx),
77
75
  (0, reportMaestroTestResults_1.createReportMaestroTestResultsFunction)(ctx),
78
76
  ];
79
77
  if (ctx.hasBuildJob()) {
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.createEasBuildBuildFunctionGroup = createEasBuildBuildFunctionGroup;
4
7
  const eas_build_job_1 = require("@expo/eas-build-job");
5
8
  const steps_1 = require("@expo/steps");
9
+ const path_1 = __importDefault(require("path"));
6
10
  const eagerBundle_1 = require("../../common/eagerBundle");
7
11
  const calculateEASUpdateRuntimeVersion_1 = require("../functions/calculateEASUpdateRuntimeVersion");
8
12
  const checkout_1 = require("../functions/checkout");
@@ -28,18 +32,30 @@ function createEasBuildBuildFunctionGroup(buildToolsContext) {
28
32
  return new steps_1.BuildFunctionGroup({
29
33
  namespace: 'eas',
30
34
  id: 'build',
31
- createBuildStepsFromFunctionGroupCall: globalCtx => {
35
+ inputProviders: [
36
+ steps_1.BuildStepInput.createProvider({
37
+ id: 'working_directory',
38
+ required: false,
39
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
40
+ }),
41
+ ],
42
+ createBuildStepsFromFunctionGroupCall: (globalCtx, { inputs }) => {
43
+ const workingDirectory = inputs.working_directory?.getValue({
44
+ interpolationContext: globalCtx.getInterpolationContext(),
45
+ });
32
46
  if (buildToolsContext.job.platform === eas_build_job_1.Platform.IOS) {
33
47
  if (buildToolsContext.job.simulator) {
34
48
  return createStepsForIosSimulatorBuild({
35
49
  globalCtx,
36
50
  buildToolsContext,
51
+ workingDirectory,
37
52
  });
38
53
  }
39
54
  else {
40
55
  return createStepsForIosBuildWithCredentials({
41
56
  globalCtx,
42
57
  buildToolsContext,
58
+ workingDirectory,
43
59
  });
44
60
  }
45
61
  }
@@ -48,12 +64,14 @@ function createEasBuildBuildFunctionGroup(buildToolsContext) {
48
64
  return createStepsForAndroidBuildWithoutCredentials({
49
65
  globalCtx,
50
66
  buildToolsContext,
67
+ workingDirectory,
51
68
  });
52
69
  }
53
70
  else {
54
71
  return createStepsForAndroidBuildWithCredentials({
55
72
  globalCtx,
56
73
  buildToolsContext,
74
+ workingDirectory,
57
75
  });
58
76
  }
59
77
  }
@@ -61,14 +79,16 @@ function createEasBuildBuildFunctionGroup(buildToolsContext) {
61
79
  },
62
80
  });
63
81
  }
64
- function createStepsForIosSimulatorBuild({ globalCtx, buildToolsContext, }) {
82
+ function createStepsForIosSimulatorBuild({ globalCtx, buildToolsContext, workingDirectory, }) {
65
83
  const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
66
84
  id: 'calculate_eas_update_runtime_version',
85
+ workingDirectory,
67
86
  });
68
87
  const installPods = (0, installPods_1.createInstallPodsBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
69
- workingDirectory: './ios',
88
+ workingDirectory: workingDirectory ? path_1.default.join(workingDirectory, './ios') : './ios',
70
89
  });
71
90
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
91
+ workingDirectory,
72
92
  callInputs: {
73
93
  throw_if_not_configured: false,
74
94
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
@@ -76,92 +96,119 @@ function createStepsForIosSimulatorBuild({ globalCtx, buildToolsContext, }) {
76
96
  });
77
97
  const runFastlane = (0, runFastlane_1.runFastlaneFunction)().createBuildStepFromFunctionCall(globalCtx, {
78
98
  id: 'run_fastlane',
99
+ workingDirectory,
79
100
  callInputs: {
80
101
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
81
102
  },
82
103
  });
83
104
  return [
84
105
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
85
- (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
86
- (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
87
- (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
88
- (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
106
+ (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
107
+ workingDirectory,
108
+ }),
109
+ (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
110
+ workingDirectory,
111
+ }),
112
+ (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
113
+ (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
114
+ workingDirectory,
115
+ }),
89
116
  calculateEASUpdateRuntimeVersion,
90
117
  installPods,
91
118
  configureEASUpdate,
92
119
  ...((0, eagerBundle_1.shouldUseEagerBundle)(globalCtx.staticContext.metadata)
93
120
  ? [
94
121
  (0, eagerBundle_2.eagerBundleBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
122
+ workingDirectory,
95
123
  callInputs: {
96
124
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
97
125
  },
98
126
  }),
99
127
  ]
100
128
  : []),
101
- (0, generateGymfileFromTemplate_1.generateGymfileFromTemplateFunction)().createBuildStepFromFunctionCall(globalCtx),
129
+ (0, generateGymfileFromTemplate_1.generateGymfileFromTemplateFunction)().createBuildStepFromFunctionCall(globalCtx, {
130
+ workingDirectory,
131
+ }),
102
132
  runFastlane,
103
- (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
133
+ (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
104
134
  ];
105
135
  }
106
- function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }) {
136
+ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, workingDirectory, }) {
107
137
  const evictUsedBefore = new Date();
108
138
  const resolveAppleTeamIdFromCredentials = (0, resolveAppleTeamIdFromCredentials_1.resolveAppleTeamIdFromCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx, {
109
139
  id: 'resolve_apple_team_id_from_credentials',
140
+ workingDirectory,
110
141
  });
111
142
  const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
112
143
  id: 'calculate_eas_update_runtime_version',
144
+ workingDirectory,
113
145
  });
114
146
  const prebuildStep = (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
147
+ workingDirectory,
115
148
  callInputs: {
116
149
  apple_team_id: '${ steps.resolve_apple_team_id_from_credentials.apple_team_id }',
117
150
  },
118
151
  });
119
152
  const restoreCache = (0, restoreBuildCache_1.createRestoreBuildCacheFunction)().createBuildStepFromFunctionCall(globalCtx, {
153
+ workingDirectory,
120
154
  callInputs: {
121
155
  platform: eas_build_job_1.Platform.IOS,
122
156
  },
123
157
  });
124
158
  const installPods = (0, installPods_1.createInstallPodsBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
125
- workingDirectory: './ios',
159
+ workingDirectory: workingDirectory ? path_1.default.join(workingDirectory, './ios') : './ios',
126
160
  });
127
161
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
162
+ workingDirectory,
128
163
  callInputs: {
129
164
  throw_if_not_configured: false,
130
165
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
131
166
  },
132
167
  });
133
168
  const generateGymfile = (0, generateGymfileFromTemplate_1.generateGymfileFromTemplateFunction)().createBuildStepFromFunctionCall(globalCtx, {
169
+ workingDirectory,
134
170
  callInputs: {
135
171
  credentials: '${ eas.job.secrets.buildCredentials }',
136
172
  },
137
173
  });
138
174
  const runFastlane = (0, runFastlane_1.runFastlaneFunction)().createBuildStepFromFunctionCall(globalCtx, {
139
175
  id: 'run_fastlane',
176
+ workingDirectory,
140
177
  callInputs: {
141
178
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
142
179
  },
143
180
  });
144
181
  const saveCache = (0, saveBuildCache_1.createSaveBuildCacheFunction)(evictUsedBefore).createBuildStepFromFunctionCall(globalCtx, {
182
+ workingDirectory,
145
183
  callInputs: {
146
184
  platform: eas_build_job_1.Platform.IOS,
147
185
  },
148
186
  });
149
187
  return [
150
188
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
151
- (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
152
- (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
153
- (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
189
+ (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
190
+ workingDirectory,
191
+ }),
192
+ (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
193
+ workingDirectory,
194
+ }),
195
+ (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
154
196
  resolveAppleTeamIdFromCredentials,
155
197
  prebuildStep,
156
198
  restoreCache,
157
199
  calculateEASUpdateRuntimeVersion,
158
200
  installPods,
159
201
  configureEASUpdate,
160
- (0, configureIosCredentials_1.configureIosCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx),
161
- (0, configureIosVersion_1.configureIosVersionFunction)().createBuildStepFromFunctionCall(globalCtx),
202
+ (0, configureIosCredentials_1.configureIosCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx, {
203
+ workingDirectory,
204
+ }),
205
+ (0, configureIosVersion_1.configureIosVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
206
+ workingDirectory,
207
+ }),
162
208
  ...((0, eagerBundle_1.shouldUseEagerBundle)(globalCtx.staticContext.metadata)
163
209
  ? [
164
210
  (0, eagerBundle_2.eagerBundleBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
211
+ workingDirectory,
165
212
  callInputs: {
166
213
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
167
214
  },
@@ -170,50 +217,64 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }
170
217
  : []),
171
218
  generateGymfile,
172
219
  runFastlane,
173
- (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
220
+ (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
174
221
  saveCache,
175
- (0, restoreBuildCache_1.createCacheStatsBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
222
+ (0, restoreBuildCache_1.createCacheStatsBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
223
+ workingDirectory,
224
+ }),
176
225
  ];
177
226
  }
178
- function createStepsForAndroidBuildWithoutCredentials({ globalCtx, buildToolsContext, }) {
227
+ function createStepsForAndroidBuildWithoutCredentials({ globalCtx, buildToolsContext, workingDirectory, }) {
179
228
  const evictUsedBefore = new Date();
180
229
  const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
181
230
  id: 'calculate_eas_update_runtime_version',
231
+ workingDirectory,
182
232
  });
183
233
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
234
+ workingDirectory,
184
235
  callInputs: {
185
236
  throw_if_not_configured: false,
186
237
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
187
238
  },
188
239
  });
189
240
  const restoreCache = (0, restoreBuildCache_1.createRestoreBuildCacheFunction)().createBuildStepFromFunctionCall(globalCtx, {
241
+ workingDirectory,
190
242
  callInputs: {
191
243
  platform: eas_build_job_1.Platform.ANDROID,
192
244
  },
193
245
  });
194
246
  const runGradle = (0, runGradle_1.runGradleFunction)().createBuildStepFromFunctionCall(globalCtx, {
195
247
  id: 'run_gradle',
248
+ workingDirectory,
196
249
  callInputs: {
197
250
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
198
251
  },
199
252
  });
200
253
  const saveCache = (0, saveBuildCache_1.createSaveBuildCacheFunction)(evictUsedBefore).createBuildStepFromFunctionCall(globalCtx, {
254
+ workingDirectory,
201
255
  callInputs: {
202
256
  platform: eas_build_job_1.Platform.ANDROID,
203
257
  },
204
258
  });
205
259
  return [
206
260
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
207
- (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
208
- (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
209
- (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
210
- (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
261
+ (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
262
+ workingDirectory,
263
+ }),
264
+ (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
265
+ workingDirectory,
266
+ }),
267
+ (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
268
+ (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
269
+ workingDirectory,
270
+ }),
211
271
  restoreCache,
212
272
  calculateEASUpdateRuntimeVersion,
213
273
  configureEASUpdate,
214
274
  ...((0, eagerBundle_1.shouldUseEagerBundle)(globalCtx.staticContext.metadata)
215
275
  ? [
216
276
  (0, eagerBundle_2.eagerBundleBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
277
+ workingDirectory,
217
278
  callInputs: {
218
279
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
219
280
  },
@@ -221,61 +282,81 @@ function createStepsForAndroidBuildWithoutCredentials({ globalCtx, buildToolsCon
221
282
  ]
222
283
  : []),
223
284
  runGradle,
224
- (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
285
+ (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
225
286
  saveCache,
226
- (0, restoreBuildCache_1.createCacheStatsBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
287
+ (0, restoreBuildCache_1.createCacheStatsBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
288
+ workingDirectory,
289
+ }),
227
290
  ];
228
291
  }
229
- function createStepsForAndroidBuildWithCredentials({ globalCtx, buildToolsContext, }) {
292
+ function createStepsForAndroidBuildWithCredentials({ globalCtx, buildToolsContext, workingDirectory, }) {
230
293
  const evictUsedBefore = new Date();
231
294
  const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
232
295
  id: 'calculate_eas_update_runtime_version',
296
+ workingDirectory,
233
297
  });
234
298
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
299
+ workingDirectory,
235
300
  callInputs: {
236
301
  throw_if_not_configured: false,
237
302
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
238
303
  },
239
304
  });
240
305
  const restoreCache = (0, restoreBuildCache_1.createRestoreBuildCacheFunction)().createBuildStepFromFunctionCall(globalCtx, {
306
+ workingDirectory,
241
307
  callInputs: {
242
308
  platform: eas_build_job_1.Platform.ANDROID,
243
309
  },
244
310
  });
245
311
  const runGradle = (0, runGradle_1.runGradleFunction)().createBuildStepFromFunctionCall(globalCtx, {
246
312
  id: 'run_gradle',
313
+ workingDirectory,
247
314
  callInputs: {
248
315
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
249
316
  },
250
317
  });
251
318
  const saveCache = (0, saveBuildCache_1.createSaveBuildCacheFunction)(evictUsedBefore).createBuildStepFromFunctionCall(globalCtx, {
319
+ workingDirectory,
252
320
  callInputs: {
253
321
  platform: eas_build_job_1.Platform.ANDROID,
254
322
  },
255
323
  });
256
324
  return [
257
325
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
258
- (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
259
- (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
260
- (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
261
- (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
326
+ (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
327
+ workingDirectory,
328
+ }),
329
+ (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
330
+ workingDirectory,
331
+ }),
332
+ (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
333
+ (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
334
+ workingDirectory,
335
+ }),
262
336
  restoreCache,
263
337
  calculateEASUpdateRuntimeVersion,
264
338
  configureEASUpdate,
265
- (0, injectAndroidCredentials_1.injectAndroidCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx),
266
- (0, configureAndroidVersion_1.configureAndroidVersionFunction)().createBuildStepFromFunctionCall(globalCtx),
339
+ (0, injectAndroidCredentials_1.injectAndroidCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx, {
340
+ workingDirectory,
341
+ }),
342
+ (0, configureAndroidVersion_1.configureAndroidVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
343
+ workingDirectory,
344
+ }),
267
345
  runGradle,
268
346
  ...((0, eagerBundle_1.shouldUseEagerBundle)(globalCtx.staticContext.metadata)
269
347
  ? [
270
348
  (0, eagerBundle_2.eagerBundleBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
349
+ workingDirectory,
271
350
  callInputs: {
272
351
  resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
273
352
  },
274
353
  }),
275
354
  ]
276
355
  : []),
277
- (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
356
+ (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, { workingDirectory }),
278
357
  saveCache,
279
- (0, restoreBuildCache_1.createCacheStatsBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
358
+ (0, restoreBuildCache_1.createCacheStatsBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
359
+ workingDirectory,
360
+ }),
280
361
  ];
281
362
  }
@@ -39,7 +39,6 @@ function createEasMaestroTestFunctionGroup(buildToolsContext) {
39
39
  }) ?? 'ios/build/Build/Products/*simulator/*.app';
40
40
  steps.push(new steps_1.BuildStep(globalCtx, {
41
41
  id: steps_1.BuildStep.getNewId(),
42
- name: 'install_app',
43
42
  displayName: `Install app to Simulator`,
44
43
  command: `
45
44
  # shopt -s nullglob is necessary not to try to install
@@ -78,7 +77,6 @@ function createEasMaestroTestFunctionGroup(buildToolsContext) {
78
77
  }) ?? 'android/app/build/outputs/**/*.apk';
79
78
  steps.push(new steps_1.BuildStep(globalCtx, {
80
79
  id: steps_1.BuildStep.getNewId(),
81
- name: 'install_app',
82
80
  displayName: `Install app to Emulator`,
83
81
  command: `
84
82
  # shopt -s globstar is necessary to add /**/ support
@@ -111,7 +109,6 @@ function createEasMaestroTestFunctionGroup(buildToolsContext) {
111
109
  for (const flowPath of flowPaths) {
112
110
  steps.push(new steps_1.BuildStep(globalCtx, {
113
111
  id: steps_1.BuildStep.getNewId(),
114
- name: 'maestro_test',
115
112
  ifCondition: '${ always() }',
116
113
  displayName: `maestro test ${flowPath}`,
117
114
  command: `maestro test ${flowPath}`,
@@ -30,7 +30,7 @@ function calculateEASUpdateRuntimeVersionFunction() {
30
30
  }),
31
31
  ],
32
32
  fn: async (stepCtx, { env, inputs, outputs }) => {
33
- const appConfig = (0, appConfig_1.readAppConfig)({
33
+ const appConfig = (await (0, appConfig_1.readAppConfig)({
34
34
  projectDir: stepCtx.workingDirectory,
35
35
  env: Object.keys(env).reduce((acc, key) => {
36
36
  acc[key] = env[key] ?? '';
@@ -38,7 +38,7 @@ function calculateEASUpdateRuntimeVersionFunction() {
38
38
  }, {}),
39
39
  logger: stepCtx.logger,
40
40
  sdkVersion: stepCtx.global.staticContext.metadata?.sdkVersion,
41
- }).exp;
41
+ })).exp;
42
42
  const platform = inputs.platform.value ?? stepCtx.global.staticContext.job.platform;
43
43
  const workflow = inputs.workflow.value ?? stepCtx.global.staticContext.job.type;
44
44
  if (![eas_build_job_1.Platform.ANDROID, eas_build_job_1.Platform.IOS].includes(platform)) {
@@ -44,7 +44,7 @@ function configureEASUpdateIfInstalledFunction() {
44
44
  const job = stepCtx.global.staticContext.job;
45
45
  (0, assert_1.default)(job.platform, 'Configuring EAS Update in generic jobs is not supported.');
46
46
  const metadata = stepCtx.global.staticContext.metadata;
47
- const appConfig = (0, appConfig_1.readAppConfig)({
47
+ const appConfig = (await (0, appConfig_1.readAppConfig)({
48
48
  projectDir: stepCtx.workingDirectory,
49
49
  env: Object.keys(env).reduce((acc, key) => {
50
50
  acc[key] = env[key] ?? '';
@@ -52,7 +52,7 @@ function configureEASUpdateIfInstalledFunction() {
52
52
  }, {}),
53
53
  logger: stepCtx.logger,
54
54
  sdkVersion: metadata?.sdkVersion,
55
- }).exp;
55
+ })).exp;
56
56
  const channelInput = inputs.channel.value;
57
57
  const runtimeVersionInput = inputs.runtime_version.value;
58
58
  const resolvedRuntimeVersionInput = inputs.resolved_eas_update_runtime_version.value;