@expo/build-tools 0.1.164 → 0.1.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildErrors/userErrorHandlers.js +17 -0
- package/dist/buildErrors/userErrorHandlers.js.map +1 -1
- package/dist/builders/android.js +3 -3
- package/dist/builders/android.js.map +1 -1
- package/dist/builders/ios.js +41 -4
- package/dist/builders/ios.js.map +1 -1
- package/dist/common/easBuildInternal.d.ts +4 -0
- package/dist/common/easBuildInternal.js +106 -0
- package/dist/common/easBuildInternal.js.map +1 -0
- package/dist/common/installDependencies.d.ts +3 -0
- package/dist/common/installDependencies.js +38 -0
- package/dist/common/installDependencies.js.map +1 -0
- package/dist/{utils → common}/prebuild.d.ts +0 -0
- package/dist/{utils → common}/prebuild.js +3 -2
- package/dist/common/prebuild.js.map +1 -0
- package/dist/common/projectSources.d.ts +4 -0
- package/dist/common/projectSources.js +91 -0
- package/dist/common/projectSources.js.map +1 -0
- package/dist/common/setup.d.ts +3 -0
- package/dist/common/setup.js +97 -0
- package/dist/common/setup.js.map +1 -0
- package/dist/context.d.ts +8 -3
- package/dist/context.js +28 -4
- package/dist/context.js.map +1 -1
- package/dist/ios/credentials/distributionCertificate.d.ts +2 -2
- package/dist/ios/credentials/distributionCertificate.js +8 -1
- package/dist/ios/credentials/distributionCertificate.js.map +1 -1
- package/dist/ios/credentials/manager.d.ts +4 -3
- package/dist/ios/credentials/manager.js +13 -3
- package/dist/ios/credentials/manager.js.map +1 -1
- package/dist/ios/credentials/provisioningProfile.d.ts +6 -1
- package/dist/ios/credentials/provisioningProfile.js +6 -1
- package/dist/ios/credentials/provisioningProfile.js.map +1 -1
- package/dist/ios/fastfile.d.ts +8 -0
- package/dist/ios/fastfile.js +28 -0
- package/dist/ios/fastfile.js.map +1 -0
- package/dist/ios/fastlane.d.ts +4 -0
- package/dist/ios/fastlane.js +19 -1
- package/dist/ios/fastlane.js.map +1 -1
- package/dist/ios/gymfile.js.map +1 -1
- package/dist/ios/resign.d.ts +3 -0
- package/dist/ios/resign.js +33 -0
- package/dist/ios/resign.js.map +1 -0
- package/dist/utils/project.d.ts +0 -2
- package/dist/utils/project.js +2 -133
- package/dist/utils/project.js.map +1 -1
- package/package.json +7 -4
- package/templates/Fastfile.resign.template +8 -0
- package/dist/utils/prebuild.js.map +0 -1
|
@@ -108,6 +108,23 @@ You are seeing this error because either:
|
|
|
108
108
|
`);
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
|
+
{
|
|
112
|
+
phase: eas_build_job_1.BuildPhase.INSTALL_DEPENDENCIES,
|
|
113
|
+
// example log:
|
|
114
|
+
// [stderr] npm ERR! Fix the upstream dependency conflict, or retry
|
|
115
|
+
// [stderr] npm ERR! this command with --force, or --legacy-peer-deps
|
|
116
|
+
// [stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
|
|
117
|
+
regexp: /Fix the upstream dependency conflict, or retry.*\s.*this command with --force, or --legacy-peer-deps/,
|
|
118
|
+
createError: (matchResult) => {
|
|
119
|
+
if (matchResult.length >= 2) {
|
|
120
|
+
return new UserFacingError('EAS_BUILD_NPM_CONFLICTING_PEER_DEPENDENCIES', `Some of your peer dependencies are not compatible. The recommended approach is to fix your dependencies by resolving any conflicts listed by "npm install". As a temporary workaround you can:
|
|
121
|
+
- Add ".npmrc" file with "legacy-peer-deps=true" and commit that to your repo.
|
|
122
|
+
- Delete package-lock.json and use yarn instead. It does not enforce peer dependencies.
|
|
123
|
+
- Downgrade to older version of npm on EAS Build, by adding "npm install -g npm@version" in "eas-build-pre-install" script in package.json.`);
|
|
124
|
+
}
|
|
125
|
+
return undefined;
|
|
126
|
+
},
|
|
127
|
+
},
|
|
111
128
|
{
|
|
112
129
|
phase: eas_build_job_1.BuildPhase.INSTALL_DEPENDENCIES,
|
|
113
130
|
// example log:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userErrorHandlers.js","sourceRoot":"","sources":["../../src/buildErrors/userErrorH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G,EAAE,EAAE,EAAE,CAC1B,GAAG,CAAC,IAAI,KAAK,wBAAQ,CAAC,OAAO;YAC3B,CAAC,CAAC,IAAI,eAAe,CACjB,0CAA0C,EAC1C;gIACoH,EACpH,uFAAuF,CACxF;YACH,CAAC,CAAC,IAAI,eAAe,CACjB,0CAA0C,EAC1C;yMAC6L,EAC7L,uFAAuF,CACxF;KACR;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,OAAO;QAC1B,KAAK,EAAE,0BAAU,CAAC,WAAW;QAC7B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,oBAAoB,EACrC,oGAAoG,CACrG;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,sBAAsB,EACvC;kLAC0K,CAC3K;KACJ;CACF,CAAC","sourcesContent":["import { BuildPhase, errors, Platform, Workflow } from '@expo/eas-build-job';\n\nimport { ErrorHandler, XCODE_BUILD_PHASE } from './errors.types';\n\nimport UserFacingError = errors.UserFacingError;\n\nexport const userErrorHandlers: ErrorHandler<UserFacingError>[] = [\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n regexp: /requires CocoaPods version/,\n // example log:\n // [!] `React` requires CocoaPods version `>= 1.10.1`, which is not satisfied by your current version, `1.10.0`.\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_COCOAPODS_VERSION_ERROR',\n `Your project requires a newer version of CocoaPods. You can update it in the build profile in eas.json by either:\n- changing the current version under key \"cocoapods\"\n- switching to an image that supports that version under key \"image\"`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /Could not find 'bundler' (.*) required by your/,\n // example log:\n // /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.2.3) required by your /Users/expo/project/build/ios/Gemfile.lock. (Gem::MissingSpecVersionError)\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_BUNDLER_VERSION_ERROR',\n `Your project requires a different version of the Ruby \"bundler\" program than the version installed in this EAS Build environment. You can specify which version of \"bundler\" to install by specifying the version under \"build\"→[buildProfileName]→\"ios\"→\"bundler\" in eas.json.`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-5787e6af-3002-4cb7-8a57-3e73d13313c2.jks\": Invalid keystore format\n regexp: /Invalid keystore format/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_FORMAT_ERROR',\n 'The keystore used in this build is malformed or it has an unsupported type. Make sure you provided the correct file.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-286069a8-4bb9-48a6-add9-acf6b58ea06d.jks\": null\n regexp: /Failed to read key[^\\n]+from store/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_ALIAS_ERROR',\n 'The alias specified for this keystore does not exist. Make sure you specified the correct value.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [15:42:05] Error: Cannot copy google-services.json from /build/workingdir/build/managed/abc to /build/workingdir/build/managed/android/app/google-services.json\n // or\n // [11:17:29] [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n // [11:17:29] Error: [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n regexp: /Cannot copy google-services\\.json/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // Execution failed for task ':app:processReleaseGoogleServices'.\n // > File google-services.json is missing. The Google Services Plugin cannot function without it.\n // Searched Location:\n regexp: /File google-services\\.json is missing\\. The Google Services Plugin cannot function without it/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [08:44:18] ENOENT: no such file or directory, copyfile '/Users/expo/workingdir/build/managed/abc' -> '/Users/expo/workingdir/build/managed/ios/testapp/GoogleService-Info.plist'\n regexp: /ENOENT: no such file or directory, copyfile .*GoogleService-Info.plist/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_PLIST_ERROR',\n '\"GoogleService-Info.plist\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"react-native-google-maps\"\n // In Podfile:\n // react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)\n // Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.\n // Error: Compatible versions of some pods could not be resolved.\n regexp: /Specs satisfying the `(.*)` dependency were found, but they required a higher minimum deployment target/,\n createError: (_, { job }) => {\n return new UserFacingError(\n 'EAS_BUILD_HIGHER_MINIMUM_DEPLOYMENT_TARGET_ERROR',\n `Some pods require a higher minimum deployment target.\n${\n job.type === Workflow.MANAGED\n ? 'You can use the expo-build-properties config plugin (https://docs.expo.dev/versions/latest/sdk/build-properties/) to override the default native build properties and set a different minimum deployment target.'\n : 'You need to manually update the minimum deployment target in your project to resolve this issue.'\n}\n`\n );\n },\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"Firebase/Core\":\n // In snapshot (Podfile.lock):\n // Firebase/Core (= 6.14.0)\n // In Podfile:\n // EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 3.0.0, which depends on\n // Firebase/Core (= 7.7.0)\n // You have either:\n // * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.\n // * changed the constraints of dependency `Firebase/Core` inside your development pod `EXFirebaseCore`.\n // You should run `pod update Firebase/Core` to apply changes you've made.\n regexp: /CocoaPods could not find compatible versions for pod /,\n createError: () => {\n return new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Versions in the cached Podfile.lock do not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with \"--clear-cache\" option, or select \"Clear cache and retry build\" on the build page.\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] error https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz: Integrity check failed for \"react-native\" (computed integrity doesn't match our records, got \"sha512-3jHI2YufrJi7eIABRf/DN/I2yOkmIZ0vAyezTz+PAUJiEs4v//5LLojWEU+W53AZsnuaEMcl/4fVy4bd+OuUbA== sha1-o9QuQTXIkc8VozXPaZIullB9a40=\")\n regexp: /Integrity check failed for \"(.*)\" \\(computed integrity doesn't match our records, got/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_LOCK_CHECKSUM_ERROR',\n `Checksum for package \"${matchResult[1]}\" does not match value in registry. To fix that:\n- run \"yarn cache clean\"\n- remove yarn.lock (or only the section for that package)\n- run \"yarn install --force\"`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // yarn install v1.22.17\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [stderr] error https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: \"ENOENT: no such file or directory, chmod '/Users/expo/Library/Caches/Yarn/v6/npm-jest-util-26.6.2-907535dbe4d5a6cb4c47ac9b926f6af29576cbc1-integrity/node_modules/jest-util/build/pluralize.d.ts'\"\n regexp: /\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages...\\s*\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages.../,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_MULTIPLE_INSTANCES_ERROR',\n `One of project dependencies is starting new install process while the main one is still in progress, which might result in corrupted packages. Most likely the reason for error is \"prepare\" script in git-referenced dependency of your project. Learn more: https://github.com/yarnpkg/yarn/issues/7212#issuecomment-493720324`\n );\n }\n return undefined;\n },\n },\n {\n platform: Platform.IOS,\n phase: XCODE_BUILD_PHASE,\n // Prepare packages\n // Computing target dependency graph and provisioning inputs\n // Create build description\n // Build description signature: 33a5c28977280822abe5e7bd7fe02529\n // Build description path: /Users/expo/Library/Developer/Xcode/DerivedData/testapp-fazozgerxcvvfifkipojsjftgyih/Build/Intermediates.noindex/ArchiveIntermediates/testapp/IntermediateBuildFilesPath/XCBuildData/33a5c28977280822abe5e7bd7fe02529-desc.xcbuild\n // note: Building targets in dependency order\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXConstants-EXConstants\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXConstants-EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"React-Core-AccessibilityResources\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'React-Core-AccessibilityResources' from project 'Pods')\n // warning: Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXUpdates' from project 'Pods')\n // warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXUpdates-EXUpdates\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXUpdates-EXUpdates' from project 'Pods')\n regexp: /error: Signing for \"[a-zA-Z-0-9_]+\" requires a development team/,\n createError: (_, { job }) =>\n job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or upgrade to SDK 46 or higher.`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n )\n : new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or turn off signing resource bundles in your Podfile: https://expo.fyi/r/disable-bundle-resource-signing`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n 'Gradle build failed with unknown error. See logs for the \"Run gradlew\" phase for more information.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n `Fastlane build failed with unknown error. See logs for the \"Run fastlane\" and \"Xcode Logs\" phases for more information.\nFastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.`\n ),\n },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"userErrorHandlers.js","sourceRoot":"","sources":["../../src/buildErrors/userErrorHandlers.ts"],"names":[],"mappings":";;;AAAA,uDAA6E;AAE7E,iDAAiE;AAEjE,IAAO,eAAe,GAAG,sBAAM,CAAC,eAAe,CAAC;AAEnC,QAAA,iBAAiB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6PAA6P;QAC7P,6CAA6C;QAC7C,oQAAoQ;QACpQ,wRAAwR;QACxR,8XAA8X;QAC9X,6VAA6V;QAC7V,kXAAkX;QAClX,6YAA6Y;QAC7Y,4PAA4P;QAC5P,MAAM,EAAE,iEAAiE;QACzE,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAC1B,GAAG,CAAC,IAAI,KAAK,wBAAQ,CAAC,OAAO;YAC3B,CAAC,CAAC,IAAI,eAAe,CACjB,0CAA0C,EAC1C;gIACoH,EACpH,uFAAuF,CACxF;YACH,CAAC,CAAC,IAAI,eAAe,CACjB,0CAA0C,EAC1C;yMAC6L,EAC7L,uFAAuF,CACxF;KACR;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,OAAO;QAC1B,KAAK,EAAE,0BAAU,CAAC,WAAW;QAC7B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,oBAAoB,EACrC,oGAAoG,CACrG;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,sBAAsB,EACvC;kLAC0K,CAC3K;KACJ;CACF,CAAC","sourcesContent":["import { BuildPhase, errors, Platform, Workflow } from '@expo/eas-build-job';\n\nimport { ErrorHandler, XCODE_BUILD_PHASE } from './errors.types';\n\nimport UserFacingError = errors.UserFacingError;\n\nexport const userErrorHandlers: ErrorHandler<UserFacingError>[] = [\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n regexp: /requires CocoaPods version/,\n // example log:\n // [!] `React` requires CocoaPods version `>= 1.10.1`, which is not satisfied by your current version, `1.10.0`.\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_COCOAPODS_VERSION_ERROR',\n `Your project requires a newer version of CocoaPods. You can update it in the build profile in eas.json by either:\n- changing the current version under key \"cocoapods\"\n- switching to an image that supports that version under key \"image\"`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /Could not find 'bundler' (.*) required by your/,\n // example log:\n // /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.2.3) required by your /Users/expo/project/build/ios/Gemfile.lock. (Gem::MissingSpecVersionError)\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_BUNDLER_VERSION_ERROR',\n `Your project requires a different version of the Ruby \"bundler\" program than the version installed in this EAS Build environment. You can specify which version of \"bundler\" to install by specifying the version under \"build\"→[buildProfileName]→\"ios\"→\"bundler\" in eas.json.`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-5787e6af-3002-4cb7-8a57-3e73d13313c2.jks\": Invalid keystore format\n regexp: /Invalid keystore format/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_FORMAT_ERROR',\n 'The keystore used in this build is malformed or it has an unsupported type. Make sure you provided the correct file.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-286069a8-4bb9-48a6-add9-acf6b58ea06d.jks\": null\n regexp: /Failed to read key[^\\n]+from store/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_ALIAS_ERROR',\n 'The alias specified for this keystore does not exist. Make sure you specified the correct value.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [15:42:05] Error: Cannot copy google-services.json from /build/workingdir/build/managed/abc to /build/workingdir/build/managed/android/app/google-services.json\n // or\n // [11:17:29] [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n // [11:17:29] Error: [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n regexp: /Cannot copy google-services\\.json/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // Execution failed for task ':app:processReleaseGoogleServices'.\n // > File google-services.json is missing. The Google Services Plugin cannot function without it.\n // Searched Location:\n regexp: /File google-services\\.json is missing\\. The Google Services Plugin cannot function without it/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [08:44:18] ENOENT: no such file or directory, copyfile '/Users/expo/workingdir/build/managed/abc' -> '/Users/expo/workingdir/build/managed/ios/testapp/GoogleService-Info.plist'\n regexp: /ENOENT: no such file or directory, copyfile .*GoogleService-Info.plist/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_PLIST_ERROR',\n '\"GoogleService-Info.plist\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"react-native-google-maps\"\n // In Podfile:\n // react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)\n // Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.\n // Error: Compatible versions of some pods could not be resolved.\n regexp: /Specs satisfying the `(.*)` dependency were found, but they required a higher minimum deployment target/,\n createError: (_, { job }) => {\n return new UserFacingError(\n 'EAS_BUILD_HIGHER_MINIMUM_DEPLOYMENT_TARGET_ERROR',\n `Some pods require a higher minimum deployment target.\n${\n job.type === Workflow.MANAGED\n ? 'You can use the expo-build-properties config plugin (https://docs.expo.dev/versions/latest/sdk/build-properties/) to override the default native build properties and set a different minimum deployment target.'\n : 'You need to manually update the minimum deployment target in your project to resolve this issue.'\n}\n`\n );\n },\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"Firebase/Core\":\n // In snapshot (Podfile.lock):\n // Firebase/Core (= 6.14.0)\n // In Podfile:\n // EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 3.0.0, which depends on\n // Firebase/Core (= 7.7.0)\n // You have either:\n // * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.\n // * changed the constraints of dependency `Firebase/Core` inside your development pod `EXFirebaseCore`.\n // You should run `pod update Firebase/Core` to apply changes you've made.\n regexp: /CocoaPods could not find compatible versions for pod /,\n createError: () => {\n return new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Versions in the cached Podfile.lock do not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with \"--clear-cache\" option, or select \"Clear cache and retry build\" on the build page.\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] npm ERR! Fix the upstream dependency conflict, or retry\n // [stderr] npm ERR! this command with --force, or --legacy-peer-deps\n // [stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.\n regexp: /Fix the upstream dependency conflict, or retry.*\\s.*this command with --force, or --legacy-peer-deps/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_NPM_CONFLICTING_PEER_DEPENDENCIES',\n `Some of your peer dependencies are not compatible. The recommended approach is to fix your dependencies by resolving any conflicts listed by \"npm install\". As a temporary workaround you can:\n- Add \".npmrc\" file with \"legacy-peer-deps=true\" and commit that to your repo.\n- Delete package-lock.json and use yarn instead. It does not enforce peer dependencies.\n- Downgrade to older version of npm on EAS Build, by adding \"npm install -g npm@version\" in \"eas-build-pre-install\" script in package.json.`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] error https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz: Integrity check failed for \"react-native\" (computed integrity doesn't match our records, got \"sha512-3jHI2YufrJi7eIABRf/DN/I2yOkmIZ0vAyezTz+PAUJiEs4v//5LLojWEU+W53AZsnuaEMcl/4fVy4bd+OuUbA== sha1-o9QuQTXIkc8VozXPaZIullB9a40=\")\n regexp: /Integrity check failed for \"(.*)\" \\(computed integrity doesn't match our records, got/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_LOCK_CHECKSUM_ERROR',\n `Checksum for package \"${matchResult[1]}\" does not match value in registry. To fix that:\n- run \"yarn cache clean\"\n- remove yarn.lock (or only the section for that package)\n- run \"yarn install --force\"`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // yarn install v1.22.17\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [stderr] error https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: \"ENOENT: no such file or directory, chmod '/Users/expo/Library/Caches/Yarn/v6/npm-jest-util-26.6.2-907535dbe4d5a6cb4c47ac9b926f6af29576cbc1-integrity/node_modules/jest-util/build/pluralize.d.ts'\"\n regexp: /\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages...\\s*\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages.../,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_MULTIPLE_INSTANCES_ERROR',\n `One of project dependencies is starting new install process while the main one is still in progress, which might result in corrupted packages. Most likely the reason for error is \"prepare\" script in git-referenced dependency of your project. Learn more: https://github.com/yarnpkg/yarn/issues/7212#issuecomment-493720324`\n );\n }\n return undefined;\n },\n },\n {\n platform: Platform.IOS,\n phase: XCODE_BUILD_PHASE,\n // Prepare packages\n // Computing target dependency graph and provisioning inputs\n // Create build description\n // Build description signature: 33a5c28977280822abe5e7bd7fe02529\n // Build description path: /Users/expo/Library/Developer/Xcode/DerivedData/testapp-fazozgerxcvvfifkipojsjftgyih/Build/Intermediates.noindex/ArchiveIntermediates/testapp/IntermediateBuildFilesPath/XCBuildData/33a5c28977280822abe5e7bd7fe02529-desc.xcbuild\n // note: Building targets in dependency order\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXConstants-EXConstants\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXConstants-EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"React-Core-AccessibilityResources\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'React-Core-AccessibilityResources' from project 'Pods')\n // warning: Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXUpdates' from project 'Pods')\n // warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXUpdates-EXUpdates\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXUpdates-EXUpdates' from project 'Pods')\n regexp: /error: Signing for \"[a-zA-Z-0-9_]+\" requires a development team/,\n createError: (_, { job }) =>\n job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or upgrade to SDK 46 or higher.`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n )\n : new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or turn off signing resource bundles in your Podfile: https://expo.fyi/r/disable-bundle-resource-signing`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n 'Gradle build failed with unknown error. See logs for the \"Run gradlew\" phase for more information.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n `Fastlane build failed with unknown error. See logs for the \"Run fastlane\" and \"Xcode Logs\" phases for more information.\nFastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.`\n ),\n },\n];\n"]}
|
package/dist/builders/android.js
CHANGED
|
@@ -4,19 +4,19 @@ const eas_build_job_1 = require("@expo/eas-build-job");
|
|
|
4
4
|
const context_1 = require("../context");
|
|
5
5
|
const expoUpdates_1 = require("../utils/expoUpdates");
|
|
6
6
|
const gradle_1 = require("../android/gradle");
|
|
7
|
-
const project_1 = require("../utils/project");
|
|
8
7
|
const artifacts_1 = require("../utils/artifacts");
|
|
9
8
|
const hooks_1 = require("../utils/hooks");
|
|
10
9
|
const credentials_1 = require("../android/credentials");
|
|
11
10
|
const gradleConfig_1 = require("../android/gradleConfig");
|
|
12
|
-
const
|
|
11
|
+
const setup_1 = require("../common/setup");
|
|
12
|
+
const prebuild_1 = require("../common/prebuild");
|
|
13
13
|
const common_1 = require("./common");
|
|
14
14
|
async function androidBuilder(ctx) {
|
|
15
15
|
return await (0, common_1.runBuilderWithHooksAsync)(ctx, buildAsync);
|
|
16
16
|
}
|
|
17
17
|
exports.default = androidBuilder;
|
|
18
18
|
async function buildAsync(ctx) {
|
|
19
|
-
await (0,
|
|
19
|
+
await (0, setup_1.setupAsync)(ctx);
|
|
20
20
|
const hasNativeCode = ctx.job.type === eas_build_job_1.Workflow.GENERIC;
|
|
21
21
|
if (hasNativeCode) {
|
|
22
22
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.FIX_GRADLEW, async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;AAAA,uDAAoE;AAEpE,wCAAyF;AACzF,sDAA4E;AAC5E,8CAAyF;AACzF,
|
|
1
|
+
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;AAAA,uDAAoE;AAEpE,wCAAyF;AACzF,sDAA4E;AAC5E,8CAAyF;AACzF,kDAAmD;AACnD,0CAAwD;AACxD,wDAA4D;AAC5D,0DAA+D;AAC/D,2CAA6C;AAC7C,iDAAmD;AAEnD,qCAAoD;AAErC,KAAK,UAAU,cAAc,CAAC,GAA8B;IACzE,OAAO,MAAM,IAAA,iCAAwB,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAFD,iCAEC;AAED,KAAK,UAAU,UAAU,CAAC,GAA8B;IACtD,MAAM,IAAA,kBAAU,EAAC,GAAG,CAAC,CAAC;IACtB,MAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,wBAAQ,CAAC,OAAO,CAAC;IAExD,IAAI,aAAa,EAAE;QACjB,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;YACzD,MAAM,IAAA,2CAAkC,EAAC,GAAG,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QACtD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,qBAAqB,EAAE,CAAC;YAC5B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,CAAC,SAAS,CAAC,GAAG,EAAE;QAClD,OAAO,sBAAsB,CAAC;KAC/B;SAAM;QACL,OAAO,oBAAoB,CAAC;KAC7B;AACH,CAAC","sourcesContent":["import { Android, BuildPhase, Workflow } from '@expo/eas-build-job';\n\nimport { Artifacts, ArtifactType, BuildContext, SkipNativeBuildError } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { runGradleCommand, ensureLFLineEndingsInGradlewScript } from '../android/gradle';\nimport { findArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { restoreCredentials } from '../android/credentials';\nimport { configureBuildGradle } from '../android/gradleConfig';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\n\nexport default async function androidBuilder(ctx: BuildContext<Android.Job>): Promise<Artifacts> {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n}\n\nasync function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n if (hasNativeCode) {\n await ctx.runBuildPhase(BuildPhase.FIX_GRADLEW, async () => {\n await ensureLFLineEndingsInGradlewScript(ctx);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"android\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/android-builds/'\n );\n return;\n }\n await prebuildAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n if (ctx.job.secrets.buildCredentials) {\n await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n await restoreCredentials(ctx);\n await configureBuildGradle(ctx);\n });\n }\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n if (ctx.skipNativeBuild) {\n throw new SkipNativeBuildError('Skipping Gradle build');\n }\n await ctx.runBuildPhase(BuildPhase.RUN_GRADLEW, async () => {\n const gradleCommand = resolveGradleCommand(ctx.job);\n await runGradleCommand(ctx, gradleCommand);\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n const applicationArchives = await findArtifacts(\n ctx.reactNativeProjectDirectory,\n ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}',\n ctx.logger\n );\n ctx.logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);\n });\n}\n\nfunction resolveGradleCommand(job: Android.Job): string {\n if (job.gradleCommand) {\n return job.gradleCommand;\n } else if (job.developmentClient) {\n return ':app:assembleDebug';\n } else if (!job.buildType) {\n return ':app:bundleRelease';\n } else if (job.buildType === Android.BuildType.APK) {\n return ':app:assembleRelease';\n } else {\n return ':app:bundleRelease';\n }\n}\n"]}
|
package/dist/builders/ios.js
CHANGED
|
@@ -7,24 +7,31 @@ const plist_1 = __importDefault(require("@expo/plist"));
|
|
|
7
7
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
8
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
9
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
10
11
|
const context_1 = require("../context");
|
|
11
12
|
const expoUpdates_1 = require("../utils/expoUpdates");
|
|
12
|
-
const project_1 = require("../utils/project");
|
|
13
13
|
const artifacts_1 = require("../utils/artifacts");
|
|
14
14
|
const hooks_1 = require("../utils/hooks");
|
|
15
15
|
const configure_1 = require("../ios/configure");
|
|
16
16
|
const manager_1 = __importDefault(require("../ios/credentials/manager"));
|
|
17
17
|
const fastlane_1 = require("../ios/fastlane");
|
|
18
18
|
const pod_1 = require("../ios/pod");
|
|
19
|
-
const
|
|
19
|
+
const resign_1 = require("../ios/resign");
|
|
20
20
|
const resolve_1 = require("../ios/resolve");
|
|
21
|
+
const setup_1 = require("../common/setup");
|
|
22
|
+
const prebuild_1 = require("../common/prebuild");
|
|
21
23
|
const common_1 = require("./common");
|
|
22
24
|
async function iosBuilder(ctx) {
|
|
23
|
-
|
|
25
|
+
if (ctx.job.mode === eas_build_job_1.BuildMode.BUILD) {
|
|
26
|
+
return await (0, common_1.runBuilderWithHooksAsync)(ctx, buildAsync);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return await resignAsync(ctx);
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
exports.default = iosBuilder;
|
|
26
33
|
async function buildAsync(ctx) {
|
|
27
|
-
await (0,
|
|
34
|
+
await (0, setup_1.setupAsync)(ctx);
|
|
28
35
|
const hasNativeCode = ctx.job.type === eas_build_job_1.Workflow.GENERIC;
|
|
29
36
|
const credentialsManager = new manager_1.default(ctx);
|
|
30
37
|
try {
|
|
@@ -109,4 +116,34 @@ async function readEntitlementsAsync(ctx, { scheme, buildConfiguration }) {
|
|
|
109
116
|
return null;
|
|
110
117
|
}
|
|
111
118
|
}
|
|
119
|
+
async function resignAsync(ctx) {
|
|
120
|
+
const applicationArchivePath = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE, async () => {
|
|
121
|
+
return await (0, resign_1.downloadApplicationArchiveAsync)(ctx);
|
|
122
|
+
});
|
|
123
|
+
const credentialsManager = new manager_1.default(ctx);
|
|
124
|
+
try {
|
|
125
|
+
const credentials = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PREPARE_CREDENTIALS, async () => {
|
|
126
|
+
return await credentialsManager.prepare();
|
|
127
|
+
});
|
|
128
|
+
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RUN_FASTLANE, async () => {
|
|
129
|
+
await (0, fastlane_1.runFastlaneResign)(ctx, {
|
|
130
|
+
credentials: (0, nullthrows_1.default)(credentials),
|
|
131
|
+
ipaPath: applicationArchivePath,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.CLEAN_UP_CREDENTIALS, async () => {
|
|
137
|
+
await credentialsManager.cleanUp();
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {
|
|
141
|
+
ctx.logger.info(`Application archive: ${applicationArchivePath}`);
|
|
142
|
+
await ctx.uploadArtifacts(context_1.ArtifactType.APPLICATION_ARCHIVE, [applicationArchivePath], ctx.logger);
|
|
143
|
+
});
|
|
144
|
+
if (!ctx.artifacts.APPLICATION_ARCHIVE) {
|
|
145
|
+
throw new Error('Builder must upload application archive');
|
|
146
|
+
}
|
|
147
|
+
return ctx.artifacts;
|
|
148
|
+
}
|
|
112
149
|
//# sourceMappingURL=ios.js.map
|
package/dist/builders/ios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/builders/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yDAAiD;AACjD,uDAAgE;AAChE,wDAA0B;AAE1B,wCAAmE;AACnE,sDAA4E;AAC5E,8CAAyC;AACzC,kDAAmD;AACnD,0CAAwD;AAC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BAA2B,EAC/B,MAAM,CACP,CAAC;QACF,MAAM,gBAAgB,GAAG,0BAAS,CAAC,YAAY,CAAC,mBAAmB,CACjE,GAAG,CAAC,2BAA2B,EAC/B;YACE,kBAAkB;YAClB,UAAU,EAAE,qBAAqB;SAClC,CACF,CAAC;QACF,IAAI,CAAC,gBAAgB,EAAE;YACrB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,eAAe,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACpE,OAAO,eAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;KACrC;IAAC,OAAO,GAAG,EAAE;QACZ,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,6BAA6B,CAAC,CAAC;QACxD,GAAG,CAAC,yBAAyB,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\n\nimport { Artifacts, ArtifactType, BuildContext } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { setup } from '../utils/project';\nimport { findArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { prebuildAsync } from '../utils/prebuild';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\n\nimport { runBuilderWithHooksAsync } from './common';\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setup(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, { extraEnvs });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await installPods(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n const applicationArchives = await findArtifacts(\n ctx.reactNativeProjectDirectory,\n resolveArtifactPath(ctx),\n ctx.logger\n );\n ctx.logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName = await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.reactNativeProjectDirectory,\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.reactNativeProjectDirectory,\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/builders/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yDAAiD;AACjD,uDAA2E;AAC3E,wDAA0B;AAC1B,4DAAoC;AAEpC,wCAAmE;AACnE,sDAA4E;AAC5E,kDAAmD;AACnD,0CAAwD;AACxD,gDAAyD;AACzD,yEAA4D;AAC5D,8CAAoE;AACpE,oCAAyC;AACzC,0CAAgE;AAChE,4CAA+F;AAC/F,2CAA6C;AAC7C,iDAAmD;AAEnD,qCAAoD;AAErC,KAAK,UAAU,UAAU,CAAC,GAA0B;IACjE,IAAI,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AAsB;aAChC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;YAAS;QACR,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;YAClE,MAAM,kBAAkB,CAAC,OAAO,EAAE,CAAC;QACrC,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,sBAAsB,EAAE,CAAC,CAAC;QAClE,MAAM,GAAG,CAAC,eAAe,CACvB,sBAAY,CAAC,mBAAmB,EAChC,CAAC,sBAAsB,CAAC,EACxB,GAAG,CAAC,MAAM,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IACD,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC","sourcesContent":["import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { BuildMode, BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, ArtifactType, BuildContext } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { findArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym, runFastlaneResign } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { downloadApplicationArchiveAsync } from '../ios/resign';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else {\n return await resignAsync(ctx);\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, { extraEnvs });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await installPods(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n const applicationArchives = await findArtifacts(\n ctx.reactNativeProjectDirectory,\n resolveArtifactPath(ctx),\n ctx.logger\n );\n ctx.logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName = await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.reactNativeProjectDirectory,\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.reactNativeProjectDirectory,\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n\nasync function resignAsync(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n const applicationArchivePath = await ctx.runBuildPhase(\n BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE,\n async () => {\n return await downloadApplicationArchiveAsync(ctx);\n }\n );\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n await runFastlaneResign(ctx, {\n credentials: nullthrows(credentials),\n ipaPath: applicationArchivePath,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n ctx.logger.info(`Application archive: ${applicationArchivePath}`);\n await ctx.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n [applicationArchivePath],\n ctx.logger\n );\n });\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n return ctx.artifacts;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Job } from '@expo/eas-build-job';
|
|
2
|
+
import { BuildContext } from '../context';
|
|
3
|
+
export declare function runEasBuildInternalAsync<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void>;
|
|
4
|
+
export declare function configureEnvFromBuildProfileAsync<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void>;
|
|
@@ -0,0 +1,106 @@
|
|
|
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.configureEnvFromBuildProfileAsync = exports.runEasBuildInternalAsync = void 0;
|
|
7
|
+
const assert_1 = __importDefault(require("assert"));
|
|
8
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
|
+
const logger_1 = require("@expo/logger");
|
|
10
|
+
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
11
|
+
const joi_1 = __importDefault(require("joi"));
|
|
12
|
+
const EAS_CLI_STAGING_NPM_TAG = 'latest-eas-build-staging';
|
|
13
|
+
const EAS_CLI_PRODUCTION_NPM_TAG = 'latest-eas-build';
|
|
14
|
+
const EasBuildInternalResultSchema = joi_1.default.object({
|
|
15
|
+
job: joi_1.default.object().unknown(),
|
|
16
|
+
metadata: joi_1.default.object().unknown(),
|
|
17
|
+
});
|
|
18
|
+
async function runEasBuildInternalAsync(ctx) {
|
|
19
|
+
const { cmd, args } = resolveEasCommandPrefix();
|
|
20
|
+
const { buildProfile } = ctx.job;
|
|
21
|
+
(0, assert_1.default)(buildProfile, 'build profile is missing in a build from git-based integration.');
|
|
22
|
+
const result = await (0, turtle_spawn_1.default)(cmd, [...args, 'build:internal', '--platform', ctx.job.platform, '--profile', buildProfile], {
|
|
23
|
+
cwd: ctx.reactNativeProjectDirectory,
|
|
24
|
+
env: Object.assign(Object.assign({}, ctx.env), { EXPO_TOKEN: ctx.job.secrets.robotAccessToken }),
|
|
25
|
+
logger: ctx.logger,
|
|
26
|
+
mode: logger_1.PipeMode.STDERR_ONLY_AS_STDOUT,
|
|
27
|
+
});
|
|
28
|
+
const stdout = result.stdout.toString();
|
|
29
|
+
const parsed = JSON.parse(stdout);
|
|
30
|
+
const { job, metadata } = validateEasBuildInternalResult(ctx, parsed);
|
|
31
|
+
ctx.updateJobInformation(job, metadata);
|
|
32
|
+
}
|
|
33
|
+
exports.runEasBuildInternalAsync = runEasBuildInternalAsync;
|
|
34
|
+
async function configureEnvFromBuildProfileAsync(ctx) {
|
|
35
|
+
var _a;
|
|
36
|
+
const { cmd, args } = resolveEasCommandPrefix();
|
|
37
|
+
const { buildProfile } = ctx.job;
|
|
38
|
+
(0, assert_1.default)(buildProfile, 'build profile is missing in a build from git-based integration.');
|
|
39
|
+
let spawnResult;
|
|
40
|
+
try {
|
|
41
|
+
spawnResult = await (0, turtle_spawn_1.default)(cmd, [
|
|
42
|
+
...args,
|
|
43
|
+
'config',
|
|
44
|
+
'--platform',
|
|
45
|
+
ctx.job.platform,
|
|
46
|
+
'--profile',
|
|
47
|
+
buildProfile,
|
|
48
|
+
'--non-interactive',
|
|
49
|
+
'--json',
|
|
50
|
+
'--eas-json-only',
|
|
51
|
+
], {
|
|
52
|
+
cwd: ctx.reactNativeProjectDirectory,
|
|
53
|
+
env: ctx.env,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
ctx.logger.error(`Failed to the read build profile ${buildProfile} from eas.json.`);
|
|
58
|
+
ctx.logger.error((_a = err.stderr) === null || _a === void 0 ? void 0 : _a.toString());
|
|
59
|
+
throw Error(`Failed to read the build profile ${buildProfile} from eas.json.`);
|
|
60
|
+
}
|
|
61
|
+
const stdout = spawnResult.stdout.toString();
|
|
62
|
+
const parsed = JSON.parse(stdout);
|
|
63
|
+
const env = validateEnvs(parsed);
|
|
64
|
+
ctx.updateEnv(env);
|
|
65
|
+
}
|
|
66
|
+
exports.configureEnvFromBuildProfileAsync = configureEnvFromBuildProfileAsync;
|
|
67
|
+
function resolveEasCommandPrefix() {
|
|
68
|
+
var _a;
|
|
69
|
+
if (process.env.ENVIRONMENT === 'development') {
|
|
70
|
+
return { cmd: (_a = process.env.EAS_BUILD_INTERNAL_EXECUTABLE) !== null && _a !== void 0 ? _a : `eas`, args: [] };
|
|
71
|
+
}
|
|
72
|
+
else if (process.env.ENVIRONMENT === 'staging') {
|
|
73
|
+
return { cmd: 'npx', args: ['--yes', `eas-cli@${EAS_CLI_STAGING_NPM_TAG}`] };
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return { cmd: 'npx', args: ['--yes', `eas-cli@${EAS_CLI_PRODUCTION_NPM_TAG}`] };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function validateEasBuildInternalResult(ctx, result) {
|
|
80
|
+
const { value, error } = EasBuildInternalResultSchema.validate(result, {
|
|
81
|
+
stripUnknown: true,
|
|
82
|
+
convert: true,
|
|
83
|
+
abortEarly: false,
|
|
84
|
+
});
|
|
85
|
+
if (error) {
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
const job = (0, eas_build_job_1.sanitizeJob)(value.job);
|
|
89
|
+
(0, assert_1.default)(job.platform === ctx.job.platform, 'eas-cli returned a job for a wrong platform');
|
|
90
|
+
const metadata = (0, eas_build_job_1.sanitizeMetadata)(value.metadata);
|
|
91
|
+
return { job, metadata };
|
|
92
|
+
}
|
|
93
|
+
function validateEnvs(result) {
|
|
94
|
+
const { value, error } = joi_1.default.object({
|
|
95
|
+
env: joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.string()),
|
|
96
|
+
}).validate(result.env, {
|
|
97
|
+
stripUnknown: true,
|
|
98
|
+
convert: true,
|
|
99
|
+
abortEarly: false,
|
|
100
|
+
});
|
|
101
|
+
if (error) {
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
return value === null || value === void 0 ? void 0 : value.env;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=easBuildInternal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easBuildInternal.js","sourceRoot":"","sources":["../../src/common/easBuildInternal.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAwF;AACxF,yCAAwC;AACxC,sEAAuC;AACvC,8CAAsB;AAItB,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAEtD,MAAM,4BAA4B,GAAG,aAAG,CAAC,MAAM,CAAoC;IACjF,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC3B,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;CACjC,CAAC,CAAC;AAEI,KAAK,UAAU,wBAAwB,CAC5C,GAAuB;IAEvB,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,uBAAuB,EAAE,CAA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AAED,SAAS,8BAA8B,CACrC,GAAuB,EACvB,MAAW;IAEX,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,4BAA4B,CAAC,QAAQ,CAAC,MAAM,EAAE;QACrE,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IACH,IAAI,KAAK,EAAE;QACT,MAAM,KAAK,CAAC;KACb;IACD,MAAM,GAAG,GAAG,IAAA,2BAAW,EAAC,KAAK,CAAC,GAAG,CAAS,CAAC;IAC3C,IAAA,gBAAM,EAAC,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,6CAA6C,CAAC,CAAC;IACzF,MAAM,QAAQ,GAAG,IAAA,gCAAgB,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,YAAY,CAAC,MAAW;IAC/B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,aAAG,CAAC,MAAM,CAAC;QAClC,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,aAAG,CAAC,MAAM,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC;KACtD,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE;QACtB,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IACH,IAAI,KAAK,EAAE;QACT,MAAM,KAAK,CAAC;KACb;IACD,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC;AACpB,CAAC","sourcesContent":["import assert from 'assert';\n\nimport { Env, Job, Metadata, sanitizeJob, sanitizeMetadata } from '@expo/eas-build-job';\nimport { PipeMode } from '@expo/logger';\nimport spawn from '@expo/turtle-spawn';\nimport Joi from 'joi';\n\nimport { BuildContext } from '../context';\n\nconst EAS_CLI_STAGING_NPM_TAG = 'latest-eas-build-staging';\nconst EAS_CLI_PRODUCTION_NPM_TAG = 'latest-eas-build';\n\nconst EasBuildInternalResultSchema = Joi.object<{ job: object; metadata: object }>({\n job: Joi.object().unknown(),\n metadata: Joi.object().unknown(),\n});\n\nexport async function runEasBuildInternalAsync<TJob extends Job>(\n ctx: BuildContext<TJob>\n): Promise<void> {\n const { cmd, args } = resolveEasCommandPrefix();\n const { buildProfile } = ctx.job;\n assert(buildProfile, 'build profile is missing in a build from git-based integration.');\n const result = await spawn(\n cmd,\n [...args, 'build:internal', '--platform', ctx.job.platform, '--profile', buildProfile],\n {\n cwd: ctx.reactNativeProjectDirectory,\n env: { ...ctx.env, EXPO_TOKEN: ctx.job.secrets.robotAccessToken },\n logger: ctx.logger,\n mode: PipeMode.STDERR_ONLY_AS_STDOUT,\n }\n );\n const stdout = result.stdout.toString();\n const parsed = JSON.parse(stdout);\n const { job, metadata } = validateEasBuildInternalResult(ctx, parsed);\n ctx.updateJobInformation(job, metadata);\n}\n\nexport async function configureEnvFromBuildProfileAsync<TJob extends Job>(\n ctx: BuildContext<TJob>\n): Promise<void> {\n const { cmd, args } = resolveEasCommandPrefix();\n const { buildProfile } = ctx.job;\n assert(buildProfile, 'build profile is missing in a build from git-based integration.');\n let spawnResult;\n try {\n spawnResult = await spawn(\n cmd,\n [\n ...args,\n 'config',\n '--platform',\n ctx.job.platform,\n '--profile',\n buildProfile,\n '--non-interactive',\n '--json',\n '--eas-json-only',\n ],\n {\n cwd: ctx.reactNativeProjectDirectory,\n env: ctx.env,\n }\n );\n } catch (err: any) {\n ctx.logger.error(`Failed to the read build profile ${buildProfile} from eas.json.`);\n ctx.logger.error(err.stderr?.toString());\n throw Error(`Failed to read the build profile ${buildProfile} from eas.json.`);\n }\n const stdout = spawnResult.stdout.toString();\n const parsed = JSON.parse(stdout);\n const env = validateEnvs(parsed);\n ctx.updateEnv(env);\n}\n\nfunction resolveEasCommandPrefix(): { cmd: string; args: string[] } {\n if (process.env.ENVIRONMENT === 'development') {\n return { cmd: process.env.EAS_BUILD_INTERNAL_EXECUTABLE ?? `eas`, args: [] };\n } else if (process.env.ENVIRONMENT === 'staging') {\n return { cmd: 'npx', args: ['--yes', `eas-cli@${EAS_CLI_STAGING_NPM_TAG}`] };\n } else {\n return { cmd: 'npx', args: ['--yes', `eas-cli@${EAS_CLI_PRODUCTION_NPM_TAG}`] };\n }\n}\n\nfunction validateEasBuildInternalResult<TJob extends Job>(\n ctx: BuildContext<TJob>,\n result: any\n): { job: TJob; metadata: Metadata } {\n const { value, error } = EasBuildInternalResultSchema.validate(result, {\n stripUnknown: true,\n convert: true,\n abortEarly: false,\n });\n if (error) {\n throw error;\n }\n const job = sanitizeJob(value.job) as TJob;\n assert(job.platform === ctx.job.platform, 'eas-cli returned a job for a wrong platform');\n const metadata = sanitizeMetadata(value.metadata);\n return { job, metadata };\n}\n\nfunction validateEnvs(result: any): Env {\n const { value, error } = Joi.object({\n env: Joi.object().pattern(Joi.string(), Joi.string()),\n }).validate(result.env, {\n stripUnknown: true,\n convert: true,\n abortEarly: false,\n });\n if (error) {\n throw error;\n }\n return value?.env;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
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.installDependenciesAsync = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
9
|
+
const packageManager_1 = require("../utils/packageManager");
|
|
10
|
+
const project_1 = require("../utils/project");
|
|
11
|
+
async function installDependenciesAsync(ctx) {
|
|
12
|
+
const packagerRunDir = (0, packageManager_1.findPackagerRootDir)(ctx.reactNativeProjectDirectory);
|
|
13
|
+
if (packagerRunDir !== ctx.reactNativeProjectDirectory) {
|
|
14
|
+
const relativeReactNativeProjectDirectory = path_1.default.relative(ctx.buildDirectory, ctx.reactNativeProjectDirectory);
|
|
15
|
+
ctx.logger.info(`We detected that '${relativeReactNativeProjectDirectory}' is a ${ctx.packageManager} workspace`);
|
|
16
|
+
}
|
|
17
|
+
const relativePackagerRunDir = path_1.default.relative(ctx.buildDirectory, packagerRunDir);
|
|
18
|
+
let args = ['install'];
|
|
19
|
+
if (ctx.packageManager === packageManager_1.PackageManager.PNPM) {
|
|
20
|
+
args = ['install', '--no-frozen-lockfile'];
|
|
21
|
+
}
|
|
22
|
+
else if (ctx.packageManager === packageManager_1.PackageManager.YARN) {
|
|
23
|
+
const isYarn2 = await (0, project_1.isUsingYarn2)(ctx.reactNativeProjectDirectory);
|
|
24
|
+
if (isYarn2) {
|
|
25
|
+
args = ['install', '--no-immutable'];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
ctx.logger.info(`Running "${ctx.packageManager} ${args.join(' ')}" in ${relativePackagerRunDir
|
|
29
|
+
? `directory '${relativePackagerRunDir}'`
|
|
30
|
+
: 'the root dir of your repository'} `);
|
|
31
|
+
await (0, turtle_spawn_1.default)(ctx.packageManager, args, {
|
|
32
|
+
cwd: packagerRunDir,
|
|
33
|
+
logger: ctx.logger,
|
|
34
|
+
env: ctx.env,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.installDependenciesAsync = installDependenciesAsync;
|
|
38
|
+
//# sourceMappingURL=installDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installDependencies.js","sourceRoot":"","sources":["../../src/common/installDependencies.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,sEAAuC;AAGvC,4DAA8E;AAC9E,8CAAgD;AAEzC,KAAK,UAAU,wBAAwB,CAC5C,GAAuB;IAEvB,MAAM,cAAc,GAAG,IAAA,oCAAmB,EAAC,GAAG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expo/eas-build-job';\nimport spawn from '@expo/turtle-spawn';\n\nimport { BuildContext } from '../context';\nimport { findPackagerRootDir, PackageManager } from '../utils/packageManager';\nimport { isUsingYarn2 } from '../utils/project';\n\nexport async function installDependenciesAsync<TJob extends Job>(\n ctx: BuildContext<TJob>\n): Promise<void> {\n const packagerRunDir = findPackagerRootDir(ctx.reactNativeProjectDirectory);\n if (packagerRunDir !== ctx.reactNativeProjectDirectory) {\n const relativeReactNativeProjectDirectory = path.relative(\n ctx.buildDirectory,\n ctx.reactNativeProjectDirectory\n );\n ctx.logger.info(\n `We detected that '${relativeReactNativeProjectDirectory}' is a ${ctx.packageManager} workspace`\n );\n }\n\n const relativePackagerRunDir = path.relative(ctx.buildDirectory, packagerRunDir);\n let args = ['install'];\n if (ctx.packageManager === PackageManager.PNPM) {\n args = ['install', '--no-frozen-lockfile'];\n } else if (ctx.packageManager === PackageManager.YARN) {\n const isYarn2 = await isUsingYarn2(ctx.reactNativeProjectDirectory);\n if (isYarn2) {\n args = ['install', '--no-immutable'];\n }\n }\n ctx.logger.info(\n `Running \"${ctx.packageManager} ${args.join(' ')}\" in ${\n relativePackagerRunDir\n ? `directory '${relativePackagerRunDir}'`\n : 'the root dir of your repository'\n } `\n );\n await spawn(ctx.packageManager, args, {\n cwd: packagerRunDir,\n logger: ctx.logger,\n env: ctx.env,\n });\n}\n"]}
|
|
File without changes
|
|
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.prebuildAsync = void 0;
|
|
7
7
|
const semver_1 = __importDefault(require("semver"));
|
|
8
|
-
const project_1 = require("
|
|
8
|
+
const project_1 = require("../utils/project");
|
|
9
|
+
const installDependencies_1 = require("./installDependencies");
|
|
9
10
|
async function prebuildAsync(ctx, options) {
|
|
10
11
|
var _a;
|
|
11
12
|
const customExpoCliVersion = (_a = ctx.job.builderEnvironment) === null || _a === void 0 ? void 0 : _a.expoCli;
|
|
@@ -17,7 +18,7 @@ async function prebuildAsync(ctx, options) {
|
|
|
17
18
|
};
|
|
18
19
|
const prebuildCommandArgs = getPrebuildCommandArgs(ctx);
|
|
19
20
|
await (0, project_1.runExpoCliCommand)(ctx, prebuildCommandArgs, spawnOptions);
|
|
20
|
-
await (0,
|
|
21
|
+
await (0, installDependencies_1.installDependenciesAsync)(ctx);
|
|
21
22
|
}
|
|
22
23
|
exports.prebuildAsync = prebuildAsync;
|
|
23
24
|
function getPrebuildCommandArgs(ctx) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../src/common/prebuild.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;AAG5B,8CAA6E;AAE7E,+DAAiE;AAM1D,KAAK,UAAU,aAAa,CACjC,GAAuB,EACvB,OAAyB;;IAEzB,MAAM,oBAAoB,GAAG,MAAA,GAAG,CAAC,GAAG,CAAC,kBAAkB,0CAAE,OAAO,CAAC;IACjE,MAAM,kBAAkB,GACtB,CAAC,oBAAoB,IAAI,gBAAM,CAAC,SAAS,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IAE7E,MAAM,YAAY,GAAiB;QACjC,GAAG,EAAE,GAAG,CAAC,2BAA2B;QACpC,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,gDACE,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,yBAAyB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAC9D,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,GAClB,GAAG,CAAC,GAAG,CACX;KACF,CAAC;IAEF,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACxD,MAAM,IAAA,2BAAiB,EAAC,GAAG,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAAC;IAChE,MAAM,IAAA,8CAAwB,EAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AArBD,sCAqBC;AAED,SAAS,sBAAsB,CAAmB,GAAuB;;IACvE,IAAI,eAAe,GACjB,MAAA,MAAA,GAAG,CAAC,GAAG,CAAC,YAAY,0CAAE,eAAe,mCACrC,sDAAsD,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC3E,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE;QAChD,eAAe,GAAG,GAAG,eAAe,eAAe,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;KACvE;IACD,MAAM,gBAAgB,GAAG,MAAM,CAAC;IAChC,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAClC,MAAM,oBAAoB,GAAG,WAAW,CAAC;IACzC,IAAI,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;QAChD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KAC7E;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;QACjD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KAC9E;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE;QACpD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KACjF;IACD,IAAI,CAAC,IAAA,gCAAsB,EAAC,GAAG,CAAC,EAAE;QAChC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;KACrE;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { SpawnOptions } from '@expo/turtle-spawn';\nimport semver from 'semver';\n\nimport { BuildContext } from '../context';\nimport { runExpoCliCommand, shouldUseGlobalExpoCli } from '../utils/project';\n\nimport { installDependenciesAsync } from './installDependencies';\n\nexport interface PrebuildOptions {\n extraEnvs?: Record<string, string>;\n}\n\nexport async function prebuildAsync<TJob extends Job>(\n ctx: BuildContext<TJob>,\n options?: PrebuildOptions\n): Promise<void> {\n const customExpoCliVersion = ctx.job.builderEnvironment?.expoCli;\n const shouldDisableSharp =\n !customExpoCliVersion || semver.satisfies(customExpoCliVersion, '>=5.4.4');\n\n const spawnOptions: SpawnOptions = {\n cwd: ctx.reactNativeProjectDirectory,\n logger: ctx.logger,\n env: {\n ...(shouldDisableSharp ? { EXPO_IMAGE_UTILS_NO_SHARP: '1' } : {}),\n ...options?.extraEnvs,\n ...ctx.env,\n },\n };\n\n const prebuildCommandArgs = getPrebuildCommandArgs(ctx);\n await runExpoCliCommand(ctx, prebuildCommandArgs, spawnOptions);\n await installDependenciesAsync(ctx);\n}\n\nfunction getPrebuildCommandArgs<TJob extends Job>(ctx: BuildContext<TJob>): string[] {\n let prebuildCommand =\n ctx.job.experimental?.prebuildCommand ??\n `prebuild --non-interactive --no-install --platform ${ctx.job.platform}`;\n if (!prebuildCommand.match(/(?:--platform| -p)/)) {\n prebuildCommand = `${prebuildCommand} --platform ${ctx.job.platform}`;\n }\n const npxCommandPrefix = 'npx ';\n const expoCommandPrefix = 'expo ';\n const expoCliCommandPrefix = 'expo-cli ';\n if (prebuildCommand.startsWith(npxCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(npxCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCliCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCliCommandPrefix.length).trim();\n }\n if (!shouldUseGlobalExpoCli(ctx)) {\n prebuildCommand = prebuildCommand.replace(' --non-interactive', '');\n }\n return prebuildCommand.split(' ');\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Job } from '@expo/eas-build-job';
|
|
2
|
+
import { BuildContext } from '../context';
|
|
3
|
+
export declare function prepareProjectSourcesAsync<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void>;
|
|
4
|
+
export declare function downloadAndUnpackProjectFromTarGzAsync<TJob extends Job>(ctx: BuildContext<TJob>, projectArchiveUrl: string): Promise<void>;
|