@expo/build-tools 1.0.32 → 1.0.34

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 (62) hide show
  1. package/dist/customBuildContext.d.ts +1 -0
  2. package/dist/customBuildContext.js +1 -0
  3. package/dist/customBuildContext.js.map +1 -1
  4. package/dist/steps/easFunctions.js +14 -2
  5. package/dist/steps/easFunctions.js.map +1 -1
  6. package/dist/steps/functions/eas/buildReactNativeApp.js +0 -6
  7. package/dist/steps/functions/eas/buildReactNativeApp.js.map +1 -1
  8. package/dist/steps/functions/eas/{configureExpoUpdatesIfInstalled.js → configureEASUpdateIfInstalled.js} +1 -1
  9. package/dist/steps/functions/eas/configureEASUpdateIfInstalled.js.map +1 -0
  10. package/dist/steps/functions/eas/findAndUploadBuildArtifacts.js +1 -5
  11. package/dist/steps/functions/eas/findAndUploadBuildArtifacts.js.map +1 -1
  12. package/dist/steps/functions/utils/configureIosCredentials.d.ts +2 -0
  13. package/dist/steps/functions/utils/configureIosCredentials.js +54 -0
  14. package/dist/steps/functions/utils/configureIosCredentials.js.map +1 -0
  15. package/dist/steps/functions/utils/configureIosVersion.d.ts +2 -0
  16. package/dist/steps/functions/utils/configureIosVersion.js +77 -0
  17. package/dist/steps/functions/utils/configureIosVersion.js.map +1 -0
  18. package/dist/steps/functions/utils/generateGymfileFromTemplate.d.ts +2 -0
  19. package/dist/steps/functions/utils/generateGymfileFromTemplate.js +209 -0
  20. package/dist/steps/functions/utils/generateGymfileFromTemplate.js.map +1 -0
  21. package/dist/steps/functions/utils/resolveAppleTeamIdFromCredentials.d.ts +2 -0
  22. package/dist/steps/functions/utils/resolveAppleTeamIdFromCredentials.js +47 -0
  23. package/dist/steps/functions/utils/resolveAppleTeamIdFromCredentials.js.map +1 -0
  24. package/dist/steps/functions/utils/runFastlane.d.ts +2 -0
  25. package/dist/steps/functions/utils/runFastlane.js +26 -0
  26. package/dist/steps/functions/utils/runFastlane.js.map +1 -0
  27. package/dist/steps/functions/utils/runGradle.d.ts +2 -0
  28. package/dist/steps/functions/utils/runGradle.js +36 -0
  29. package/dist/steps/functions/utils/runGradle.js.map +1 -0
  30. package/dist/steps/utils/android/gradle.d.ts +11 -0
  31. package/dist/steps/utils/android/gradle.js +110 -0
  32. package/dist/steps/utils/android/gradle.js.map +1 -0
  33. package/dist/steps/utils/ios/configure.d.ts +15 -0
  34. package/dist/steps/utils/ios/configure.js +78 -0
  35. package/dist/steps/utils/ios/configure.js.map +1 -0
  36. package/dist/steps/utils/ios/credentials/credentials.d.ts +4 -0
  37. package/dist/steps/utils/ios/credentials/credentials.js +16 -0
  38. package/dist/steps/utils/ios/credentials/credentials.js.map +1 -0
  39. package/dist/steps/utils/ios/credentials/distributionCertificate.d.ts +3 -0
  40. package/dist/steps/utils/ios/credentials/distributionCertificate.js +52 -0
  41. package/dist/steps/utils/ios/credentials/distributionCertificate.js.map +1 -0
  42. package/dist/steps/utils/ios/credentials/keychain.d.ts +19 -0
  43. package/dist/steps/utils/ios/credentials/keychain.js +93 -0
  44. package/dist/steps/utils/ios/credentials/keychain.js.map +1 -0
  45. package/dist/steps/utils/ios/credentials/manager.d.ts +23 -0
  46. package/dist/steps/utils/ios/credentials/manager.js +115 -0
  47. package/dist/steps/utils/ios/credentials/manager.js.map +1 -0
  48. package/dist/steps/utils/ios/credentials/provisioningProfile.d.ts +35 -0
  49. package/dist/steps/utils/ios/credentials/provisioningProfile.js +114 -0
  50. package/dist/steps/utils/ios/credentials/provisioningProfile.js.map +1 -0
  51. package/dist/steps/utils/ios/fastlane.d.ts +7 -3
  52. package/dist/steps/utils/ios/fastlane.js +21 -34
  53. package/dist/steps/utils/ios/fastlane.js.map +1 -1
  54. package/dist/steps/utils/ios/resolve.d.ts +2 -4
  55. package/dist/steps/utils/ios/resolve.js +9 -3
  56. package/dist/steps/utils/ios/resolve.js.map +1 -1
  57. package/dist/steps/utils/ios/xcpretty.d.ts +16 -0
  58. package/dist/steps/utils/ios/xcpretty.js +88 -0
  59. package/dist/steps/utils/ios/xcpretty.js.map +1 -0
  60. package/package.json +3 -3
  61. package/dist/steps/functions/eas/configureExpoUpdatesIfInstalled.js.map +0 -1
  62. /package/dist/steps/functions/eas/{configureExpoUpdatesIfInstalled.d.ts → configureEASUpdateIfInstalled.d.ts} +0 -0
@@ -10,6 +10,7 @@ export declare class CustomBuildContext implements ExternalBuildContextProvider
10
10
  readonly projectSourceDirectory: string;
11
11
  readonly projectTargetDirectory: string;
12
12
  readonly defaultWorkingDirectory: string;
13
+ readonly buildLogsDirectory: string;
13
14
  readonly logger: bunyan;
14
15
  readonly runtimeApi: BuilderRuntimeApi;
15
16
  readonly job: Job;
