@expo/build-tools 1.0.23 → 1.0.24

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.
@@ -30,10 +30,14 @@ async function runBuilderWithHooksAsync(ctx, builderAsync) {
30
30
  });
31
31
  });
32
32
  if (ctx.job.platform === eas_build_job_1.Platform.IOS) {
33
- await (0, xcodeBuildLogs_1.findAndUploadXcodeBuildLogsAsync)(ctx);
33
+ await (0, xcodeBuildLogs_1.findAndUploadXcodeBuildLogsAsync)(ctx, {
34
+ logger: ctx.logger,
35
+ });
34
36
  }
35
37
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {
36
- await (0, artifacts_1.maybeFindAndUploadBuildArtifacts)(ctx, ctx.logger);
38
+ await (0, artifacts_1.maybeFindAndUploadBuildArtifacts)(ctx, {
39
+ logger: ctx.logger,
40
+ });
37
41
  });
38
42
  }
39
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/builders/common.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AAGrE,0DAAyE;AACzE,kDAAsE;AACtE,0CAAwD;AAEjD,KAAK,UAAU,wBAAwB,CAC5C,GAAoB,EACpB,YAAqD;IAErD,IAAI;QACF,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,IAAI;YACF,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;YACxB,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;gBACnE,MAAM,IAAA,wBAAgB,EAAC,GAAG,EAAE,YAAI,CAAC,gBAAgB,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;SACJ;QAAC,OAAO,GAAQ,EAAE;YACjB,YAAY,GAAG,KAAK,CAAC;YACrB,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;gBACjE,MAAM,IAAA,wBAAgB,EAAC,GAAG,EAAE,YAAI,CAAC,cAAc,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;YACH,MAAM,GAAG,CAAC;SACX;gBAAS;YACR,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;gBACpE,MAAM,IAAA,wBAAgB,EAAC,GAAG,EAAE,YAAI,CAAC,iBAAiB,EAAE;oBAClD,SAAS,EAAE;wBACT,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;qBACxD;iBACF,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,EAAE;gBACrC,MAAM,IAAA,iDAAgC,EAAC,GAA4B,CAAC,CAAC;aACtE;YAED,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;gBACpE,MAAM,IAAA,4CAAgC,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;YAC1D,CAAC,CAAC,CAAC;SACJ;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC9B,MAAM,GAAG,CAAC;KACX;IAED,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IAED,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC;AA5CD,4DA4CC","sourcesContent":["import { BuildPhase, Ios, Job, Platform } from '@expo/eas-build-job';\n\nimport { Artifacts, BuildContext } from '../context';\nimport { findAndUploadXcodeBuildLogsAsync } from '../ios/xcodeBuildLogs';\nimport { maybeFindAndUploadBuildArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\n\nexport async function runBuilderWithHooksAsync<T extends Job>(\n ctx: BuildContext<T>,\n builderAsync: (ctx: BuildContext<T>) => Promise<void>\n): Promise<Artifacts> {\n try {\n let buildSuccess = true;\n try {\n await builderAsync(ctx);\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_SUCCESS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_SUCCESS);\n });\n } catch (err: any) {\n buildSuccess = false;\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_ERROR_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_ERROR);\n });\n throw err;\n } finally {\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_COMPLETE_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_COMPLETE, {\n extraEnvs: {\n EAS_BUILD_STATUS: buildSuccess ? 'finished' : 'errored',\n },\n });\n });\n\n if (ctx.job.platform === Platform.IOS) {\n await findAndUploadXcodeBuildLogsAsync(ctx as BuildContext<Ios.Job>);\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {\n await maybeFindAndUploadBuildArtifacts(ctx, ctx.logger);\n });\n }\n } catch (err: any) {\n err.artifacts = ctx.artifacts;\n throw err;\n }\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n\n return ctx.artifacts;\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/builders/common.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AAGrE,0DAAyE;AACzE,kDAAsE;AACtE,0CAAwD;AAEjD,KAAK,UAAU,wBAAwB,CAC5C,GAAoB,EACpB,YAAqD;IAErD,IAAI;QACF,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,IAAI;YACF,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;YACxB,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,qBAAqB,EAAE,KAAK,IAAI,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C,mBAAmB,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IAED,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC;AAhDD,4DAgDC","sourcesContent":["import { BuildPhase, Ios, Job, Platform } from '@expo/eas-build-job';\n\nimport { Artifacts, BuildContext } from '../context';\nimport { findAndUploadXcodeBuildLogsAsync } from '../ios/xcodeBuildLogs';\nimport { maybeFindAndUploadBuildArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\n\nexport async function runBuilderWithHooksAsync<T extends Job>(\n ctx: BuildContext<T>,\n builderAsync: (ctx: BuildContext<T>) => Promise<void>\n): Promise<Artifacts> {\n try {\n let buildSuccess = true;\n try {\n await builderAsync(ctx);\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_SUCCESS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_SUCCESS);\n });\n } catch (err: any) {\n buildSuccess = false;\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_ERROR_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_ERROR);\n });\n throw err;\n } finally {\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_COMPLETE_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_COMPLETE, {\n extraEnvs: {\n EAS_BUILD_STATUS: buildSuccess ? 'finished' : 'errored',\n },\n });\n });\n\n if (ctx.job.platform === Platform.IOS) {\n await findAndUploadXcodeBuildLogsAsync(ctx as BuildContext<Ios.Job>, {\n logger: ctx.logger,\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {\n await maybeFindAndUploadBuildArtifacts(ctx, {\n logger: ctx.logger,\n });\n });\n }\n } catch (err: any) {\n err.artifacts = ctx.artifacts;\n throw err;\n }\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n\n return ctx.artifacts;\n}\n"]}
@@ -1,4 +1,8 @@
1
+ /// <reference types="bunyan" />
1
2
  import { Ios } from '@expo/eas-build-job';
3
+ import { bunyan } from '@expo/logger';
2
4
  import { BuildContext } from '../context';
3
- export declare function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>): Promise<void>;
5
+ export declare function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>, { logger }: {
6
+ logger: bunyan;
7
+ }): Promise<void>;
4
8
  export declare function findXcodeBuildLogsPathAsync(buildLogsDirectory: string): Promise<string | undefined>;
@@ -8,15 +8,15 @@ const os_1 = __importDefault(require("os"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const fast_glob_1 = __importDefault(require("fast-glob"));
10
10
  const context_1 = require("../context");
11
- async function findAndUploadXcodeBuildLogsAsync(ctx) {
11
+ async function findAndUploadXcodeBuildLogsAsync(ctx, { logger }) {
12
12
  try {
13
13
  const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);
14
14
  if (xcodeBuildLogsPath) {
15
- await ctx.uploadArtifacts(context_1.ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], ctx.logger);
15
+ await ctx.uploadArtifacts(context_1.ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], logger);
16
16
  }
17
17
  }
18
18
  catch (err) {
19
- ctx.logger.debug({ err }, 'Failed to upload Xcode build logs');
19
+ logger.debug({ err }, 'Failed to upload Xcode build logs');
20
20
  }
21
21
  }
22
22
  exports.findAndUploadXcodeBuildLogsAsync = findAndUploadXcodeBuildLogsAsync;
@@ -1 +1 @@
1
- {"version":3,"file":"xcodeBuildLogs.js","sourceRoot":"","sources":["../../src/ios/xcodeBuildLogs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,0DAA2B;AAE3B,wCAAwD;AAEjD,KAAK,UAAU,gCAAgC,CAAC,GAA0B;IAC/E,IAAI;QACF,MAAM,kBAAkB,GAAG,MAAM,2BAA2B,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACrF,IAAI,kBAAkB,EAAE;YACtB,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;SAC5F;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,CAAC,CAAC;KAChE;AACH,CAAC;AATD,4EASC;AAEM,KAAK,UAAU,2BAA2B,CAC/C,kBAA0B;;IAE1B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACvF,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CACxC,CAAC;IACF,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACrB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;KAC1B;IACD,MAAM,gBAAgB,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CACtF,CAAC,YAAY,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CACxD,CAAC;IAEF,OAAO,MAAA,MAAA,cAAc,CAAC,CAAC,CAAC,mCAAI,gBAAgB,CAAC,CAAC,CAAC,mCAAI,SAAS,CAAC;AAC/D,CAAC;AAdD,kEAcC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport fg from 'fast-glob';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n try {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);\n if (xcodeBuildLogsPath) {\n await ctx.uploadArtifacts(ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], ctx.logger);\n }\n } catch (err: any) {\n ctx.logger.debug({ err }, 'Failed to upload Xcode build logs');\n }\n}\n\nexport async function findXcodeBuildLogsPathAsync(\n buildLogsDirectory: string\n): Promise<string | undefined> {\n const customLogPaths = (await fg('*.log', { cwd: buildLogsDirectory })).map((filename) =>\n path.join(buildLogsDirectory, filename)\n );\n if (customLogPaths[0]) {\n return customLogPaths[0];\n }\n const fallbackLogPaths = (await fg('Library/Logs/gym/*.log', { cwd: os.homedir() })).map(\n (relativePath) => path.join(os.homedir(), relativePath)\n );\n\n return customLogPaths[0] ?? fallbackLogPaths[0] ?? undefined;\n}\n"]}
1
+ {"version":3,"file":"xcodeBuildLogs.js","sourceRoot":"","sources":["../../src/ios/xcodeBuildLogs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,0DAA2B;AAG3B,wCAAwD;AAEjD,KAAK,UAAU,gCAAgC,CACpD,GAA0B,EAC1B,EAAE,MAAM,EAAsB;IAE9B,IAAI;QACF,MAAM,kBAAkB,GAAG,MAAM,2BAA2B,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACrF,IAAI,kBAAkB,EAAE;YACtB,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC;SACxF;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,CAAC,CAAC;KAC5D;AACH,CAAC;AAZD,4EAYC;AAEM,KAAK,UAAU,2BAA2B,CAC/C,kBAA0B;;IAE1B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACvF,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CACxC,CAAC;IACF,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACrB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;KAC1B;IACD,MAAM,gBAAgB,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CACtF,CAAC,YAAY,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CACxD,CAAC;IAEF,OAAO,MAAA,MAAA,cAAc,CAAC,CAAC,CAAC,mCAAI,gBAAgB,CAAC,CAAC,CAAC,mCAAI,SAAS,CAAC;AAC/D,CAAC;AAdD,kEAcC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport fg from 'fast-glob';\nimport { bunyan } from '@expo/logger';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findAndUploadXcodeBuildLogsAsync(\n ctx: BuildContext<Ios.Job>,\n { logger }: { logger: bunyan }\n): Promise<void> {\n try {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);\n if (xcodeBuildLogsPath) {\n await ctx.uploadArtifacts(ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], logger);\n }\n } catch (err: any) {\n logger.debug({ err }, 'Failed to upload Xcode build logs');\n }\n}\n\nexport async function findXcodeBuildLogsPathAsync(\n buildLogsDirectory: string\n): Promise<string | undefined> {\n const customLogPaths = (await fg('*.log', { cwd: buildLogsDirectory })).map((filename) =>\n path.join(buildLogsDirectory, filename)\n );\n if (customLogPaths[0]) {\n return customLogPaths[0];\n }\n const fallbackLogPaths = (await fg('Library/Logs/gym/*.log', { cwd: os.homedir() })).map(\n (relativePath) => path.join(os.homedir(), relativePath)\n );\n\n return customLogPaths[0] ?? fallbackLogPaths[0] ?? undefined;\n}\n"]}
@@ -9,6 +9,8 @@ const eas_build_job_1 = require("@expo/eas-build-job");
9
9
  const steps_1 = require("@expo/steps");