@@ -19,6 +19,7 @@ class CustomBuildContext {
19
19
  this.projectSourceDirectory = path_1.default.join(buildCtx.workingdir, 'temporary-custom-build');
20
20
  this.projectTargetDirectory = path_1.default.join(buildCtx.workingdir, 'build');
21
21
  this.defaultWorkingDirectory = buildCtx.getReactNativeProjectDirectory();
22
+ this.buildLogsDirectory = path_1.default.join(buildCtx.workingdir, 'logs');
22
23
  this.runtimeApi = {
23
24
  uploadArtifacts: (...args) => buildCtx['uploadArtifacts'](...args),
24
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"customBuildContext.js","sourceRoot":"","sources":["../src/customBuildContext.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAqE;AAErE,uCAAiF;AAIjF,MAAM,8BAA8B,GAA2C;IAC7E,CAAC,wBAAQ,CAAC,OAAO,CAAC,EAAE,4BAAoB,CAAC,KAAK;IAC9C,CAAC,wBAAQ,CAAC,GAAG,CAAC,EAAE,4BAAoB,CAAC,MAAM;CAC5C,CAAC;AAMF,MAAa,kBAAkB;IAsB7B,YAAY,QAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QAExB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,0BAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;QACvF,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,uBAAuB,GAAG,QAAQ,CAAC,8BAA8B,EAAE,CAAC;QACzE,IAAI,CAAC,UAAU,GAAG;YAChB,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC;SACnE,CAAC;IACJ,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,aAAa;QAClB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;IAEM,SAAS,CAAC,GAAQ;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;CACF;AApDD,gDAoDC","sourcesContent":["import path from 'path';\n\nimport { BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport { ExternalBuildContextProvider, BuildRuntimePlatform } from '@expo/steps';\n\nimport { ArtifactType, BuildContext } from './context';\n\nconst platformToBuildRuntimePlatform: Record<Platform, BuildRuntimePlatform> = {\n [Platform.ANDROID]: BuildRuntimePlatform.LINUX,\n [Platform.IOS]: BuildRuntimePlatform.DARWIN,\n};\n\nexport interface BuilderRuntimeApi {\n uploadArtifacts: (type: ArtifactType, paths: string[], logger: bunyan) => Promise<void>;\n}\n\nexport class CustomBuildContext implements ExternalBuildContextProvider {\n /*\n * Directory that contains project sources before eas/checkout.\n */\n public readonly projectSourceDirectory: string;\n\n /*\n * Directory where build is executed. eas/checkout will copy sources here.\n */\n public readonly projectTargetDirectory: string;\n\n /*\n * Directory where all build steps will be executed unless configured otherwise.\n */\n public readonly defaultWorkingDirectory: string;\n\n public readonly logger: bunyan;\n public readonly runtimeApi: BuilderRuntimeApi;\n public readonly job: Job;\n\n private _env: Env;\n\n constructor(buildCtx: BuildContext<Job>) {\n this._env = buildCtx.env;\n this.job = buildCtx.job;\n\n this.logger = buildCtx.logger.child({ phase: BuildPhase.CUSTOM });\n this.projectSourceDirectory = path.join(buildCtx.workingdir, 'temporary-custom-build');\n this.projectTargetDirectory = path.join(buildCtx.workingdir, 'build');\n this.defaultWorkingDirectory = buildCtx.getReactNativeProjectDirectory();\n this.runtimeApi = {\n uploadArtifacts: (...args) => buildCtx['uploadArtifacts'](...args),\n };\n }\n\n public get runtimePlatform(): BuildRuntimePlatform {\n return platformToBuildRuntimePlatform[this.job.platform];\n }\n\n public get env(): Env {\n return this._env;\n }\n\n public staticContext(): any {\n return {\n job: this.job,\n };\n }\n\n public updateEnv(env: Env): void {\n this._env = env;\n }\n}\n"]}
1
+ {"version":3,"file":"customBuildContext.js","sourceRoot":"","sources":["../src/customBuildContext.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAqE;AAErE,uCAAiF;AAIjF,MAAM,8BAA8B,GAA2C;IAC7E,CAAC,wBAAQ,CAAC,OAAO,CAAC,EAAE,4BAAoB,CAAC,KAAK;IAC9C,CAAC,wBAAQ,CAAC,GAAG,CAAC,EAAE,4BAAoB,CAAC,MAAM;CAC5C,CAAC;AAMF,MAAa,kBAAkB;IA2B7B,YAAY,QAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QAExB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,0BAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;QACvF,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,uBAAuB,GAAG,QAAQ,CAAC,8BAA8B,EAAE,CAAC;QACzE,IAAI,CAAC,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG;YAChB,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC;SACnE,CAAC;IACJ,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,aAAa;QAClB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;IAEM,SAAS,CAAC,GAAQ;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;CACF;AA1DD,gDA0DC","sourcesContent":["import path from 'path';\n\nimport { BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport { ExternalBuildContextProvider, BuildRuntimePlatform } from '@expo/steps';\n\nimport { ArtifactType, BuildContext } from './context';\n\nconst platformToBuildRuntimePlatform: Record<Platform, BuildRuntimePlatform> = {\n [Platform.ANDROID]: BuildRuntimePlatform.LINUX,\n [Platform.IOS]: BuildRuntimePlatform.DARWIN,\n};\n\nexport interface BuilderRuntimeApi {\n uploadArtifacts: (type: ArtifactType, paths: string[], logger: bunyan) => Promise<void>;\n}\n\nexport class CustomBuildContext implements ExternalBuildContextProvider {\n /*\n * Directory that contains project sources before eas/checkout.\n */\n public readonly projectSourceDirectory: string;\n\n /*\n * Directory where build is executed. eas/checkout will copy sources here.\n */\n public readonly projectTargetDirectory: string;\n\n /*\n * Directory where all build steps will be executed unless configured otherwise.\n */\n public readonly defaultWorkingDirectory: string;\n\n /*\n * Directory where build logs will be stored unless configure otherwise.\n */\n public readonly buildLogsDirectory: string;\n\n public readonly logger: bunyan;\n public readonly runtimeApi: BuilderRuntimeApi;\n public readonly job: Job;\n\n private _env: Env;\n\n constructor(buildCtx: BuildContext<Job>) {\n this._env = buildCtx.env;\n this.job = buildCtx.job;\n\n this.logger = buildCtx.logger.child({ phase: BuildPhase.CUSTOM });\n this.projectSourceDirectory = path.join(buildCtx.workingdir, 'temporary-custom-build');\n this.projectTargetDirectory = path.join(buildCtx.workingdir, 'build');\n this.defaultWorkingDirectory = buildCtx.getReactNativeProjectDirectory();\n this.buildLogsDirectory = path.join(buildCtx.workingdir, 'logs');\n this.runtimeApi = {\n uploadArtifacts: (...args) => buildCtx['uploadArtifacts'](...args),\n };\n }\n\n public get runtimePlatform(): BuildRuntimePlatform {\n return platformToBuildRuntimePlatform[this.job.platform];\n }\n\n public get env(): Env {\n return this._env;\n }\n\n public staticContext(): any {\n return {\n job: this.job,\n };\n }\n\n public updateEnv(env: Env): void {\n this._env = env;\n }\n}\n"]}
@@ -8,9 +8,15 @@ const installNodeModules_1 = require("./functions/eas/installNodeModules");
8
8
  const prebuild_1 = require("./functions/eas/prebuild");
9
9
  const buildReactNativeApp_1 = require("./functions/eas/buildReactNativeApp");
10
10
  const findAndUploadBuildArtifacts_1 = require("./functions/eas/findAndUploadBuildArtifacts");
11
- const configureExpoUpdatesIfInstalled_1 = require("./functions/eas/configureExpoUpdatesIfInstalled");
11
+ const configureEASUpdateIfInstalled_1 = require("./functions/eas/configureEASUpdateIfInstalled");
12
12
  const injectAndroidCredentials_1 = require("./functions/utils/injectAndroidCredentials");
13
13
  const configureAndroidVersion_1 = require("./functions/utils/configureAndroidVersion");
14
+ const runGradle_1 = require("./functions/utils/runGradle");
15
+ const resolveAppleTeamIdFromCredentials_1 = require("./functions/utils/resolveAppleTeamIdFromCredentials");
16
+ const configureIosCredentials_1 = require("./functions/utils/configureIosCredentials");
17
+ const configureIosVersion_1 = require("./functions/utils/configureIosVersion");
18
+ const generateGymfileFromTemplate_1 = require("./functions/utils/generateGymfileFromTemplate");
19
+ const runFastlane_1 = require("./functions/utils/runFastlane");
14
20
  function getEasFunctions(ctx, oldCtx // TODO: remove
15
21
  ) {
16
22
  return [
@@ -21,9 +27,15 @@ function getEasFunctions(ctx, oldCtx // TODO: remove
21
27
  (0, prebuild_1.createPrebuildBuildFunction)(ctx),
22
28
  (0, buildReactNativeApp_1.createBuildReactNativeAppBuildFunction)(oldCtx),
23
29
  (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(ctx),
24
- (0, configureExpoUpdatesIfInstalled_1.configureEASUpdateIfInstalledFunction)(),
30
+ (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)(),
25
31
  (0, injectAndroidCredentials_1.injectAndroidCredentialsFunction)(),
26
32
  (0, configureAndroidVersion_1.configureAndroidVersionFunction)(),
33
+ (0, runGradle_1.runGradleFunction)(),
34
+ (0, resolveAppleTeamIdFromCredentials_1.resolveAppleTeamIdFromCredentialsFunction)(),
35
+ (0, configureIosCredentials_1.configureIosCredentialsFunction)(),
36
+ (0, configureIosVersion_1.configureIosVersionFunction)(),
37
+ (0, generateGymfileFromTemplate_1.generateGymfileFromTemplateFunction)(),
38
+ (0, runFastlane_1.runFastlaneFunction)(),
27
39
  ];
28
40
  }
29
41
  exports.getEasFunctions = getEasFunctions;
@@ -1 +1 @@
1
- {"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAMA,qEAAqF;AACrF,uDAAuE;AACvE,2DAA2E;AAC3E,2EAA2F;AAC3F,uDAAuE;AACvE,6EAA6F;AAC7F,6FAA6G;AAC7G,qGAAwG;AACxG,yFAA8F;AAC9F,uFAA4F;AAE5F,SAAgB,eAAe,CAC7B,GAAuB,EACvB,MAAyB,CAAC,eAAe;;IAEzC,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,0CAA6B,EAAC,GAAG,CAAC;QAClC,IAAA,0DAAqC,EAAC,GAAG,CAAC;QAC1C,IAAA,sCAA2B,EAAC,GAAG,CAAC;QAChC,IAAA,4DAAsC,EAAC,MAAM,CAAC;QAC9C,IAAA,4EAA8C,EAAC,GAAG,CAAC;QACnD,IAAA,uEAAqC,GAAE;QACvC,IAAA,2DAAgC,GAAE;QAClC,IAAA,yDAA+B,GAAE;KAClC,CAAC;AACJ,CAAC;AAhBD,0CAgBC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../context';\nimport { CustomBuildContext } from '../customBuildContext';\n\nimport { createUploadArtifactBuildFunction } from './functions/utils/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/eas/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/eas/setUpNpmrc';\nimport { createInstallNodeModulesBuildFunction } from './functions/eas/installNodeModules';\nimport { createPrebuildBuildFunction } from './functions/eas/prebuild';\nimport { createBuildReactNativeAppBuildFunction } from './functions/eas/buildReactNativeApp';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/eas/findAndUploadBuildArtifacts';\nimport { configureEASUpdateIfInstalledFunction } from './functions/eas/configureExpoUpdatesIfInstalled';\nimport { injectAndroidCredentialsFunction } from './functions/utils/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from './functions/utils/configureAndroidVersion';\n\nexport function getEasFunctions(\n ctx: CustomBuildContext,\n oldCtx: BuildContext<Job> // TODO: remove\n): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(ctx),\n createInstallNodeModulesBuildFunction(ctx),\n createPrebuildBuildFunction(ctx),\n createBuildReactNativeAppBuildFunction(oldCtx),\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n configureEASUpdateIfInstalledFunction(),\n injectAndroidCredentialsFunction(),\n configureAndroidVersionFunction(),\n ];\n}\n"]}
1
+ {"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAMA,qEAAqF;AACrF,uDAAuE;AACvE,2DAA2E;AAC3E,2EAA2F;AAC3F,uDAAuE;AACvE,6EAA6F;AAC7F,6FAA6G;AAC7G,iGAAsG;AACtG,yFAA8F;AAC9F,uFAA4F;AAC5F,2DAAgE;AAChE,2GAAgH;AAChH,uFAA4F;AAC5F,+EAAoF;AACpF,+FAAoG;AACpG,+DAAoE;AAEpE,SAAgB,eAAe,CAC7B,GAAuB,EACvB,MAAyB,CAAC,eAAe;;IAEzC,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,0CAA6B,EAAC,GAAG,CAAC;QAClC,IAAA,0DAAqC,EAAC,GAAG,CAAC;QAC1C,IAAA,sCAA2B,EAAC,GAAG,CAAC;QAChC,IAAA,4DAAsC,EAAC,MAAM,CAAC;QAC9C,IAAA,4EAA8C,EAAC,GAAG,CAAC;QACnD,IAAA,qEAAqC,GAAE;QACvC,IAAA,2DAAgC,GAAE;QAClC,IAAA,yDAA+B,GAAE;QACjC,IAAA,6BAAiB,GAAE;QACnB,IAAA,6EAAyC,GAAE;QAC3C,IAAA,yDAA+B,GAAE;QACjC,IAAA,iDAA2B,GAAE;QAC7B,IAAA,iEAAmC,GAAE;QACrC,IAAA,iCAAmB,GAAE;KACtB,CAAC;AACJ,CAAC;AAtBD,0CAsBC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../context';\nimport { CustomBuildContext } from '../customBuildContext';\n\nimport { createUploadArtifactBuildFunction } from './functions/utils/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/eas/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/eas/setUpNpmrc';\nimport { createInstallNodeModulesBuildFunction } from './functions/eas/installNodeModules';\nimport { createPrebuildBuildFunction } from './functions/eas/prebuild';\nimport { createBuildReactNativeAppBuildFunction } from './functions/eas/buildReactNativeApp';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/eas/findAndUploadBuildArtifacts';\nimport { configureEASUpdateIfInstalledFunction } from './functions/eas/configureEASUpdateIfInstalled';\nimport { injectAndroidCredentialsFunction } from './functions/utils/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from './functions/utils/configureAndroidVersion';\nimport { runGradleFunction } from './functions/utils/runGradle';\nimport { resolveAppleTeamIdFromCredentialsFunction } from './functions/utils/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from './functions/utils/configureIosCredentials';\nimport { configureIosVersionFunction } from './functions/utils/configureIosVersion';\nimport { generateGymfileFromTemplateFunction } from './functions/utils/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from './functions/utils/runFastlane';\n\nexport function getEasFunctions(\n ctx: CustomBuildContext,\n oldCtx: BuildContext<Job> // TODO: remove\n): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(ctx),\n createInstallNodeModulesBuildFunction(ctx),\n createPrebuildBuildFunction(ctx),\n createBuildReactNativeAppBuildFunction(oldCtx),\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n configureEASUpdateIfInstalledFunction(),\n injectAndroidCredentialsFunction(),\n configureAndroidVersionFunction(),\n runGradleFunction(),\n resolveAppleTeamIdFromCredentialsFunction(),\n configureIosCredentialsFunction(),\n configureIosVersionFunction(),\n generateGymfileFromTemplateFunction(),\n runFastlaneFunction(),\n ];\n}\n"]}
@@ -9,7 +9,6 @@ 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
12
  const fastlane_1 = require("../../utils/ios/fastlane");
14
13
  function createBuildReactNativeAppBuildFunction(ctx) {
15
14
  return new steps_1.BuildFunction({
@@ -30,16 +29,11 @@ function createBuildReactNativeAppBuildFunction(ctx) {
30
29
  });
31
30
  }
32
31
  else {
33
- const iosCtx = ctx;
34
32
  const iosDir = path_1.default.join(stepsCtx.workingDirectory, 'ios');
35
33
  if (!(await fs_extra_1.default.exists(iosDir))) {
36
34
  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
35
  }
38
- const scheme = (0, resolve_1.resolveScheme)(iosCtx.job, { workingDir: stepsCtx.workingDirectory });
39
- const buildConfiguration = (0, resolve_1.resolveBuildConfiguration)(iosCtx.job);
40
36
  await (0, fastlane_1.runFastlaneGym)({
41
- scheme,
42
- buildConfiguration,
43
37
  workingDir: stepsCtx.workingDirectory,
44
38
  logger: stepsCtx.logger,
45
39
  buildLogsDirectory: ctx.buildLogsDirectory,
@@ -1 +1 @@
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;AACn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AAE,EAAE,UAAU,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;gBACpF,MAAM,kBAAkB,GAAG,IAAA,mCAAyB,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACjE,MAAM,IAAA,yBAAc,EAAC;oBACnB,MAAM;oBACN,kBAAkB;oBAClB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;oBACrC,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;oBAC1C,GAAG,EAAE,GAAG,CAAC,GAAG;iBACb,CAAC,CAAC;aACJ;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1CD,wFA0CC","sourcesContent":["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"]}
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;AACjF,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,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,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;gBAC3D,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE;oBAC9B,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,0BAA0B,MAAM,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CACvS,CAAC;iBACH;gBACD,MAAM,IAAA,yBAAc,EAAC;oBACnB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;oBACrC,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;oBAC1C,GAAG,EAAE,GAAG,CAAC,GAAG;iBACb,CAAC,CAAC;aACJ;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AArCD,wFAqCC","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';\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 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 await runFastlaneGym({\n workingDir: stepsCtx.workingDirectory,\n logger: stepsCtx.logger,\n buildLogsDirectory: ctx.buildLogsDirectory,\n env: ctx.env,\n });\n }\n },\n });\n}\n"]}
@@ -53,4 +53,4 @@ function configureEASUpdateIfInstalledFunction() {
53
53
  });
54
54
  }
55
55
  exports.configureEASUpdateIfInstalledFunction = configureEASUpdateIfInstalledFunction;
56
- //# sourceMappingURL=configureExpoUpdatesIfInstalled.js.map
56
+ //# sourceMappingURL=configureEASUpdateIfInstalled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configureEASUpdateIfInstalled.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/configureEASUpdateIfInstalled.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uCAAyF;AAEzF,oDAA4B;AAE5B,wDAAyD;AACzD,yDAA6E;AAE7E,SAAgB,qCAAqC;IACnD,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,mCAAmC;QACvC,IAAI,EAAE,mCAAmC;QACzC,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,iBAAiB;gBAC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S;gBACT,MAAM,EAAE;oBACN,cAAc,EAAE,mBAAmB;oBACnC,OAAO,EAAE,mBAAmB;iBAC7B;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAlDD,sFAkDC","sourcesContent":["import assert from 'assert';\n\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { Job } from '@expo/eas-build-job';\nimport semver from 'semver';\n\nimport { readAppConfig } from '../../../utils/appConfig';\nimport { configureEASUpdateIfInstalledAsync } from '../../utils/expoUpdates';\n\nexport function configureEASUpdateIfInstalledFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'configure_eas_update_if_installed',\n name: 'Configure EAS Update if installed',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'runtime_version',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'channel',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n ],\n fn: async (stepCtx, { env, inputs }) => {\n assert(stepCtx.global.staticContext.job, 'Job is not defined');\n const job = stepCtx.global.staticContext.job as Job;\n\n const appConfig = readAppConfig(\n stepCtx.workingDirectory,\n Object.keys(env).reduce((acc, key) => {\n acc[key] = env[key] ?? '';\n return acc;\n }, {} as Record<string, string>),\n stepCtx.logger\n ).exp;\n\n const releaseChannelInput = inputs.channel.value as string | undefined;\n const runtimeVersionInput = inputs.runtime_version.value as string | undefined;\n if (runtimeVersionInput && !semver.valid(runtimeVersionInput)) {\n throw new Error(\n `Runtime version provided by the \"runtime_version\" input is not a valid semver version: ${releaseChannelInput}`\n );\n }\n\n await configureEASUpdateIfInstalledAsync({\n job,\n workingDirectory: stepCtx.workingDirectory,\n logger: stepCtx.logger,\n appConfig,\n inputs: {\n runtimeVersion: runtimeVersionInput,\n channel: releaseChannelInput,\n },\n });\n },\n });\n}\n"]}
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.createFindAndUploadBuildArtifactsBuildFunction = void 0;
7
- const path_1 = __importDefault(require("path"));
8
4
  const eas_build_job_1 = require("@expo/eas-build-job");
9
5
  const steps_1 = require("@expo/steps");
10
6
  const context_1 = require("../../../context");
@@ -39,7 +35,7 @@ function createFindAndUploadBuildArtifactsBuildFunction(ctx) {
39
35
  if (ctx.job.platform !== eas_build_job_1.Platform.IOS) {
40
36
  return;
41
37
  }
42
- const xcodeBuildLogsPath = await (0, xcodeBuildLogs_1.findXcodeBuildLogsPathAsync)(path_1.default.resolve(ctx.projectTargetDirectory, '../logs'));
38
+ const xcodeBuildLogsPath = await (0, xcodeBuildLogs_1.findXcodeBuildLogsPathAsync)(stepCtx.global.buildLogsDirectory);
43
39
  if (xcodeBuildLogsPath) {
44
40
  await ctx.runtimeApi.uploadArtifacts(context_1.ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], logger);
45
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAoD;AACpD,uCAA4C;AAE5C,8CAAgD;AAChD,wDAAyD;AACzD,gEAA0E;AAG1E,SAAgB,8CAA8C,CAC5D,GAAuB;IAEvB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;;YACpB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC3B,MAAM,+BAA+B,GACnC,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO;gBACnC,CAAC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ACL,OAAO,iBAAiB,CAAC;KAC1B;AACH,CAAC","sourcesContent":["import path from 'path';\n\nimport { Ios, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { ArtifactType } from '../../../context';\nimport { findArtifacts } from '../../../utils/artifacts';\nimport { findXcodeBuildLogsPathAsync } from '../../../ios/xcodeBuildLogs';\nimport { CustomBuildContext } from '../../../customBuildContext';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction(\n ctx: CustomBuildContext\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 (stepCtx) => {\n const { logger } = stepCtx;\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveIosArtifactPath(ctx.job);\n const applicationArchives = await findArtifacts(\n stepCtx.workingDirectory,\n applicationArchivePatternOrPath,\n logger\n );\n logger.info(\n `Application archive${\n applicationArchives.length > 1 ? 's' : ''\n }: ${applicationArchives.join(', ')}`\n );\n const buildArtifacts = (\n await Promise.all(\n (ctx.job.buildArtifactPaths ?? []).map((path) =>\n findArtifacts(ctx.projectTargetDirectory, path, logger)\n )\n )\n ).flat();\n if (buildArtifacts.length > 0) {\n logger.info(`Found additional build artifacts: ${buildArtifacts.join(', ')}`);\n }\n\n logger.info('Uploading...');\n const [archiveUpload, artifactsUpload, xcodeBuildLogsUpload] = await Promise.allSettled([\n ctx.runtimeApi.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n applicationArchives,\n logger\n ),\n (async () => {\n if (buildArtifacts.length > 0) {\n await ctx.runtimeApi.uploadArtifacts(\n ArtifactType.BUILD_ARTIFACTS,\n buildArtifacts,\n logger\n );\n }\n })(),\n (async () => {\n if (ctx.job.platform !== Platform.IOS) {\n return;\n }\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(\n path.resolve(ctx.projectTargetDirectory, '../logs')\n );\n if (xcodeBuildLogsPath) {\n await ctx.runtimeApi.uploadArtifacts(\n ArtifactType.XCODE_BUILD_LOGS,\n [xcodeBuildLogsPath],\n logger\n );\n }\n })(),\n ]);\n if (archiveUpload.status === 'rejected') {\n logger.error('Failed to upload application archive.');\n throw archiveUpload.reason;\n }\n if (artifactsUpload.status === 'rejected') {\n logger.error('Failed to upload build artifacts.');\n throw artifactsUpload.reason;\n }\n if (xcodeBuildLogsUpload.status === 'rejected') {\n logger.error(`Failed to upload Xcode build logs. ${xcodeBuildLogsUpload.reason}`);\n }\n logger.info('Upload finished');\n },\n });\n}\n\nfunction resolveIosArtifactPath(job: Ios.Job): string {\n if (job.applicationArchivePath) {\n return job.applicationArchivePath;\n } else if (job.simulator) {\n return 'ios/build/Build/Products/*simulator/*.app';\n } else {\n return 'ios/build/*.ipa';\n }\n}\n"]}
1
+ {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AACpD,uCAA4C;AAE5C,8CAAgD;AAChD,wDAAyD;AACzD,gEAA0E;AAG1E,SAAgB,8CAA8C,CAC5D,GAAuB;IAEvB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;;YACpB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC3B,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,sBAAsB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,mBAAmB,GAAG,MAAM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,GAAG,EAAE;wBACrC,OAAO;qBACR;oBACD,MAAM,kBAAkB,GAAG,MAAM,IAAA,4CAA2B,EAC1D,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAClC,CAAC;oBACF,IAAI,kBAAkB,EAAE;wBACtB,MAAM,GAAG,CAAC,UAAU,CAAC,eAAe,CAClC,sBAAY,CAAC,gBAAgB,EAC7B,CAAC,kBAAkB,CAAC,EACpB,MAAM,CACP,CAAC;qBACH;gBACH,CAAC,CAAC,EAAE;aACL,CAAC,CAAC;YACH,IAAI,aAAa,CAAC,MAAM,KAAK,UAAU,EAAE;gBACvC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;gBACtD,MAAM,aAAa,CAAC,MAAM,CAAC;aAC5B;YACD,IAAI,eAAe,CAAC,MAAM,KAAK,UAAU,EAAE;gBACzC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;gBAClD,MAAM,eAAe,CAAC,MAAM,CAAC;aAC9B;YACD,IAAI,oBAAoB,CAAC,MAAM,KAAK,UAAU,EAAE;gBAC9C,MAAM,CAAC,KAAK,CAAC,sCAAsC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;aACnF;YACD,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACjC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAhFD,wGAgFC;AAED,SAAS,sBAAsB,CAAC,GAAY;IAC1C,IAAI,GAAG,CAAC,sBAAsB,EAAE;QAC9B,OAAO,GAAG,CAAC,sBAAsB,CAAC;KACnC;SAAM,IAAI,GAAG,CAAC,SAAS,EAAE;QACxB,OAAO,2CAA2C,CAAC;KACpD;SAAM;QACL,OAAO,iBAAiB,CAAC;KAC1B;AACH,CAAC","sourcesContent":["import { Ios, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { ArtifactType } from '../../../context';\nimport { findArtifacts } from '../../../utils/artifacts';\nimport { findXcodeBuildLogsPathAsync } from '../../../ios/xcodeBuildLogs';\nimport { CustomBuildContext } from '../../../customBuildContext';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction(\n ctx: CustomBuildContext\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 (stepCtx) => {\n const { logger } = stepCtx;\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveIosArtifactPath(ctx.job);\n const applicationArchives = await findArtifacts(\n stepCtx.workingDirectory,\n applicationArchivePatternOrPath,\n logger\n );\n logger.info(\n `Application archive${\n applicationArchives.length > 1 ? 's' : ''\n }: ${applicationArchives.join(', ')}`\n );\n const buildArtifacts = (\n await Promise.all(\n (ctx.job.buildArtifactPaths ?? []).map((path) =>\n findArtifacts(ctx.projectTargetDirectory, path, logger)\n )\n )\n ).flat();\n if (buildArtifacts.length > 0) {\n logger.info(`Found additional build artifacts: ${buildArtifacts.join(', ')}`);\n }\n\n logger.info('Uploading...');\n const [archiveUpload, artifactsUpload, xcodeBuildLogsUpload] = await Promise.allSettled([\n ctx.runtimeApi.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n applicationArchives,\n logger\n ),\n (async () => {\n if (buildArtifacts.length > 0) {\n await ctx.runtimeApi.uploadArtifacts(\n ArtifactType.BUILD_ARTIFACTS,\n buildArtifacts,\n logger\n );\n }\n })(),\n (async () => {\n if (ctx.job.platform !== Platform.IOS) {\n return;\n }\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(\n stepCtx.global.buildLogsDirectory\n );\n if (xcodeBuildLogsPath) {\n await ctx.runtimeApi.uploadArtifacts(\n ArtifactType.XCODE_BUILD_LOGS,\n [xcodeBuildLogsPath],\n logger\n );\n }\n })(),\n ]);\n if (archiveUpload.status === 'rejected') {\n logger.error('Failed to upload application archive.');\n throw archiveUpload.reason;\n }\n if (artifactsUpload.status === 'rejected') {\n logger.error('Failed to upload build artifacts.');\n throw artifactsUpload.reason;\n }\n if (xcodeBuildLogsUpload.status === 'rejected') {\n logger.error(`Failed to upload Xcode build logs. ${xcodeBuildLogsUpload.reason}`);\n }\n logger.info('Upload finished');\n },\n });\n}\n\nfunction resolveIosArtifactPath(job: Ios.Job): string {\n if (job.applicationArchivePath) {\n return job.applicationArchivePath;\n } else if (job.simulator) {\n return 'ios/build/Build/Products/*simulator/*.app';\n } else {\n return 'ios/build/*.ipa';\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { BuildFunction } from '@expo/steps';
2
+ export declare function configureIosCredentialsFunction(): BuildFunction;
@@ -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.configureIosCredentialsFunction = void 0;
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const steps_1 = require("@expo/steps");
9
+ const manager_1 = __importDefault(require("../../utils/ios/credentials/manager"));
10
+ const credentials_1 = require("../../utils/ios/credentials/credentials");
11
+ const configure_1 = require("../../utils/ios/configure");
12
+ const resolve_1 = require("../../utils/ios/resolve");
13
+ function configureIosCredentialsFunction() {
14
+ return new steps_1.BuildFunction({
15
+ namespace: 'utils',
16
+ id: 'configure_ios_credentials',
17
+ name: 'Configure iOS credentials',
18
+ inputProviders: [
19
+ steps_1.BuildStepInput.createProvider({
20
+ id: 'credentials',
21
+ required: true,
22
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.JSON,
23
+ defaultValue: '${ eas.job.secrets.buildCredentials }',
24
+ }),
25
+ steps_1.BuildStepInput.createProvider({
26
+ id: 'build_configuration',
27
+ required: false,
28
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
29
+ }),
30
+ ],
31
+ fn: async (stepCtx, { inputs }) => {
32
+ const rawCredentialsInput = inputs.credentials.value;
33
+ const { value, error } = credentials_1.IosBuildCredentialsSchema.validate(rawCredentialsInput, {
34
+ stripUnknown: true,
35
+ convert: true,
36
+ abortEarly: false,
37
+ });
38
+ if (error) {
39
+ throw error;
40
+ }
41
+ const credentialsManager = new manager_1.default(value);
42
+ const credentials = await credentialsManager.prepare(stepCtx.logger);
43
+ (0, assert_1.default)(stepCtx.global.staticContext.job, 'Job is not defined');
44
+ const job = stepCtx.global.staticContext.job;
45
+ await (0, configure_1.configureCredentialsAsync)(stepCtx.logger, stepCtx.workingDirectory, {
46
+ credentials,
47
+ buildConfiguration: (0, resolve_1.resolveBuildConfiguration)(job, inputs.build_configuration.value),
48
+ });
49
+ stepCtx.logger.info('Successfully configured iOS credentials');
50
+ },
51
+ });
52
+ }
53
+ exports.configureIosCredentialsFunction = configureIosCredentialsFunction;
54
+ //# sourceMappingURL=configureIosCredentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configureIosCredentials.js","sourceRoot":"","sources":["../../../../src/steps/functions/utils/configureIosCredentials.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uCAAyF;AAGzF,kFAAwE;AACxE,yEAAoF;AACpF,yDAAsE;AACtE,qDAAoE;AAEpE,SAAgB,+BAA+B;IAC7C,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,OAAO;QAClB,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,2BAA2B;QACjC,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,aAAa;gBACjB,QAAQ,EAAE,IAAI;gBACd,oBAAoB,EAAE,mCAA2B,CAAC,IAAI;gBACtD,YAAY,EAAE,uCAAuC;aACtD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,qBAAqB;gBACzB,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAChC,MAAM,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAAC,KAA4B,CAAC;YAC5E,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,uCAAyB,CAAC,QAAQ,CAAC,mBAAmB,EAAE;gBAC/E,YAAY,EAAE,IAAI;gBAClB,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,KAAK;aAClB,CAAC,CAAC;YACH,IAAI,KAAK,EAAE;gBACT,MAAM,KAAK,CAAC;aACb;YAED,MAAM,kBAAkB,GAAG,IAAI,iBAAqB,CAAC,KAAK,CAAC,CAAC;YAC5D,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAErE,IAAA,gBAAM,EAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;YAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,GAAc,CAAC;YAExD,MAAM,IAAA,qCAAyB,EAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,EAAE;gBACxE,WAAW;gBACX,kBAAkB,EAAE,IAAA,mCAAyB,EAC3C,GAAG,EACH,MAAM,CAAC,mBAAmB,CAAC,KAA2B,CACvD;aACF,CAAC,CAAC;YAEH,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACjE,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA9CD,0EA8CC","sourcesContent":["import assert from 'assert';\n\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { Ios } from '@expo/eas-build-job';\n\nimport IosCredentialsManager from '../../utils/ios/credentials/manager';\nimport { IosBuildCredentialsSchema } from '../../utils/ios/credentials/credentials';\nimport { configureCredentialsAsync } from '../../utils/ios/configure';\nimport { resolveBuildConfiguration } from '../../utils/ios/resolve';\n\nexport function configureIosCredentialsFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'utils',\n id: 'configure_ios_credentials',\n name: 'Configure iOS credentials',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'credentials',\n required: true,\n allowedValueTypeName: BuildStepInputValueTypeName.JSON,\n defaultValue: '${ eas.job.secrets.buildCredentials }',\n }),\n BuildStepInput.createProvider({\n id: 'build_configuration',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n ],\n fn: async (stepCtx, { inputs }) => {\n const rawCredentialsInput = inputs.credentials.value as Record<string, any>;\n const { value, error } = IosBuildCredentialsSchema.validate(rawCredentialsInput, {\n stripUnknown: true,\n convert: true,\n abortEarly: false,\n });\n if (error) {\n throw error;\n }\n\n const credentialsManager = new IosCredentialsManager(value);\n const credentials = await credentialsManager.prepare(stepCtx.logger);\n\n assert(stepCtx.global.staticContext.job, 'Job is not defined');\n const job = stepCtx.global.staticContext.job as Ios.Job;\n\n await configureCredentialsAsync(stepCtx.logger, stepCtx.workingDirectory, {\n credentials,\n buildConfiguration: resolveBuildConfiguration(\n job,\n inputs.build_configuration.value as string | undefined\n ),\n });\n\n stepCtx.logger.info('Successfully configured iOS credentials');\n },\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { BuildFunction } from '@expo/steps';
2
+ export declare function configureIosVersionFunction(): BuildFunction;
@@ -0,0 +1,77 @@
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.configureIosVersionFunction = void 0;
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const steps_1 = require("@expo/steps");
9
+ const semver_1 = __importDefault(require("semver"));
10
+ const credentials_1 = require("../../utils/ios/credentials/credentials");
11
+ const manager_1 = __importDefault(require("../../utils/ios/credentials/manager"));
12
+ const configure_1 = require("../../utils/ios/configure");
13
+ const resolve_1 = require("../../utils/ios/resolve");
14
+ function configureIosVersionFunction() {
15
+ return new steps_1.BuildFunction({
16
+ namespace: 'utils',
17
+ id: 'configure_ios_version',
18
+ name: 'Configure iOS version',
19
+ inputProviders: [
20
+ steps_1.BuildStepInput.createProvider({
21
+ id: 'credentials',
22
+ required: true,
23
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.JSON,
24
+ defaultValue: '${ eas.job.secrets.buildCredentials }',
25
+ }),
26
+ steps_1.BuildStepInput.createProvider({
27
+ id: 'build_configuration',
28
+ required: false,
29
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
30
+ }),
31
+ steps_1.BuildStepInput.createProvider({
32
+ id: 'build_number',
33
+ required: true,
34
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
35
+ defaultValue: '${ eas.job.version.buildNumber }',
36
+ }),
37
+ steps_1.BuildStepInput.createProvider({
38
+ id: 'app_version',
39
+ required: true,
40
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
41
+ defaultValue: '${ eas.job.version.appVersion }',
42
+ }),
43
+ ],
44
+ fn: async (stepCtx, { inputs }) => {
45
+ const rawCredentialsInput = inputs.credentials.value;
46
+ const { value, error } = credentials_1.IosBuildCredentialsSchema.validate(rawCredentialsInput, {
47
+ stripUnknown: true,
48
+ convert: true,
49
+ abortEarly: false,
50
+ });
51
+ if (error) {
52
+ throw error;
53
+ }
54
+ const credentialsManager = new manager_1.default(value);
55
+ const credentials = await credentialsManager.prepare(stepCtx.logger);
56
+ (0, assert_1.default)(stepCtx.global.staticContext.job, 'Job is not defined');
57
+ const job = stepCtx.global.staticContext.job;
58
+ const buildNumber = inputs.build_number.value;
59
+ const appVersion = inputs.app_version.value;
60
+ if (!semver_1.default.valid(appVersion)) {
61
+ throw new Error(`App verrsion provided by the "app_version" input is not a valid semver version: ${appVersion}`);
62
+ }
63
+ stepCtx.logger.info('Setting iOS version...');
64
+ stepCtx.logger.info(`Build number: ${buildNumber}`);
65
+ stepCtx.logger.info(`App version: ${appVersion}`);
66
+ await (0, configure_1.updateVersionsAsync)(stepCtx.logger, stepCtx.workingDirectory, {
67
+ buildNumber,
68
+ appVersion,
69
+ }, {
70
+ targetNames: Object.keys(credentials.targetProvisioningProfiles),
71
+ buildConfiguration: (0, resolve_1.resolveBuildConfiguration)(job, inputs.build_configuration.value),
72
+ });
73
+ },
74
+ });
75
+ }
76
+ exports.configureIosVersionFunction = configureIosVersionFunction;
77
+ //# sourceMappingURL=configureIosVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configureIosVersion.js","sourceRoot":"","sources":["../../../../src/steps/functions/utils/configureIosVersion.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uCAAyF;AAEzF,oDAA4B;AAE5B,yEAAoF;AACpF,kFAAwE;AACxE,yDAAgE;AAChE,qDAAoE;AAEpE,SAAgB,2BAA2B;IACzC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,OAAO;QAClB,EAAE,EAAE,uBAAuB;QAC3B,IAAI,EAAE,uBAAuB;QAC7B,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,aAAa;gBACjB,QAAQ,EAAE,IAAI;gBACd,oBAAoB,EAAE,mCAA2B,CAAC,IAAI;gBACtD,YAAY,EAAE,uCAAuC;aACtD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,qBAAqB;gBACzB,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,cAAc;gBAClB,QAAQ,EAAE,IAAI;gBACd,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,YAAY,EAAE,kCAAkC;aACjD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,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CAAC,gBAAgB,UAAU,EAAE,CAAC,CAAC;YAElD,MAAM,IAAA,+BAAmB,EACvB,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,gBAAgB,EACxB;gBACE,WAAW;gBACX,UAAU;aACX,EACD;gBACE,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC;gBAChE,kBAAkB,EAAE,IAAA,mCAAyB,EAC3C,GAAG,EACH,MAAM,CAAC,mBAAmB,CAAC,KAA2B,CACvD;aACF,CACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA5ED,kEA4EC","sourcesContent":["import assert from 'assert';\n\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { Ios } from '@expo/eas-build-job';\nimport semver from 'semver';\n\nimport { IosBuildCredentialsSchema } from '../../utils/ios/credentials/credentials';\nimport IosCredentialsManager from '../../utils/ios/credentials/manager';\nimport { updateVersionsAsync } from '../../utils/ios/configure';\nimport { resolveBuildConfiguration } from '../../utils/ios/resolve';\n\nexport function configureIosVersionFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'utils',\n id: 'configure_ios_version',\n name: 'Configure iOS version',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'credentials',\n required: true,\n allowedValueTypeName: BuildStepInputValueTypeName.JSON,\n defaultValue: '${ eas.job.secrets.buildCredentials }',\n }),\n BuildStepInput.createProvider({\n id: 'build_configuration',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'build_number',\n required: true,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n defaultValue: '${ eas.job.version.buildNumber }',\n }),\n BuildStepInput.createProvider({\n id: 'app_version',\n required: true,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n defaultValue: '${ eas.job.version.appVersion }',\n }),\n ],\n fn: async (stepCtx, { inputs }) => {\n const rawCredentialsInput = inputs.credentials.value as Record<string, any>;\n const { value, error } = IosBuildCredentialsSchema.validate(rawCredentialsInput, {\n stripUnknown: true,\n convert: true,\n abortEarly: false,\n });\n if (error) {\n throw error;\n }\n\n const credentialsManager = new IosCredentialsManager(value);\n const credentials = await credentialsManager.prepare(stepCtx.logger);\n\n assert(stepCtx.global.staticContext.job, 'Job is not defined');\n const job = stepCtx.global.staticContext.job as Ios.Job;\n\n const buildNumber = inputs.build_number.value as string;\n const appVersion = inputs.app_version.value as string;\n if (!semver.valid(appVersion)) {\n throw new Error(\n `App verrsion provided by the \"app_version\" input is not a valid semver version: ${appVersion}`\n );\n }\n\n stepCtx.logger.info('Setting iOS version...');\n stepCtx.logger.info(`Build number: ${buildNumber}`);\n stepCtx.logger.info(`App version: ${appVersion}`);\n\n await updateVersionsAsync(\n stepCtx.logger,\n stepCtx.workingDirectory,\n {\n buildNumber,\n appVersion,\n },\n {\n targetNames: Object.keys(credentials.targetProvisioningProfiles),\n buildConfiguration: resolveBuildConfiguration(\n job,\n inputs.build_configuration.value as string | undefined\n ),\n }\n );\n },\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { BuildFunction } from '@expo/steps';
2
+ export declare function generateGymfileFromTemplateFunction(): BuildFunction;
@@ -0,0 +1,209 @@
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.generateGymfileFromTemplateFunction = void 0;
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const os_1 = __importDefault(require("os"));
10
+ const fs_extra_1 = __importDefault(require("fs-extra"));
11
+ const steps_1 = require("@expo/steps");
12
+ const config_plugins_1 = require("@expo/config-plugins");
13
+ const plist_1 = __importDefault(require("@expo/plist"));
14
+ const template_file_1 = __importDefault(require("@expo/template-file"));
15
+ const uuid_1 = require("uuid");
16
+ const credentials_1 = require("../../utils/ios/credentials/credentials");
17
+ const manager_1 = __importDefault(require("../../utils/ios/credentials/manager"));
18
+ const resolve_1 = require("../../utils/ios/resolve");
19
+ const tvos_1 = require("../../utils/ios/tvos");
20
+ const DEFAULT_CREDENTIALS_TEMPLATE = `
21
+ suppress_xcode_output(true)
22
+ clean(<%- CLEAN %>)
23
+
24
+ scheme("<%- SCHEME %>")
25
+ <% if (BUILD_CONFIGURATION) { %>
26
+ configuration("<%- BUILD_CONFIGURATION %>")
27
+ <% } %>
28
+
29
+ export_options({
30
+ method: "<%- EXPORT_METHOD %>",
31
+ provisioningProfiles: {<% _.forEach(PROFILES, function(profile) { %>
32
+ "<%- profile.BUNDLE_ID %>" => "<%- profile.UUID %>",<% }); %>
33
+ }<% if (ICLOUD_CONTAINER_ENVIRONMENT) { %>,
34
+ iCloudContainerEnvironment: "<%- ICLOUD_CONTAINER_ENVIRONMENT %>"
35
+ <% } %>
36
+ })
37
+
38
+ export_xcargs "OTHER_CODE_SIGN_FLAGS=\\"--keychain <%- KEYCHAIN_PATH %>\\""
39
+
40
+ disable_xcpretty(true)
41
+ buildlog_path("<%- LOGS_DIRECTORY %>")
42
+
43
+ output_directory("<%- OUTPUT_DIRECTORY %>")
44
+ `;
45
+ const DEFAULT_SIMULATOR_TEMPLATE = `
46
+ suppress_xcode_output(true)
47
+ clean(<%- CLEAN %>)
48
+
49
+ scheme("<%- SCHEME %>")
50
+ <% if (BUILD_CONFIGURATION) { %>
51
+ configuration("<%- BUILD_CONFIGURATION %>")
52
+ <% } %>
53
+
54
+ derived_data_path("<%- DERIVED_DATA_PATH %>")
55
+ skip_package_ipa(true)
56
+ skip_archive(true)
57
+ destination("<%- SCHEME_SIMULATOR_DESTINATION %>")
58
+
59
+ disable_xcpretty(true)
60
+ buildlog_path("<%- LOGS_DIRECTORY %>")
61
+ `;
62
+ function generateGymfileFromTemplateFunction() {
63
+ return new steps_1.BuildFunction({
64
+ namespace: 'utils',
65
+ id: 'generate_gymfile_from_template',
66
+ name: 'Generate Gymfile from template',
67
+ inputProviders: [
68
+ steps_1.BuildStepInput.createProvider({
69
+ id: 'template',
70
+ required: false,
71
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
72
+ }),
73
+ steps_1.BuildStepInput.createProvider({
74
+ id: 'credentials',
75
+ required: false,
76
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.JSON,
77
+ }),
78
+ steps_1.BuildStepInput.createProvider({
79
+ id: 'build_configuration',
80
+ required: false,
81
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
82
+ }),
83
+ steps_1.BuildStepInput.createProvider({
84
+ id: 'scheme',
85
+ required: false,
86
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
87
+ }),
88
+ steps_1.BuildStepInput.createProvider({
89
+ id: 'clean',
90
+ required: true,
91
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
92
+ defaultValue: false,
93
+ }),
94
+ steps_1.BuildStepInput.createProvider({
95
+ id: 'extra',
96
+ required: false,
97
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.JSON,
98
+ }),
99
+ ],
100
+ fn: async (stepCtx, { inputs }) => {
101
+ var _a;
102
+ let credentials = undefined;
103
+ const rawCredentialsInput = inputs.credentials.value;
104
+ if (rawCredentialsInput) {
105
+ const { value, error } = credentials_1.IosBuildCredentialsSchema.validate(rawCredentialsInput, {
106
+ stripUnknown: true,
107
+ convert: true,
108
+ abortEarly: false,
109
+ });
110
+ if (error) {
111
+ throw error;
112
+ }
113
+ const credentialsManager = new manager_1.default(value);
114
+ credentials = await credentialsManager.prepare(stepCtx.logger);
115
+ }
116
+ const extra = (_a = inputs.extra.value) !== null && _a !== void 0 ? _a : {};
117
+ const templateInput = inputs.template.value;
118
+ let template;
119
+ if (templateInput) {
120
+ template = templateInput;
121
+ }
122
+ else if (credentials) {
123
+ template = DEFAULT_CREDENTIALS_TEMPLATE;
124
+ }
125
+ else {
126
+ template = DEFAULT_SIMULATOR_TEMPLATE;
127
+ }
128
+ (0, assert_1.default)(stepCtx.global.staticContext.job, 'Job is not defined');
129
+ const job = stepCtx.global.staticContext.job;
130
+ const buildConfiguration = (0, resolve_1.resolveBuildConfiguration)(job, inputs.build_configuration.value);
131
+ const scheme = (0, resolve_1.resolveScheme)(stepCtx.workingDirectory, job, inputs.scheme.value);
132
+ const entitlements = await maybeReadEntitlementsAsync(stepCtx.logger, stepCtx.workingDirectory, scheme, buildConfiguration);
133
+ const templatePath = await saveTemplateToTemporaryFileAsync(template);
134
+ const gymfilePath = path_1.default.join(stepCtx.workingDirectory, 'ios/Gymfile');
135
+ const PROFILES = [];
136
+ if (credentials) {
137
+ const targets = Object.keys(credentials.targetProvisioningProfiles);
138
+ for (const target of targets) {
139
+ const profile = credentials.targetProvisioningProfiles[target];
140
+ PROFILES.push({
141
+ BUNDLE_ID: profile.bundleIdentifier,
142
+ UUID: profile.uuid,
143
+ });
144
+ }
145
+ }
146
+ const ICLOUD_CONTAINER_ENVIRONMENT = entitlements === null || entitlements === void 0 ? void 0 : entitlements['com.apple.developer.icloud-container-environment'];
147
+ const isTV = await (0, tvos_1.isTVOS)({
148
+ scheme,
149
+ buildConfiguration,
150
+ workingDir: stepCtx.workingDirectory,
151
+ });
152
+ const simulatorDestination = `generic/platform=${isTV ? 'tvOS' : 'iOS'} Simulator`;
153
+ await createGymfile({
154
+ template: templatePath,
155
+ outputFile: gymfilePath,
156
+ vars: {
157
+ SCHEME: scheme,
158
+ BUILD_CONFIGURATION: buildConfiguration,
159
+ OUTPUT_DIRECTORY: './build',
160
+ CLEAN: String(inputs.clean.value),
161
+ LOGS_DIRECTORY: stepCtx.global.buildLogsDirectory,
162
+ ICLOUD_CONTAINER_ENVIRONMENT,
163
+ SCHEME_SIMULATOR_DESTINATION: simulatorDestination,
164
+ DERIVED_DATA_PATH: './build',
165
+ ...(PROFILES ? { PROFILES } : {}),
166
+ ...(credentials
167
+ ? {
168
+ KEYCHAIN_PATH: credentials.keychainPath,
169
+ EXPORT_METHOD: credentials.distributionType,
170
+ }
171
+ : {}),
172
+ ...extra,
173
+ },
174
+ });
175
+ const gymfileContents = await fs_extra_1.default.readFile(gymfilePath, 'utf8');
176
+ stepCtx.logger.info(`Successfully generated Gymfile: ${gymfileContents}`);
177
+ },
178
+ });
179
+ }
180
+ exports.generateGymfileFromTemplateFunction = generateGymfileFromTemplateFunction;
181
+ async function maybeReadEntitlementsAsync(logger, workingDir, scheme, buildConfiguration) {
182
+ try {
183
+ const applicationTargetName = await config_plugins_1.IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(workingDir, scheme);
184
+ const entitlementsPath = config_plugins_1.IOSConfig.Entitlements.getEntitlementsPath(workingDir, {
185
+ buildConfiguration,
186
+ targetName: applicationTargetName,
187
+ });
188
+ if (!entitlementsPath) {
189
+ return null;
190
+ }
191
+ const entitlementsRaw = await fs_extra_1.default.readFile(entitlementsPath, 'utf8');
192
+ return plist_1.default.parse(entitlementsRaw);
193
+ }
194
+ catch (err) {
195
+ logger.warn({ err }, 'Failed to read entitlements');
196
+ return null;
197
+ }
198
+ }
199
+ async function createGymfile({ template, outputFile, vars, }) {
200
+ await (0, template_file_1.default)(template, vars, outputFile, { mustache: false });
201
+ }
202
+ async function saveTemplateToTemporaryFileAsync(template) {
203
+ const directory = path_1.default.join(os_1.default.tmpdir(), `gymfile-template-${(0, uuid_1.v4)()}`);
204
+ await fs_extra_1.default.mkdir(directory, { recursive: true });
205
+ const templatePath = path_1.default.join(directory, 'Gymfile.template');
206
+ await fs_extra_1.default.writeFile(templatePath, template);
207
+ return templatePath;
208
+ }
209
+ //# sourceMappingURL=generateGymfileFromTemplate.js.map