10
10
  const fs_extra_1 = __importDefault(require("fs-extra"));
11
11
  const gradle_1 = require("../../../android/gradle");
12
+ const resolve_1 = require("../../utils/ios/resolve");
13
+ const fastlane_1 = require("../../utils/ios/fastlane");
12
14
  function createBuildReactNativeAppBuildFunction(ctx) {
13
15
  return new steps_1.BuildFunction({
14
16
  namespace: 'eas',
@@ -28,7 +30,21 @@ function createBuildReactNativeAppBuildFunction(ctx) {
28
30
  });
29
31
  }
30
32
  else {
31
- throw new steps_1.errors.BuildStepRuntimeError('iOS builds are not supported yet');
33
+ const iosCtx = ctx;
34
+ const iosDir = path_1.default.join(stepsCtx.workingDirectory, 'ios');
35
+ if (!(await fs_extra_1.default.exists(iosDir))) {
36
+ throw new steps_1.errors.BuildStepRuntimeError(`iOS project directory (${iosDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run "eas/prebuild" step to generate your native code.`);
37
+ }
38
+ const scheme = (0, resolve_1.resolveScheme)(iosCtx.job, { workingDir: stepsCtx.workingDirectory });
39
+ const buildConfiguration = (0, resolve_1.resolveBuildConfiguration)(iosCtx.job);
40
+ await (0, fastlane_1.runFastlaneGym)({
41
+ scheme,
42
+ buildConfiguration,
43
+ workingDir: stepsCtx.workingDirectory,
44
+ logger: stepsCtx.logger,
45
+ buildLogsDirectory: ctx.buildLogsDirectory,
46
+ env: ctx.env,
47
+ });
32
48
  }
33
49
  },
34
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"buildReactNativeApp.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/buildReactNativeApp.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAA6D;AAC7D,uCAAoD;AACpD,wDAA0B;AAG1B,oDAAiF;AAEjF,SAAgB,sCAAsC,CACpD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,wBAAwB;QAC5B,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;oBAClC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,8BAA8B,UAAU,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CAC/S,CAAC;iBACH;gBACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACjD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;oBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,aAAa,EAAE,IAAA,6BAAoB,EAAC,GAAG,CAAC,GAAG,CAAC;oBAC5C,UAAU;iBACX,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,IAAI,cAAM,CAAC,qBAAqB,CAAC,kCAAkC,CAAC,CAAC;aAC5E;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1BD,wFA0BC","sourcesContent":["import path from 'path';\n\nimport { Android, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, errors } from '@expo/steps';\nimport fs from 'fs-extra';\n\nimport { BuildContext } from '../../../context';\nimport { resolveGradleCommand, runGradleCommand } from '../../../android/gradle';\n\nexport function createBuildReactNativeAppBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'build_react_native_app',\n name: 'Build React Native app',\n fn: async (stepsCtx) => {\n if (ctx.job.platform === Platform.ANDROID) {\n const androidDir = path.join(stepsCtx.workingDirectory, 'android');\n if (!(await fs.exists(androidDir))) {\n throw new errors.BuildStepRuntimeError(\n `Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n stepsCtx.logger.info('Building Android project');\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: resolveGradleCommand(ctx.job),\n androidDir,\n });\n } else {\n throw new errors.BuildStepRuntimeError('iOS builds are not supported yet');\n }\n },\n });\n}\n"]}
1
+ {"version":3,"file":"buildReactNativeApp.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/buildReactNativeApp.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAkE;AAClE,uCAAoD;AACpD,wDAA0B;AAG1B,oDAAiF;AACjF,qDAAmF;AACnF,uDAA0D;AAE1D,SAAgB,sCAAsC,CACpD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,wBAAwB;QAC5B,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,CA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Content":["import path from 'path';\n\nimport { Android, Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, errors } from '@expo/steps';\nimport fs from 'fs-extra';\n\nimport { BuildContext } from '../../../context';\nimport { resolveGradleCommand, runGradleCommand } from '../../../android/gradle';\nimport { resolveBuildConfiguration, resolveScheme } from '../../utils/ios/resolve';\nimport { runFastlaneGym } from '../../utils/ios/fastlane';\n\nexport function createBuildReactNativeAppBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'build_react_native_app',\n name: 'Build React Native app',\n fn: async (stepsCtx) => {\n if (ctx.job.platform === Platform.ANDROID) {\n const androidDir = path.join(stepsCtx.workingDirectory, 'android');\n if (!(await fs.exists(androidDir))) {\n throw new errors.BuildStepRuntimeError(\n `Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n stepsCtx.logger.info('Building Android project');\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: resolveGradleCommand(ctx.job),\n androidDir,\n });\n } else {\n const iosCtx = ctx as BuildContext<Ios.Job>;\n const iosDir = path.join(stepsCtx.workingDirectory, 'ios');\n if (!(await fs.exists(iosDir))) {\n throw new errors.BuildStepRuntimeError(\n `iOS project directory (${iosDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n const scheme = resolveScheme(iosCtx.job, { workingDir: stepsCtx.workingDirectory });\n const buildConfiguration = resolveBuildConfiguration(iosCtx.job);\n await runFastlaneGym({\n scheme,\n buildConfiguration,\n workingDir: stepsCtx.workingDirectory,\n logger: stepsCtx.logger,\n buildLogsDirectory: ctx.buildLogsDirectory,\n env: ctx.env,\n });\n }\n },\n });\n}\n"]}
@@ -5,6 +5,7 @@ const eas_build_job_1 = require("@expo/eas-build-job");
5
5
  const steps_1 = require("@expo/steps");
6
6
  const artifacts_1 = require("../../../utils/artifacts");
7
7
  const resolve_1 = require("../../../ios/resolve");
8
+ const xcodeBuildLogs_1 = require("../../../ios/xcodeBuildLogs");
8
9
  function createFindAndUploadBuildArtifactsBuildFunction(ctx) {
9
10
  return new steps_1.BuildFunction({
10
11
  namespace: 'eas',
@@ -20,7 +21,14 @@ function createFindAndUploadBuildArtifactsBuildFunction(ctx) {
20
21
  rootDir: stepsCtx.workingDirectory,
21
22
  patternOrPath: applicationArchivePatternOrPath,
22
23
  });
23
- await (0, artifacts_1.maybeFindAndUploadBuildArtifacts)(ctx, stepsCtx.logger);
24
+ await (0, artifacts_1.maybeFindAndUploadBuildArtifacts)(ctx, {
25
+ logger: stepsCtx.logger,
26
+ });
27
+ if (ctx.job.platform === eas_build_job_1.Platform.IOS) {
28
+ await (0, xcodeBuildLogs_1.findAndUploadXcodeBuildLogsAsync)(ctx, {
29
+ logger: stepsCtx.logger,
30
+ });
31
+ }
24
32
  },
25
33
  });
26
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AACzD,uCAA4C;AAG5C,wDAGkC;AAClC,kDAA2D;AAE3D,SAAgB,8CAA8C,CAC5D,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;;YACrB,MAAM,+BAA+B,GACnC,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO;gBACnC,CAAC,CAAC,MAAA,GAAG,CAAC,GAAG,CAAC,sBAAsB,mCAAI,0CAA0C;gBAC9E,CAAC,CAAC,IAAA,6BAAmB,EAAC,GAA4B,CAAC,CAAC;YACxD,MAAM,IAAA,oCAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,QAAQ,CAAC,gBAAgB;gBAClC,aAAa,EAAE,+BAA+B;aAC/C,CAAC,CAAC;YACH,MAAM,IAAA,4CAAgC,EAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AApBD,wGAoBC","sourcesContent":["import { Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport {\n maybeFindAndUploadBuildArtifacts,\n uploadApplicationArchive,\n} from '../../../utils/artifacts';\nimport { resolveArtifactPath } from '../../../ios/resolve';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'find_and_upload_build_artifacts',\n name: 'Find and upload build artifacts',\n fn: async (stepsCtx) => {\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveArtifactPath(ctx as BuildContext<Ios.Job>);\n await uploadApplicationArchive(ctx, {\n logger: stepsCtx.logger,\n rootDir: stepsCtx.workingDirectory,\n patternOrPath: applicationArchivePatternOrPath,\n });\n await maybeFindAndUploadBuildArtifacts(ctx, stepsCtx.logger);\n },\n });\n}\n"]}
1
+ {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AACzD,uCAA4C;AAG5C,wDAGkC;AAClC,kDAA2D;AAC3D,gEAA+E;AAE/E,SAAgB,8CAA8C,CAC5D,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;;YACrB,MAAM,+BAA+B,GACnC,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO;gBACnC,CAAC,CAAC,MAAA,GAAG,CAAC,GAAG,CAAC,sBAAsB,mCAAI,0CAA0C;gBAC9E,CAAC,CAAC,IAAA,6BAAmB,EAAC,GAA4B,CAAC,CAAC;YACxD,MAAM,IAAA,oCAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,QAAQ,CAAC,gBAAgB;gBAClC,aAAa,EAAE,+BAA+B;aAC/C,CAAC,CAAC;YACH,MAAM,IAAA,4CAAgC,EAAC,GAAG,EAAE;gBAC1C,MAAM,EAAE,QAAQ,CAAC,MAAM;aACxB,CAAC,CAAC;YACH,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,EAAE;gBACrC,MAAM,IAAA,iDAAgC,EAAC,GAA4B,EAAE;oBACnE,MAAM,EAAE,QAAQ,CAAC,MAAM;iBACxB,CAAC,CAAC;aACJ;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA3BD,wGA2BC","sourcesContent":["import { Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport {\n maybeFindAndUploadBuildArtifacts,\n uploadApplicationArchive,\n} from '../../../utils/artifacts';\nimport { resolveArtifactPath } from '../../../ios/resolve';\nimport { findAndUploadXcodeBuildLogsAsync } from '../../../ios/xcodeBuildLogs';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'find_and_upload_build_artifacts',\n name: 'Find and upload build artifacts',\n fn: async (stepsCtx) => {\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveArtifactPath(ctx as BuildContext<Ios.Job>);\n await uploadApplicationArchive(ctx, {\n logger: stepsCtx.logger,\n rootDir: stepsCtx.workingDirectory,\n patternOrPath: applicationArchivePatternOrPath,\n });\n await maybeFindAndUploadBuildArtifacts(ctx, {\n logger: stepsCtx.logger,\n });\n if (ctx.job.platform === Platform.IOS) {\n await findAndUploadXcodeBuildLogsAsync(ctx as BuildContext<Ios.Job>, {\n logger: stepsCtx.logger,\n });\n }\n },\n });\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /// <reference types="bunyan" />
2
+ import { bunyan } from '@expo/logger';
3
+ import { Env } from '@expo/eas-build-job';
4
+ export declare function runFastlaneGym({ scheme, buildConfiguration, workingDir, logger, buildLogsDirectory, env, }: {
5
+ scheme: string;
6
+ buildConfiguration?: string;
7
+ workingDir: string;
8
+ logger: bunyan;
9
+ buildLogsDirectory: string;
10
+ env: Env;
11
+ }): Promise<void>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runFastlaneGym = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_extra_1 = __importDefault(require("fs-extra"));
9
+ const gymfile_1 = require("../../../ios/gymfile");
10
+ const xcpretty_1 = require("../../../ios/xcpretty");
11
+ const fastlane_1 = require("../../../ios/fastlane");
12
+ const tvos_1 = require("./tvos");
13
+ async function ensureGymfileExists({ logger, scheme, buildConfiguration, logsDirectory, workingDir, }) {
14
+ const gymfilePath = path_1.default.join(workingDir, 'ios/Gymfile');
15
+ if (await fs_extra_1.default.pathExists(gymfilePath)) {
16
+ logger.info('Gymfile already exists');
17
+ return;
18
+ }
19
+ const isTV = await (0, tvos_1.isTVOS)({ scheme, buildConfiguration, workingDir });
20
+ const simulatorDestination = `generic/platform=${isTV ? 'tvOS' : 'iOS'} Simulator`;
21
+ await (0, gymfile_1.createGymfileForSimulatorBuild)({
22
+ outputFile: gymfilePath,
23
+ scheme,
24
+ buildConfiguration: buildConfiguration !== null && buildConfiguration !== void 0 ? buildConfiguration : 'release',
25
+ derivedDataPath: './build',
26
+ clean: false,
27
+ logsDirectory,
28
+ simulatorDestination,
29
+ });
30
+ logger.info('Creating Gymfile');
31
+ }
32
+ async function runFastlaneGym({ scheme, buildConfiguration, workingDir, logger, buildLogsDirectory, env, }) {
33
+ await ensureGymfileExists({
34
+ scheme,
35
+ buildConfiguration: buildConfiguration !== null && buildConfiguration !== void 0 ? buildConfiguration : 'release',
36
+ logsDirectory: buildLogsDirectory,
37
+ workingDir,
38
+ logger,
39
+ });
40
+ const buildLogger = new xcpretty_1.XcodeBuildLogger(logger, workingDir);
41
+ void buildLogger.watchLogFiles(buildLogsDirectory);
42
+ try {
43
+ await (0, fastlane_1.runFastlane)(['gym'], {
44
+ cwd: path_1.default.join(workingDir, 'ios'),
45
+ logger,
46
+ env,
47
+ });
48
+ }
49
+ finally {
50
+ await buildLogger.flush();
51
+ }
52
+ }
53
+ exports.runFastlaneGym = runFastlaneGym;
54
+ //# sourceMappingURL=fastlane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fastlane.js","sourceRoot":"","sources":["../../../../src/steps/utils/ios/fastlane.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAI1B,kDAAsE;AACtE,oDAAyD;AACzD,oDAAoD;AAEpD,iCAAgC;AAEhC,KAAK,UAAU,mBAAmB,CAAC,EACjC,MAAM,EACN,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,UAAU,GAOX;IACC,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CA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G;SACJ,CAAC,CAAC;KACJ;YAAS;QACR,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;KAC3B;AACH,CAAC;AAjCD,wCAiCC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport { bunyan } from '@expo/logger';\nimport { Env } from '@expo/eas-build-job';\n\nimport { createGymfileForSimulatorBuild } from '../../../ios/gymfile';\nimport { XcodeBuildLogger } from '../../../ios/xcpretty';\nimport { runFastlane } from '../../../ios/fastlane';\n\nimport { isTVOS } from './tvos';\n\nasync function ensureGymfileExists({\n logger,\n scheme,\n buildConfiguration,\n logsDirectory,\n workingDir,\n}: {\n logger: bunyan;\n scheme: string;\n buildConfiguration: string;\n logsDirectory: string;\n workingDir: string;\n}): Promise<void> {\n const gymfilePath = path.join(workingDir, 'ios/Gymfile');\n if (await fs.pathExists(gymfilePath)) {\n logger.info('Gymfile already exists');\n return;\n }\n\n const isTV = await isTVOS({ scheme, buildConfiguration, workingDir });\n const simulatorDestination = `generic/platform=${isTV ? 'tvOS' : 'iOS'} Simulator`;\n\n await createGymfileForSimulatorBuild({\n outputFile: gymfilePath,\n scheme,\n buildConfiguration: buildConfiguration ?? 'release',\n derivedDataPath: './build',\n clean: false,\n logsDirectory,\n simulatorDestination,\n });\n\n logger.info('Creating Gymfile');\n}\n\nexport async function runFastlaneGym({\n scheme,\n buildConfiguration,\n workingDir,\n logger,\n buildLogsDirectory,\n env,\n}: {\n scheme: string;\n buildConfiguration?: string;\n workingDir: string;\n logger: bunyan;\n buildLogsDirectory: string;\n env: Env;\n}): Promise<void> {\n await ensureGymfileExists({\n scheme,\n buildConfiguration: buildConfiguration ?? 'release',\n logsDirectory: buildLogsDirectory,\n workingDir,\n logger,\n });\n const buildLogger = new XcodeBuildLogger(logger, workingDir);\n void buildLogger.watchLogFiles(buildLogsDirectory);\n try {\n await runFastlane(['gym'], {\n cwd: path.join(workingDir, 'ios'),\n logger,\n env,\n });\n } finally {\n await buildLogger.flush();\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { Ios } from '@expo/eas-build-job';
2
+ export declare function resolveScheme(job: Ios.Job, { workingDir }: {
3
+ workingDir: string;
4
+ }): string;
5
+ export declare function resolveBuildConfiguration(job: Ios.Job): string;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.resolveBuildConfiguration = exports.resolveScheme = void 0;
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const config_plugins_1 = require("@expo/config-plugins");
9
+ function resolveScheme(job, { workingDir }) {
10
+ if (job.scheme) {
11
+ return job.scheme;
12
+ }
13
+ const schemes = config_plugins_1.IOSConfig.BuildScheme.getSchemesFromXcodeproj(workingDir);
14
+ (0, assert_1.default)(schemes.length === 1, 'Ejected project should have exactly one scheme');
15
+ return schemes[0];
16
+ }
17
+ exports.resolveScheme = resolveScheme;
18
+ function resolveBuildConfiguration(job) {
19
+ if (job.buildConfiguration) {
20
+ return job.buildConfiguration;
21
+ }
22
+ else if (job.developmentClient) {
23
+ return 'Debug';
24
+ }
25
+ else {
26
+ return 'Release';
27
+ }
28
+ }
29
+ exports.resolveBuildConfiguration = resolveBuildConfiguration;
30
+ //# sourceMappingURL=resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/steps/utils/ios/resolve.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAG5B,yDAAiD;AAEjD,SAAgB,aAAa,CAAC,GAAY,EAAE,EAAE,UAAU,EAA0B;IAChF,IAAI,GAAG,CAAC,MAAM,EAAE;QACd,OAAO,GAAG,CAAC,MAAM,CAAC;KACnB;IACD,MAAM,OAAO,GAAG,0BAAS,CAAC,WAAW,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;IAC1E,IAAA,gBAAM,EAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,gDAAgD,CAAC,CAAC;IAC/E,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAPD,sCAOC;AAED,SAAgB,yBAAyB,CAAC,GAAY;IACpD,IAAI,GAAG,CAAC,kBAAkB,EAAE;QAC1B,OAAO,GAAG,CAAC,kBAAkB,CAAC;KAC/B;SAAM,IAAI,GAAG,CAAC,iBAAiB,EAAE;QAChC,OAAO,OAAO,CAAC;KAChB;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AARD,8DAQC","sourcesContent":["import assert from 'assert';\n\nimport { Ios } from '@expo/eas-build-job';\nimport { IOSConfig } from '@expo/config-plugins';\n\nexport function resolveScheme(job: Ios.Job, { workingDir }: { workingDir: string }): string {\n if (job.scheme) {\n return job.scheme;\n }\n const schemes = IOSConfig.BuildScheme.getSchemesFromXcodeproj(workingDir);\n assert(schemes.length === 1, 'Ejected project should have exactly one scheme');\n return schemes[0];\n}\n\nexport function resolveBuildConfiguration(job: Ios.Job): string {\n if (job.buildConfiguration) {\n return job.buildConfiguration;\n } else if (job.developmentClient) {\n return 'Debug';\n } else {\n return 'Release';\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export declare function isTVOS({ scheme, buildConfiguration, workingDir, }: {
2
+ scheme: string;
3
+ buildConfiguration: string;
4
+ workingDir: string;
5
+ }): Promise<boolean>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTVOS = void 0;
4
+ const config_plugins_1 = require("@expo/config-plugins");
5
+ async function isTVOS({ scheme, buildConfiguration, workingDir, }) {
6
+ var _a, _b;
7
+ const project = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(workingDir);
8
+ const targetName = await config_plugins_1.IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(workingDir, scheme);
9
+ const xcBuildConfiguration = config_plugins_1.IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {
10
+ targetName,
11
+ buildConfiguration,
12
+ });
13
+ return (_b = (_a = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : xcBuildConfiguration.buildSettings) === null || _a === void 0 ? void 0 : _a.SDKROOT) === null || _b === void 0 ? void 0 : _b.includes('appletv');
14
+ }
15
+ exports.isTVOS = isTVOS;
16
+ //# sourceMappingURL=tvos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tvos.js","sourceRoot":"","sources":["../../../../src/steps/utils/ios/tvos.ts"],"names":[],"mappings":";;;AAAA,yDAAiD;AAE1C,KAAK,UAAU,MAAM,CAAC,EAC3B,MAAM,EACN,kBAAkB,EAClB,UAAU,GAKX;;IACC,MAAM,OAAO,GAAG,0BAAS,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,UAAU,GAAG,MAAM,0BAAS,CAAC,WAAW,CAAC,sCAAsC,CACnF,UAAU,EACV,MAAM,CACP,CAAC;IAEF,MAAM,oBAAoB,GAAG,0BAAS,CAAC,MAAM,CAAC,kCAAkC,CAAC,OAAO,EAAE;QACxF,UAAU;QACV,kBAAkB;KACnB,CAAC,CAAC;IACH,OAAO,MAAA,MAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,aAAa,0CAAE,OAAO,0CAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC3E,CAAC;AArBD,wBAqBC","sourcesContent":["import { IOSConfig } from '@expo/config-plugins';\n\nexport async function isTVOS({\n scheme,\n buildConfiguration,\n workingDir,\n}: {\n scheme: string;\n buildConfiguration: string;\n workingDir: string;\n}): Promise<boolean> {\n const project = IOSConfig.XcodeUtils.getPbxproj(workingDir);\n\n const targetName = await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n workingDir,\n scheme\n );\n\n const xcBuildConfiguration = IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {\n targetName,\n buildConfiguration,\n });\n return xcBuildConfiguration?.buildSettings?.SDKROOT?.includes('appletv');\n}\n"]}
@@ -3,7 +3,9 @@ import { bunyan } from '@expo/logger';
3
3
  import { Job } from '@expo/eas-build-job';
4
4
  import { BuildContext } from '../context';
5
5
  export declare function findArtifacts(rootDir: string, patternOrPath: string, buildLogger: bunyan): Promise<string[]>;
6
- export declare function maybeFindAndUploadBuildArtifacts(ctx: BuildContext<Job>, logger: bunyan): Promise<void>;
6
+ export declare function maybeFindAndUploadBuildArtifacts(ctx: BuildContext<Job>, { logger }: {
7
+ logger: bunyan;
8
+ }): Promise<void>;
7
9
  export declare function uploadApplicationArchive(ctx: BuildContext<Job>, { logger, patternOrPath, rootDir, }: {
8
10
  logger: bunyan;
9
11
  patternOrPath: string;
@@ -39,7 +39,7 @@ async function logMissingFileError(artifactPath, buildLogger) {
39
39
  buildLogger.error(`There is no such file or directory "${artifactPath}". Directory "${currentPath}" contains [${dirContent.join(', ')}].`);
40
40
  }
41
41
  }
42
- async function maybeFindAndUploadBuildArtifacts(ctx, logger) {
42
+ async function maybeFindAndUploadBuildArtifacts(ctx, { logger }) {
43
43
  if (!ctx.job.buildArtifactPaths || ctx.job.buildArtifactPaths.length === 0) {
44
44
  return;
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/utils/artifacts.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,0DAA2B;AAI3B,wCAAwD;AAEjD,KAAK,UAAU,aAAa,CACjC,OAAe,EACf,aAAqB,EACrB,WAAmB;IAEnB,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAE,EAAC,aAAa,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,IAAI,mBAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,wCAAwC,aAAa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AAC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1E,OAAO;KACR;IACD,IAAI;QACF,MAAM,cAAc,GAAG,CACrB,MAAM,OAAO,CAAC,GAAG,CACf,GAAG,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACtC,aAAa,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAClE,CACF,CACF,CAAC,IAAI,EAAE,CAAC;QACT,MAAM,CAAC,IAAI,CAAC,8BAA8B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvE,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,eAAe,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;KACjF;IAAC,OAAO,GAAQ,EAAE;QACjB,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,kCAAkC,CAAC,CAAC;KAC3D;AACH,CAAC;AApBD,4EAoBC;AAEM,KAAK,UAAU,wBAAwB,CAC5C,GAAsB,EACtB,EACE,MAAM,EACN,aAAa,EACb,OAAO,GAKR;IAED,MAAM,mBAAmB,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IAChF,MAAM,CAAC,IAAI,CAAC,yBAAyB,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvE,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAC3F,CAAC;AAfD,4DAeC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport fg from 'fast-glob';\nimport { bunyan } from '@expo/logger';\nimport { Job } from '@expo/eas-build-job';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findArtifacts(\n rootDir: string,\n patternOrPath: string,\n buildLogger: bunyan\n): Promise<string[]> {\n const files = await fg(patternOrPath, { cwd: rootDir, onlyFiles: false });\n if (files.length === 0) {\n if (fg.isDynamicPattern(patternOrPath)) {\n throw new Error(`There are no files matching pattern \"${patternOrPath}\"`);\n } else {\n await logMissingFileError(path.join(rootDir, patternOrPath), buildLogger);\n throw new Error(`No such file or directory ${patternOrPath}`);\n }\n }\n return files.map((relativePath) => path.join(rootDir, relativePath));\n}\n\nasync function logMissingFileError(artifactPath: string, buildLogger: bunyan): Promise<void> {\n let currentPath = artifactPath;\n while (!(await fs.pathExists(currentPath))) {\n currentPath = path.resolve(currentPath, '..');\n }\n if (currentPath === path.resolve(currentPath, '..')) {\n buildLogger.error(`There is no such file or directory \"${artifactPath}\".`);\n return;\n }\n const dirContent = await fs.readdir(currentPath);\n if (dirContent.length === 0) {\n buildLogger.error(\n `There is no such file or directory \"${artifactPath}\". Directory \"${currentPath}\" is empty.`\n );\n } else {\n buildLogger.error(\n `There is no such file or directory \"${artifactPath}\". Directory \"${currentPath}\" contains [${dirContent.join(\n ', '\n )}].`\n );\n }\n}\n\nexport async function maybeFindAndUploadBuildArtifacts(\n ctx: BuildContext<Job>,\n logger: bunyan\n): Promise<void> {\n if (!ctx.job.buildArtifactPaths || ctx.job.buildArtifactPaths.length === 0) {\n return;\n }\n try {\n const buildArtifacts = (\n await Promise.all(\n ctx.job.buildArtifactPaths.map((path) =>\n findArtifacts(ctx.getReactNativeProjectDirectory(), path, logger)\n )\n )\n ).flat();\n logger.info(`Uploading build artifacts: ${buildArtifacts.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.BUILD_ARTIFACTS, buildArtifacts, logger);\n } catch (err: any) {\n logger.error({ err }, 'Failed to upload build artifacts');\n }\n}\n\nexport async function uploadApplicationArchive(\n ctx: BuildContext<Job>,\n {\n logger,\n patternOrPath,\n rootDir,\n }: {\n logger: bunyan;\n patternOrPath: string;\n rootDir: string;\n }\n): Promise<void> {\n const applicationArchives = await findArtifacts(rootDir, patternOrPath, logger);\n logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, logger);\n}\n"]}
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/utils/artifacts.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,0DAA2B;AAI3B,wCAAwD;AAEjD,KAAK,UAAU,aAAa,CACjC,OAAe,EACf,aAAqB,EACrB,WAAmB;IAEnB,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAE,EAAC,aAAa,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,IAAI,mBAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,wCAAwC,aAAa,GAAG,CAAC,CAAC;SAC3E;aAAM;YACL,MAAM,mBAAmB,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,WAAW,CAAC,CAAC;YAC1E,MAAM,IAAI,KAAK,CAAC,6BAA6B,aAAa,EAAE,CAAC,CAAC;SAC/D;KACF;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACvE,CAAC;AAfD,sCAeC;AAED,KAAK,UAAU,mBAAmB,CAAC,YAAoB,EAAE,WAAmB;IAC1E,IAAI,WAAW,GAAG,YAAY,CAAC;IAC/B,OAAO,CAAC,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE;QAC1C,WAAW,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;KAC/C;IACD,IAAI,WAAW,KAAK,cAAI,CAAC,OAAO,CAAC,WAAW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M,KAAK,UAAU,wBAAwB,CAC5C,GAAsB,EACtB,EACE,MAAM,EACN,aAAa,EACb,OAAO,GAKR;IAED,MAAM,mBAAmB,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IAChF,MAAM,CAAC,IAAI,CAAC,yBAAyB,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvE,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAC3F,CAAC;AAfD,4DAeC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport fg from 'fast-glob';\nimport { bunyan } from '@expo/logger';\nimport { Job } from '@expo/eas-build-job';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findArtifacts(\n rootDir: string,\n patternOrPath: string,\n buildLogger: bunyan\n): Promise<string[]> {\n const files = await fg(patternOrPath, { cwd: rootDir, onlyFiles: false });\n if (files.length === 0) {\n if (fg.isDynamicPattern(patternOrPath)) {\n throw new Error(`There are no files matching pattern \"${patternOrPath}\"`);\n } else {\n await logMissingFileError(path.join(rootDir, patternOrPath), buildLogger);\n throw new Error(`No such file or directory ${patternOrPath}`);\n }\n }\n return files.map((relativePath) => path.join(rootDir, relativePath));\n}\n\nasync function logMissingFileError(artifactPath: string, buildLogger: bunyan): Promise<void> {\n let currentPath = artifactPath;\n while (!(await fs.pathExists(currentPath))) {\n currentPath = path.resolve(currentPath, '..');\n }\n if (currentPath === path.resolve(currentPath, '..')) {\n buildLogger.error(`There is no such file or directory \"${artifactPath}\".`);\n return;\n }\n const dirContent = await fs.readdir(currentPath);\n if (dirContent.length === 0) {\n buildLogger.error(\n `There is no such file or directory \"${artifactPath}\". Directory \"${currentPath}\" is empty.`\n );\n } else {\n buildLogger.error(\n `There is no such file or directory \"${artifactPath}\". Directory \"${currentPath}\" contains [${dirContent.join(\n ', '\n )}].`\n );\n }\n}\n\nexport async function maybeFindAndUploadBuildArtifacts(\n ctx: BuildContext<Job>,\n { logger }: { logger: bunyan }\n): Promise<void> {\n if (!ctx.job.buildArtifactPaths || ctx.job.buildArtifactPaths.length === 0) {\n return;\n }\n try {\n const buildArtifacts = (\n await Promise.all(\n ctx.job.buildArtifactPaths.map((path) =>\n findArtifacts(ctx.getReactNativeProjectDirectory(), path, logger)\n )\n )\n ).flat();\n logger.info(`Uploading build artifacts: ${buildArtifacts.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.BUILD_ARTIFACTS, buildArtifacts, logger);\n } catch (err: any) {\n logger.error({ err }, 'Failed to upload build artifacts');\n }\n}\n\nexport async function uploadApplicationArchive(\n ctx: BuildContext<Job>,\n {\n logger,\n patternOrPath,\n rootDir,\n }: {\n logger: bunyan;\n patternOrPath: string;\n rootDir: string;\n }\n): Promise<void> {\n const applicationArchives = await findArtifacts(rootDir, patternOrPath, logger);\n logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, logger);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -61,5 +61,5 @@
61
61
  "node": "18.13.0",
62
62
  "yarn": "1.22.19"
63
63
  },
64
- "gitHead": "40fb0b2ffecf14b2cbd63dc51b910cf486351783"
64
+ "gitHead": "442607797f500d49c657e6af845c0d82d3d8c921"
65
65
  }