@expo/build-tools 1.0.91 → 1.0.92
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/android/expoUpdates.d.ts +3 -3
- package/dist/android/expoUpdates.js.map +1 -1
- package/dist/buildErrors/detectError.js +2 -2
- package/dist/buildErrors/detectError.js.map +1 -1
- package/dist/buildErrors/errors.types.d.ts +2 -2
- package/dist/buildErrors/errors.types.js.map +1 -1
- package/dist/buildErrors/userErrorHandlers.js +2 -2
- package/dist/buildErrors/userErrorHandlers.js.map +1 -1
- package/dist/builders/common.d.ts +2 -2
- package/dist/builders/common.js.map +1 -1
- package/dist/builders/custom.js +10 -6
- package/dist/builders/custom.js.map +1 -1
- package/dist/common/easBuildInternal.d.ts +3 -3
- package/dist/common/easBuildInternal.js +1 -1
- package/dist/common/easBuildInternal.js.map +1 -1
- package/dist/common/prebuild.d.ts +2 -2
- package/dist/common/prebuild.js.map +1 -1
- package/dist/common/setup.d.ts +2 -2
- package/dist/common/setup.js.map +1 -1
- package/dist/context.js +4 -0
- package/dist/context.js.map +1 -1
- package/dist/customBuildContext.d.ts +6 -5
- package/dist/customBuildContext.js +12 -0
- package/dist/customBuildContext.js.map +1 -1
- package/dist/ios/expoUpdates.d.ts +3 -3
- package/dist/ios/expoUpdates.js.map +1 -1
- package/dist/steps/easFunctionGroups.js +5 -1
- package/dist/steps/easFunctionGroups.js.map +1 -1
- package/dist/steps/easFunctions.js +10 -5
- package/dist/steps/easFunctions.js.map +1 -1
- package/dist/steps/functionGroups/build.d.ts +2 -1
- package/dist/steps/functionGroups/build.js +6 -5
- package/dist/steps/functionGroups/build.js.map +1 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.d.ts +2 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +11 -3
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +1 -1
- package/dist/steps/functions/configureEASUpdateIfInstalled.js +1 -0
- package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +1 -1
- package/dist/steps/functions/findAndUploadBuildArtifacts.d.ts +2 -1
- package/dist/steps/functions/findAndUploadBuildArtifacts.js.map +1 -1
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.d.ts +2 -1
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js.map +1 -1
- package/dist/steps/functions/prebuild.js +1 -0
- package/dist/steps/functions/prebuild.js.map +1 -1
- package/dist/steps/functions/resolveBuildConfig.d.ts +3 -2
- package/dist/steps/functions/resolveBuildConfig.js.map +1 -1
- package/dist/steps/utils/expoUpdates.d.ts +2 -2
- package/dist/steps/utils/expoUpdates.js.map +1 -1
- package/dist/utils/artifacts.d.ts +2 -2
- package/dist/utils/artifacts.js.map +1 -1
- package/dist/utils/expoUpdates.d.ts +6 -6
- package/dist/utils/expoUpdates.js.map +1 -1
- package/package.json +4 -4
package/dist/context.js
CHANGED
|
@@ -161,6 +161,10 @@ class BuildContext {
|
|
|
161
161
|
}
|
|
162
162
|
getReactNativeProjectDirectory(baseDirectory = this.buildDirectory) {
|
|
163
163
|
var _a;
|
|
164
|
+
if (!this.job.platform) {
|
|
165
|
+
// Generic jobs start from base directory.
|
|
166
|
+
return baseDirectory;
|
|
167
|
+
}
|
|
164
168
|
return path_1.default.join(baseDirectory, (_a = this.job.projectRootDirectory) !== null && _a !== void 0 ? _a : '.');
|
|
165
169
|
}
|
|
166
170
|
setBuildPhase(buildPhase, { doNotMarkStart = false } = {}) {
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,uDAa6B;AAI7B,4DAA+D;AAE/D,2DAA+E;AAC/E,2DAAwE;AACxE,iDAAkD;AAClD,mEAAkF;AAkDlF,MAAa,oBAAqB,SAAQ,KAAK;CAAG;AAAlD,oDAAkD;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BAC1C,kBAAkB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;YACnC,CAAC;iBAAM,CAAC;gBACN,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAA,yDAAoC,EAC7D,IAAI,CAAC,2BAA2B,EAChC,KAAK,CACN,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AA1SD,oCA0SC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport {\n ManagedArtifactType,\n BuildPhase,\n BuildPhaseResult,\n BuildPhaseStats,\n Job,\n LogMarker,\n Env,\n errors,\n Metadata,\n EnvironmentSecretType,\n GenericArtifactType,\n isGenericArtifact,\n} from '@expo/eas-build-job';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { SpawnPromise, SpawnOptions, SpawnResult } from '@expo/turtle-spawn';\nimport { BuildTrigger } from '@expo/eas-build-job/dist/common';\n\nimport { PackageManager, resolvePackageManager } from './utils/packageManager';\nimport { resolveBuildPhaseErrorAsync } from './buildErrors/detectError';\nimport { readAppConfig } from './utils/appConfig';\nimport { createTemporaryEnvironmentSecretFile } from './utils/environmentSecrets';\n\nexport type Artifacts = Partial<Record<ManagedArtifactType, string>>;\n\nexport interface CacheManager {\n saveCache(ctx: BuildContext<Job>): Promise<void>;\n restoreCache(ctx: BuildContext<Job>): Promise<void>;\n}\n\nexport interface LogBuffer {\n getLogs(): string[];\n getPhaseLogs(buildPhase: string): string[];\n}\n\nexport type ArtifactToUpload =\n | {\n type: ManagedArtifactType;\n paths: string[];\n }\n | {\n type: GenericArtifactType;\n key: string;\n paths: string[];\n };\n\nexport interface BuildContextOptions {\n workingdir: string;\n logger: bunyan;\n logBuffer: LogBuffer;\n env: Env;\n cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n runGlobalExpoCliCommand: (\n args: string[],\n options: SpawnOptions,\n npmVersionAtLeast7: boolean\n ) => SpawnPromise<SpawnResult>;\n uploadArtifact: (spec: { artifact: ArtifactToUpload; logger: bunyan }) => Promise<string | null>;\n reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n reportBuildPhaseStats?: (stats: BuildPhaseStats) => void;\n skipNativeBuild?: boolean;\n metadata?: Metadata;\n}\n\nexport class SkipNativeBuildError extends Error {}\n\nexport class BuildContext<TJob extends Job> {\n public readonly workingdir: string;\n public logger: bunyan;\n public readonly logBuffer: LogBuffer;\n public readonly cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n public readonly runGlobalExpoCliCommand: (\n args: string[],\n options: SpawnOptions,\n npmVersionAtLeast7: boolean\n ) => SpawnPromise<SpawnResult>;\n public readonly reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n public readonly skipNativeBuild?: boolean;\n public artifacts: Artifacts = {};\n\n private _env: Env;\n private _job: TJob;\n private _metadata?: Metadata;\n private readonly defaultLogger: bunyan;\n private readonly _uploadArtifact: BuildContextOptions['uploadArtifact'];\n private buildPhase?: BuildPhase;\n private buildPhaseSkipped = false;\n private buildPhaseHasWarnings = false;\n private _appConfig?: ExpoConfig;\n private readonly reportBuildPhaseStats?: (stats: BuildPhaseStats) => void;\n\n constructor(job: TJob, options: BuildContextOptions) {\n this.workingdir = options.workingdir;\n this.defaultLogger = options.logger;\n this.logger = this.defaultLogger;\n this.logBuffer = options.logBuffer;\n this.cacheManager = options.cacheManager;\n this.runGlobalExpoCliCommand = options.runGlobalExpoCliCommand;\n this._uploadArtifact = options.uploadArtifact;\n this.reportError = options.reportError;\n this._job = job;\n this._metadata = options.metadata;\n this.skipNativeBuild = options.skipNativeBuild;\n this.reportBuildPhaseStats = options.reportBuildPhaseStats;\n\n const environmentSecrets = this.getEnvironmentSecrets(job);\n this._env = {\n ...options.env,\n ...job?.builderEnvironment?.env,\n ...environmentSecrets,\n __EAS_BUILD_ENVS_DIR: this.buildEnvsDirectory,\n };\n this._env.PATH = this._env.PATH\n ? [this.buildExecutablesDirectory, this._env.PATH].join(':')\n : this.buildExecutablesDirectory;\n }\n\n public get job(): TJob {\n return this._job;\n }\n public get metadata(): Metadata | undefined {\n return this._metadata;\n }\n public get env(): Env {\n return this._env;\n }\n public get buildDirectory(): string {\n return path.join(this.workingdir, 'build');\n }\n public get buildLogsDirectory(): string {\n return path.join(this.workingdir, 'logs');\n }\n /**\n * Directory used to store executables used during regular (non-custom) builds.\n */\n public get buildExecutablesDirectory(): string {\n return path.join(this.workingdir, 'bin');\n }\n /**\n * Directory used to store env variables registered in the current build step.\n * All values stored here will be available in the next build phase as env variables.\n */\n public get buildEnvsDirectory(): string {\n return path.join(this.workingdir, 'env');\n }\n public get environmentSecretsDirectory(): string {\n return path.join(this.workingdir, 'environment-secrets');\n }\n public get packageManager(): PackageManager {\n return resolvePackageManager(this.getReactNativeProjectDirectory());\n }\n public get appConfig(): ExpoConfig {\n if (!this._appConfig) {\n this._appConfig = readAppConfig({\n projectDir: this.getReactNativeProjectDirectory(),\n env: this.env,\n logger: this.logger,\n sdkVersion: this.metadata?.sdkVersion,\n }).exp;\n }\n return this._appConfig;\n }\n\n public async runBuildPhase<T>(\n buildPhase: BuildPhase,\n phase: () => Promise<T>,\n {\n doNotMarkStart = false,\n doNotMarkEnd = false,\n }: {\n doNotMarkStart?: boolean;\n doNotMarkEnd?: boolean;\n } = {}\n ): Promise<T> {\n let startTimestamp = Date.now();\n try {\n this.setBuildPhase(buildPhase, { doNotMarkStart });\n startTimestamp = Date.now();\n const result = await phase();\n const durationMs = Date.now() - startTimestamp;\n const buildPhaseResult: BuildPhaseResult = this.buildPhaseSkipped\n ? BuildPhaseResult.SKIPPED\n : this.buildPhaseHasWarnings\n ? BuildPhaseResult.WARNING\n : BuildPhaseResult.SUCCESS;\n await this.endCurrentBuildPhaseAsync({ result: buildPhaseResult, doNotMarkEnd, durationMs });\n return result;\n } catch (err: any) {\n const durationMs = Date.now() - startTimestamp;\n const resolvedError = await this.handleBuildPhaseErrorAsync(err, buildPhase);\n await this.endCurrentBuildPhaseAsync({ result: BuildPhaseResult.FAIL, durationMs });\n throw resolvedError;\n }\n }\n\n public markBuildPhaseSkipped(): void {\n this.buildPhaseSkipped = true;\n }\n\n public markBuildPhaseHasWarnings(): void {\n this.buildPhaseHasWarnings = true;\n }\n\n public async uploadArtifact({\n artifact,\n logger,\n }: {\n artifact: ArtifactToUpload;\n logger: bunyan;\n }): Promise<void> {\n const bucketKey = await this._uploadArtifact({ artifact, logger });\n if (bucketKey && !isGenericArtifact(artifact)) {\n this.artifacts[artifact.type] = bucketKey;\n }\n }\n\n public updateEnv(env: Env): void {\n if (this._job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {\n throw new Error(\n 'Updating environment variables is only allowed when build was triggered by a git-based integration.'\n );\n }\n this._env = {\n ...env,\n ...this._env,\n __EAS_BUILD_ENVS_DIR: this.buildEnvsDirectory,\n };\n this._env.PATH = this._env.PATH\n ? [this.buildExecutablesDirectory, this._env.PATH].join(':')\n : this.buildExecutablesDirectory;\n }\n\n public updateJobInformation(job: TJob, metadata: Metadata): void {\n if (this._job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {\n throw new Error(\n 'Updating job information is only allowed when build was triggered by a git-based integration.'\n );\n }\n this._job = { ...job, triggeredBy: this._job.triggeredBy };\n this._metadata = metadata;\n }\n\n private async handleBuildPhaseErrorAsync(\n err: any,\n buildPhase: BuildPhase\n ): Promise<errors.BuildError> {\n const buildError = await resolveBuildPhaseErrorAsync(\n err,\n this.logBuffer.getPhaseLogs(buildPhase),\n {\n job: this.job,\n phase: buildPhase,\n env: this.env,\n },\n this.buildLogsDirectory\n );\n if (buildError.errorCode === errors.ErrorCode.UNKNOWN_ERROR) {\n // leaving message empty, website will display err.stack which already includes err.message\n this.logger.error({ err }, '');\n } else {\n this.logger.error(`Error: ${buildError.userFacingMessage}`);\n }\n return buildError;\n }\n\n public getReactNativeProjectDirectory(baseDirectory = this.buildDirectory): string {\n return path.join(baseDirectory, this.job.projectRootDirectory ?? '.');\n }\n\n private setBuildPhase(buildPhase: BuildPhase, { doNotMarkStart = false } = {}): void {\n if (this.buildPhase) {\n if (this.buildPhase === buildPhase) {\n return;\n } else {\n this.logger.info(\n { marker: LogMarker.END_PHASE, result: BuildPhaseResult.UNKNOWN },\n `End phase: ${this.buildPhase}`\n );\n this.logger = this.defaultLogger;\n }\n }\n this.buildPhase = buildPhase;\n this.logger = this.defaultLogger.child({ phase: buildPhase });\n if (!doNotMarkStart) {\n this.logger.info({ marker: LogMarker.START_PHASE }, `Start phase: ${this.buildPhase}`);\n }\n }\n\n private async endCurrentBuildPhaseAsync({\n result,\n doNotMarkEnd = false,\n durationMs,\n }: {\n result: BuildPhaseResult;\n doNotMarkEnd?: boolean;\n durationMs: number;\n }): Promise<void> {\n if (!this.buildPhase) {\n return;\n }\n await this.collectAndUpdateEnvVariablesAsync();\n\n this.reportBuildPhaseStats?.({ buildPhase: this.buildPhase, result, durationMs });\n\n if (!doNotMarkEnd) {\n this.logger.info(\n { marker: LogMarker.END_PHASE, result, durationMs },\n `End phase: ${this.buildPhase}`\n );\n }\n this.logger = this.defaultLogger;\n this.buildPhase = undefined;\n this.buildPhaseSkipped = false;\n this.buildPhaseHasWarnings = false;\n }\n\n private async collectAndUpdateEnvVariablesAsync(): Promise<void> {\n const filenames = await fs.readdir(this.buildEnvsDirectory);\n\n const entries = await Promise.all(\n filenames.map(async (basename) => {\n const rawContents = await fs.readFile(\n path.join(this.buildEnvsDirectory, basename),\n 'utf-8'\n );\n return [basename, rawContents];\n })\n );\n await Promise.all(\n filenames.map(async (basename) => {\n await fs.remove(path.join(this.buildEnvsDirectory, basename));\n })\n );\n this._env = {\n ...this._env,\n ...Object.fromEntries(entries),\n };\n }\n\n private getEnvironmentSecrets(job: TJob): Record<string, string> {\n if (!job?.secrets?.environmentSecrets) {\n return {};\n }\n\n const environmentSecrets: Record<string, string> = {};\n for (const { name, type, value } of job.secrets.environmentSecrets) {\n if (type === EnvironmentSecretType.STRING) {\n environmentSecrets[name] = value;\n } else {\n environmentSecrets[name] = createTemporaryEnvironmentSecretFile(\n this.environmentSecretsDirectory,\n value\n );\n }\n }\n return environmentSecrets;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,uDAa6B;AAI7B,4DAA+D;AAE/D,2DAA+E;AAC/E,2DAAwE;AACxE,iDAAkD;AAClD,mEAAkF;AAkDlF,MAAa,oBAAqB,SAAQ,KAAK;CAAG;AAAlD,oDAAkD;AAElD,MAAa,YAAY;IAgCvB,YAAY,GAAS,EAAE,OAA4B;;QAb5C,cAAS,GAAc,EAAE,CAAC;QAQzB,sBAAiB,GAAG,KAAK,CAAC;QAC1B,0BAAqB,GAAG,KAAK,CAAC;QAKpC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC;QAC/D,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;QAE3D,MAAM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,CAAC,CACH,CAAC;QACF,IAAI,CAAC,IAAI,GAAG;YACV,GAAG,IAAI,CAAC,IAAI;YACZ,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;SAC/B,CAAC;IACJ,CAAC;IAEO,qBAAqB,CAAC,GAAS;;QACrC,IAAI,CAAC,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,0CAAE,kBAAkB,CAAA,EAAE,CAAC;YACtC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,kBAAkB,GAA2B,EAAE,CAAC;QACtD,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;YACnE,IAAI,IAAI,KAAK,qCAAqB,CAAC,MAAM,EAAE,CAAC;gBAC1C,kBAAkB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;YACnC,CAAC;iBAAM,CAAC;gBACN,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAA,yDAAoC,EAC7D,IAAI,CAAC,2BAA2B,EAChC,KAAK,CACN,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AA/SD,oCA+SC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport {\n ManagedArtifactType,\n BuildPhase,\n BuildPhaseResult,\n BuildPhaseStats,\n Job,\n LogMarker,\n Env,\n errors,\n Metadata,\n EnvironmentSecretType,\n GenericArtifactType,\n isGenericArtifact,\n} from '@expo/eas-build-job';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { SpawnPromise, SpawnOptions, SpawnResult } from '@expo/turtle-spawn';\nimport { BuildTrigger } from '@expo/eas-build-job/dist/common';\n\nimport { PackageManager, resolvePackageManager } from './utils/packageManager';\nimport { resolveBuildPhaseErrorAsync } from './buildErrors/detectError';\nimport { readAppConfig } from './utils/appConfig';\nimport { createTemporaryEnvironmentSecretFile } from './utils/environmentSecrets';\n\nexport type Artifacts = Partial<Record<ManagedArtifactType, string>>;\n\nexport interface CacheManager {\n saveCache(ctx: BuildContext<Job>): Promise<void>;\n restoreCache(ctx: BuildContext<Job>): Promise<void>;\n}\n\nexport interface LogBuffer {\n getLogs(): string[];\n getPhaseLogs(buildPhase: string): string[];\n}\n\nexport type ArtifactToUpload =\n | {\n type: ManagedArtifactType;\n paths: string[];\n }\n | {\n type: GenericArtifactType;\n key: string;\n paths: string[];\n };\n\nexport interface BuildContextOptions {\n workingdir: string;\n logger: bunyan;\n logBuffer: LogBuffer;\n env: Env;\n cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n runGlobalExpoCliCommand: (\n args: string[],\n options: SpawnOptions,\n npmVersionAtLeast7: boolean\n ) => SpawnPromise<SpawnResult>;\n uploadArtifact: (spec: { artifact: ArtifactToUpload; logger: bunyan }) => Promise<string | null>;\n reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n reportBuildPhaseStats?: (stats: BuildPhaseStats) => void;\n skipNativeBuild?: boolean;\n metadata?: Metadata;\n}\n\nexport class SkipNativeBuildError extends Error {}\n\nexport class BuildContext<TJob extends Job> {\n public readonly workingdir: string;\n public logger: bunyan;\n public readonly logBuffer: LogBuffer;\n public readonly cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n public readonly runGlobalExpoCliCommand: (\n args: string[],\n options: SpawnOptions,\n npmVersionAtLeast7: boolean\n ) => SpawnPromise<SpawnResult>;\n public readonly reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n public readonly skipNativeBuild?: boolean;\n public artifacts: Artifacts = {};\n\n private _env: Env;\n private _job: TJob;\n private _metadata?: Metadata;\n private readonly defaultLogger: bunyan;\n private readonly _uploadArtifact: BuildContextOptions['uploadArtifact'];\n private buildPhase?: BuildPhase;\n private buildPhaseSkipped = false;\n private buildPhaseHasWarnings = false;\n private _appConfig?: ExpoConfig;\n private readonly reportBuildPhaseStats?: (stats: BuildPhaseStats) => void;\n\n constructor(job: TJob, options: BuildContextOptions) {\n this.workingdir = options.workingdir;\n this.defaultLogger = options.logger;\n this.logger = this.defaultLogger;\n this.logBuffer = options.logBuffer;\n this.cacheManager = options.cacheManager;\n this.runGlobalExpoCliCommand = options.runGlobalExpoCliCommand;\n this._uploadArtifact = options.uploadArtifact;\n this.reportError = options.reportError;\n this._job = job;\n this._metadata = options.metadata;\n this.skipNativeBuild = options.skipNativeBuild;\n this.reportBuildPhaseStats = options.reportBuildPhaseStats;\n\n const environmentSecrets = this.getEnvironmentSecrets(job);\n this._env = {\n ...options.env,\n ...job?.builderEnvironment?.env,\n ...environmentSecrets,\n __EAS_BUILD_ENVS_DIR: this.buildEnvsDirectory,\n };\n this._env.PATH = this._env.PATH\n ? [this.buildExecutablesDirectory, this._env.PATH].join(':')\n : this.buildExecutablesDirectory;\n }\n\n public get job(): TJob {\n return this._job;\n }\n public get metadata(): Metadata | undefined {\n return this._metadata;\n }\n public get env(): Env {\n return this._env;\n }\n public get buildDirectory(): string {\n return path.join(this.workingdir, 'build');\n }\n public get buildLogsDirectory(): string {\n return path.join(this.workingdir, 'logs');\n }\n /**\n * Directory used to store executables used during regular (non-custom) builds.\n */\n public get buildExecutablesDirectory(): string {\n return path.join(this.workingdir, 'bin');\n }\n /**\n * Directory used to store env variables registered in the current build step.\n * All values stored here will be available in the next build phase as env variables.\n */\n public get buildEnvsDirectory(): string {\n return path.join(this.workingdir, 'env');\n }\n public get environmentSecretsDirectory(): string {\n return path.join(this.workingdir, 'environment-secrets');\n }\n public get packageManager(): PackageManager {\n return resolvePackageManager(this.getReactNativeProjectDirectory());\n }\n public get appConfig(): ExpoConfig {\n if (!this._appConfig) {\n this._appConfig = readAppConfig({\n projectDir: this.getReactNativeProjectDirectory(),\n env: this.env,\n logger: this.logger,\n sdkVersion: this.metadata?.sdkVersion,\n }).exp;\n }\n return this._appConfig;\n }\n\n public async runBuildPhase<T>(\n buildPhase: BuildPhase,\n phase: () => Promise<T>,\n {\n doNotMarkStart = false,\n doNotMarkEnd = false,\n }: {\n doNotMarkStart?: boolean;\n doNotMarkEnd?: boolean;\n } = {}\n ): Promise<T> {\n let startTimestamp = Date.now();\n try {\n this.setBuildPhase(buildPhase, { doNotMarkStart });\n startTimestamp = Date.now();\n const result = await phase();\n const durationMs = Date.now() - startTimestamp;\n const buildPhaseResult: BuildPhaseResult = this.buildPhaseSkipped\n ? BuildPhaseResult.SKIPPED\n : this.buildPhaseHasWarnings\n ? BuildPhaseResult.WARNING\n : BuildPhaseResult.SUCCESS;\n await this.endCurrentBuildPhaseAsync({ result: buildPhaseResult, doNotMarkEnd, durationMs });\n return result;\n } catch (err: any) {\n const durationMs = Date.now() - startTimestamp;\n const resolvedError = await this.handleBuildPhaseErrorAsync(err, buildPhase);\n await this.endCurrentBuildPhaseAsync({ result: BuildPhaseResult.FAIL, durationMs });\n throw resolvedError;\n }\n }\n\n public markBuildPhaseSkipped(): void {\n this.buildPhaseSkipped = true;\n }\n\n public markBuildPhaseHasWarnings(): void {\n this.buildPhaseHasWarnings = true;\n }\n\n public async uploadArtifact({\n artifact,\n logger,\n }: {\n artifact: ArtifactToUpload;\n logger: bunyan;\n }): Promise<void> {\n const bucketKey = await this._uploadArtifact({ artifact, logger });\n if (bucketKey && !isGenericArtifact(artifact)) {\n this.artifacts[artifact.type] = bucketKey;\n }\n }\n\n public updateEnv(env: Env): void {\n if (this._job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {\n throw new Error(\n 'Updating environment variables is only allowed when build was triggered by a git-based integration.'\n );\n }\n this._env = {\n ...env,\n ...this._env,\n __EAS_BUILD_ENVS_DIR: this.buildEnvsDirectory,\n };\n this._env.PATH = this._env.PATH\n ? [this.buildExecutablesDirectory, this._env.PATH].join(':')\n : this.buildExecutablesDirectory;\n }\n\n public updateJobInformation(job: TJob, metadata: Metadata): void {\n if (this._job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {\n throw new Error(\n 'Updating job information is only allowed when build was triggered by a git-based integration.'\n );\n }\n this._job = { ...job, triggeredBy: this._job.triggeredBy };\n this._metadata = metadata;\n }\n\n private async handleBuildPhaseErrorAsync(\n err: any,\n buildPhase: BuildPhase\n ): Promise<errors.BuildError> {\n const buildError = await resolveBuildPhaseErrorAsync(\n err,\n this.logBuffer.getPhaseLogs(buildPhase),\n {\n job: this.job,\n phase: buildPhase,\n env: this.env,\n },\n this.buildLogsDirectory\n );\n if (buildError.errorCode === errors.ErrorCode.UNKNOWN_ERROR) {\n // leaving message empty, website will display err.stack which already includes err.message\n this.logger.error({ err }, '');\n } else {\n this.logger.error(`Error: ${buildError.userFacingMessage}`);\n }\n return buildError;\n }\n\n public getReactNativeProjectDirectory(baseDirectory = this.buildDirectory): string {\n if (!this.job.platform) {\n // Generic jobs start from base directory.\n return baseDirectory;\n }\n\n return path.join(baseDirectory, this.job.projectRootDirectory ?? '.');\n }\n\n private setBuildPhase(buildPhase: BuildPhase, { doNotMarkStart = false } = {}): void {\n if (this.buildPhase) {\n if (this.buildPhase === buildPhase) {\n return;\n } else {\n this.logger.info(\n { marker: LogMarker.END_PHASE, result: BuildPhaseResult.UNKNOWN },\n `End phase: ${this.buildPhase}`\n );\n this.logger = this.defaultLogger;\n }\n }\n this.buildPhase = buildPhase;\n this.logger = this.defaultLogger.child({ phase: buildPhase });\n if (!doNotMarkStart) {\n this.logger.info({ marker: LogMarker.START_PHASE }, `Start phase: ${this.buildPhase}`);\n }\n }\n\n private async endCurrentBuildPhaseAsync({\n result,\n doNotMarkEnd = false,\n durationMs,\n }: {\n result: BuildPhaseResult;\n doNotMarkEnd?: boolean;\n durationMs: number;\n }): Promise<void> {\n if (!this.buildPhase) {\n return;\n }\n await this.collectAndUpdateEnvVariablesAsync();\n\n this.reportBuildPhaseStats?.({ buildPhase: this.buildPhase, result, durationMs });\n\n if (!doNotMarkEnd) {\n this.logger.info(\n { marker: LogMarker.END_PHASE, result, durationMs },\n `End phase: ${this.buildPhase}`\n );\n }\n this.logger = this.defaultLogger;\n this.buildPhase = undefined;\n this.buildPhaseSkipped = false;\n this.buildPhaseHasWarnings = false;\n }\n\n private async collectAndUpdateEnvVariablesAsync(): Promise<void> {\n const filenames = await fs.readdir(this.buildEnvsDirectory);\n\n const entries = await Promise.all(\n filenames.map(async (basename) => {\n const rawContents = await fs.readFile(\n path.join(this.buildEnvsDirectory, basename),\n 'utf-8'\n );\n return [basename, rawContents];\n })\n );\n await Promise.all(\n filenames.map(async (basename) => {\n await fs.remove(path.join(this.buildEnvsDirectory, basename));\n })\n );\n this._env = {\n ...this._env,\n ...Object.fromEntries(entries),\n };\n }\n\n private getEnvironmentSecrets(job: TJob): Record<string, string> {\n if (!job?.secrets?.environmentSecrets) {\n return {};\n }\n\n const environmentSecrets: Record<string, string> = {};\n for (const { name, type, value } of job.secrets.environmentSecrets) {\n if (type === EnvironmentSecretType.STRING) {\n environmentSecrets[name] = value;\n } else {\n environmentSecrets[name] = createTemporaryEnvironmentSecretFile(\n this.environmentSecretsDirectory,\n value\n );\n }\n }\n return environmentSecrets;\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="bunyan" />
|
|
2
|
-
import { BuildStaticContext, Env, Job, Metadata } from '@expo/eas-build-job';
|
|
2
|
+
import { BuildJob, BuildStaticContext, Env, Job, Metadata } from '@expo/eas-build-job';
|
|
3
3
|
import { bunyan } from '@expo/logger';
|
|
4
4
|
import { ExternalBuildContextProvider, BuildRuntimePlatform } from '@expo/steps';
|
|
5
5
|
import { ArtifactToUpload, BuildContext } from './context';
|
|
@@ -9,20 +9,21 @@ export interface BuilderRuntimeApi {
|
|
|
9
9
|
logger: bunyan;
|
|
10
10
|
}) => Promise<void>;
|
|
11
11
|
}
|
|
12
|
-
export declare class CustomBuildContext implements ExternalBuildContextProvider {
|
|
12
|
+
export declare class CustomBuildContext<TJob extends Job = Job> implements ExternalBuildContextProvider {
|
|
13
13
|
readonly projectSourceDirectory: string;
|
|
14
14
|
readonly projectTargetDirectory: string;
|
|
15
15
|
readonly defaultWorkingDirectory: string;
|
|
16
16
|
readonly buildLogsDirectory: string;
|
|
17
17
|
readonly logger: bunyan;
|
|
18
18
|
readonly runtimeApi: BuilderRuntimeApi;
|
|
19
|
-
job:
|
|
19
|
+
job: TJob;
|
|
20
20
|
metadata?: Metadata;
|
|
21
21
|
private _env;
|
|
22
|
-
constructor(buildCtx: BuildContext<
|
|
22
|
+
constructor(buildCtx: BuildContext<TJob>);
|
|
23
|
+
hasBuildJob(): this is BuildContext<BuildJob>;
|
|
23
24
|
get runtimePlatform(): BuildRuntimePlatform;
|
|
24
25
|
get env(): Env;
|
|
25
26
|
staticContext(): BuildStaticContext;
|
|
26
27
|
updateEnv(env: Env): void;
|
|
27
|
-
updateJobInformation(job:
|
|
28
|
+
updateJobInformation(job: TJob, metadata: Metadata): void;
|
|
28
29
|
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CustomBuildContext = void 0;
|
|
7
|
+
const assert_1 = __importDefault(require("assert"));
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
10
|
const steps_1 = require("@expo/steps");
|
|
@@ -25,7 +26,18 @@ class CustomBuildContext {
|
|
|
25
26
|
uploadArtifact: (...args) => buildCtx['uploadArtifact'](...args),
|
|
26
27
|
};
|
|
27
28
|
}
|
|
29
|
+
hasBuildJob() {
|
|
30
|
+
return Boolean(this.job.platform);
|
|
31
|
+
}
|
|
28
32
|
get runtimePlatform() {
|
|
33
|
+
// Generic jobs are not per-platform.
|
|
34
|
+
if (!this.job.platform) {
|
|
35
|
+
(0, assert_1.default)(process.platform === 'linux' || process.platform === 'darwin', `Invalid platform, expected linux or darwin, got: ${process.platform}`);
|
|
36
|
+
return {
|
|
37
|
+
linux: steps_1.BuildRuntimePlatform.LINUX,
|
|
38
|
+
darwin: steps_1.BuildRuntimePlatform.DARWIN,
|
|
39
|
+
}[process.platform];
|
|
40
|
+
}
|
|
29
41
|
return platformToBuildRuntimePlatform[this.job.platform];
|
|
30
42
|
}
|
|
31
43
|
get env() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customBuildContext.js","sourceRoot":"","sources":["../src/customBuildContext.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"customBuildContext.js","sourceRoot":"","sources":["../src/customBuildContext.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,gDAAwB;AAExB,uDAS6B;AAE7B,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;IA4B7B,YAAY,QAA4B;QACtC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAElC,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;QAC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AE,QAAkB;QACvD,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,KAAK,4BAAY,CAAC,qBAAqB,EAAE,CAAC;YAChE,MAAM,IAAI,KAAK,CACb,+FAA+F,CAChG,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACzD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAxFD,gDAwFC","sourcesContent":["import assert from 'assert';\nimport path from 'path';\n\nimport {\n BuildJob,\n BuildPhase,\n BuildStaticContext,\n BuildTrigger,\n Env,\n Job,\n Metadata,\n Platform,\n} from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport { ExternalBuildContextProvider, BuildRuntimePlatform } from '@expo/steps';\n\nimport { ArtifactToUpload, 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 uploadArtifact: (spec: { artifact: ArtifactToUpload; logger: bunyan }) => Promise<void>;\n}\n\nexport class CustomBuildContext<TJob extends Job = Job> 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 job: TJob;\n public metadata?: Metadata;\n\n private _env: Env;\n\n constructor(buildCtx: BuildContext<TJob>) {\n this._env = buildCtx.env;\n this.job = buildCtx.job;\n this.metadata = buildCtx.metadata;\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 uploadArtifact: (...args) => buildCtx['uploadArtifact'](...args),\n };\n }\n\n public hasBuildJob(): this is BuildContext<BuildJob> {\n return Boolean(this.job.platform);\n }\n\n public get runtimePlatform(): BuildRuntimePlatform {\n // Generic jobs are not per-platform.\n if (!this.job.platform) {\n assert(\n process.platform === 'linux' || process.platform === 'darwin',\n `Invalid platform, expected linux or darwin, got: ${process.platform}`\n );\n return {\n linux: BuildRuntimePlatform.LINUX,\n darwin: BuildRuntimePlatform.DARWIN,\n }[process.platform];\n }\n\n return platformToBuildRuntimePlatform[this.job.platform];\n }\n\n public get env(): Env {\n return this._env;\n }\n\n public staticContext(): BuildStaticContext {\n return {\n job: this.job,\n metadata: this.metadata ?? null,\n env: this.env,\n };\n }\n\n public updateEnv(env: Env): void {\n this._env = env;\n }\n\n public updateJobInformation(job: TJob, metadata: Metadata): void {\n if (this.job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {\n throw new Error(\n 'Updating job information is only allowed when build was triggered by a git-based integration.'\n );\n }\n this.job = { ...job, triggeredBy: this.job.triggeredBy };\n this.metadata = metadata;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Job } from '@expo/eas-build-job';
|
|
1
|
+
import { BuildJob, Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildContext } from '../context';
|
|
3
3
|
export declare enum IosMetadataName {
|
|
4
4
|
UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = "EXUpdatesRequestHeaders",
|
|
@@ -6,8 +6,8 @@ export declare enum IosMetadataName {
|
|
|
6
6
|
RUNTIME_VERSION = "EXUpdatesRuntimeVersion"
|
|
7
7
|
}
|
|
8
8
|
export declare function iosSetRuntimeVersionNativelyAsync(ctx: BuildContext<Job>, runtimeVersion: string): Promise<void>;
|
|
9
|
-
export declare function iosSetChannelNativelyAsync(ctx: BuildContext<
|
|
9
|
+
export declare function iosSetChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void>;
|
|
10
10
|
export declare function iosGetNativelyDefinedChannelAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
11
|
-
export declare function iosSetClassicReleaseChannelNativelyAsync(ctx: BuildContext<
|
|
11
|
+
export declare function iosSetClassicReleaseChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void>;
|
|
12
12
|
export declare function iosGetNativelyDefinedClassicReleaseChannelAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
13
13
|
export declare function iosGetNativelyDefinedRuntimeVersionAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/ios/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,yDAAiD;AACjD,wDAA0B;AAC1B,wDAAgC;AAKhC,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,wFAAqE,CAAA;IACrE,8DAA2C,CAAA;IAC3C,8DAA2C,CAAA;AAC7C,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAEM,KAAK,UAAU,iCAAiC,CACrD,GAAsB,EACtB,cAAsB;IAEtB,MAAM,aAAa,GAAG,0BAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,8BAA8B,EAAE,CAAC,CAAC;IAE7F,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,GAAG,aAAa,iBAAiB,CAAC,CAAC;IACrD,CAAC;IA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,GAAG,eAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACnD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAA,WAAW,CAAC,eAAe,CAAC,eAAe,CAAC,mCAAI,IAAI,CAAC;AAC9D,CAAC;AAbD,4FAaC","sourcesContent":["import assert from 'assert';\n\nimport { IOSConfig } from '@expo/config-plugins';\nimport fs from 'fs-extra';\nimport plist from '@expo/plist';\nimport { BuildJob, Job } from '@expo/eas-build-job';\n\nimport { BuildContext } from '../context';\n\nexport enum IosMetadataName {\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'EXUpdatesRequestHeaders',\n RELEASE_CHANNEL = 'EXUpdatesReleaseChannel',\n RUNTIME_VERSION = 'EXUpdatesRuntimeVersion',\n}\n\nexport async function iosSetRuntimeVersionNativelyAsync(\n ctx: BuildContext<Job>,\n runtimeVersion: string\n): Promise<void> {\n const expoPlistPath = IOSConfig.Paths.getExpoPlistPath(ctx.getReactNativeProjectDirectory());\n\n if (!(await fs.pathExists(expoPlistPath))) {\n throw new Error(`${expoPlistPath} does not exist`);\n }\n\n const expoPlistContents = await fs.readFile(expoPlistPath, 'utf8');\n const items = plist.parse(expoPlistContents);\n items[IosMetadataName.RUNTIME_VERSION] = runtimeVersion;\n const updatedExpoPlistContents = plist.build(items);\n\n await fs.writeFile(expoPlistPath, updatedExpoPlistContents);\n}\n\nexport async function iosSetChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n\n const expoPlistPath = IOSConfig.Paths.getExpoPlistPath(ctx.getReactNativeProjectDirectory());\n\n if (!(await fs.pathExists(expoPlistPath))) {\n throw new Error(`${expoPlistPath} does not exist`);\n }\n\n const expoPlistContents = await fs.readFile(expoPlistPath, 'utf8');\n const items: Record<string, string | Record<string, string>> = plist.parse(expoPlistContents);\n items[IosMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY] = {\n ...((items[IosMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY] as Record<\n string,\n string\n >) ?? {}),\n 'expo-channel-name': ctx.job.updates.channel,\n };\n const updatedExpoPlistContents = plist.build(items);\n\n await fs.writeFile(expoPlistPath, updatedExpoPlistContents);\n}\n\nexport async function iosGetNativelyDefinedChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const expoPlistPath = IOSConfig.Paths.getExpoPlistPath(ctx.getReactNativeProjectDirectory());\n\n if (!(await fs.pathExists(expoPlistPath))) {\n return null;\n }\n\n const expoPlistContents = await fs.readFile(expoPlistPath, 'utf8');\n try {\n const items: Record<string, string | Record<string, string>> = plist.parse(expoPlistContents);\n const updatesRequestHeaders = (items[\n IosMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY\n ] ?? {}) as Record<string, string>;\n return updatesRequestHeaders['expo-channel-name'] ?? null;\n } catch (err: any) {\n throw new Error(\n `Failed to parse ${IosMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY} from Expo.plist: ${err.message}`\n );\n }\n}\n\nexport async function iosSetClassicReleaseChannelNativelyAsync(\n ctx: BuildContext<BuildJob>\n): Promise<void> {\n assert(ctx.job.releaseChannel, 'releaseChannel must be defined');\n\n const expoPlistPath = IOSConfig.Paths.getExpoPlistPath(ctx.getReactNativeProjectDirectory());\n\n if (!(await fs.pathExists(expoPlistPath))) {\n throw new Error(`${expoPlistPath} does not exist`);\n }\n\n const expoPlistContents = await fs.readFile(expoPlistPath, 'utf8');\n const items: Record<string, string | Record<string, string>> = plist.parse(expoPlistContents);\n items[IosMetadataName.RELEASE_CHANNEL] = ctx.job.releaseChannel;\n const updatedExpoPlistContents = plist.build(items);\n\n await fs.writeFile(expoPlistPath, updatedExpoPlistContents);\n}\n\nexport async function iosGetNativelyDefinedClassicReleaseChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const expoPlistPath = IOSConfig.Paths.getExpoPlistPath(ctx.getReactNativeProjectDirectory());\n if (!(await fs.pathExists(expoPlistPath))) {\n return null;\n }\n const expoPlistContents = await fs.readFile(expoPlistPath, 'utf8');\n const parsedPlist = plist.parse(expoPlistContents);\n if (!parsedPlist) {\n return null;\n }\n return parsedPlist[IosMetadataName.RELEASE_CHANNEL] ?? null;\n}\n\nexport async function iosGetNativelyDefinedRuntimeVersionAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const expoPlistPath = IOSConfig.Paths.getExpoPlistPath(ctx.getReactNativeProjectDirectory());\n if (!(await fs.pathExists(expoPlistPath))) {\n return null;\n }\n const expoPlistContents = await fs.readFile(expoPlistPath, 'utf8');\n const parsedPlist = plist.parse(expoPlistContents);\n if (!parsedPlist) {\n return null;\n }\n return parsedPlist[IosMetadataName.RUNTIME_VERSION] ?? null;\n}\n"]}
|
|
@@ -4,7 +4,11 @@ exports.getEasFunctionGroups = void 0;
|
|
|
4
4
|
const build_1 = require("./functionGroups/build");
|
|
5
5
|
const maestroTest_1 = require("./functionGroups/maestroTest");
|
|
6
6
|
function getEasFunctionGroups(ctx) {
|
|
7
|
-
|
|
7
|
+
const functionGroups = [(0, maestroTest_1.createEasMaestroTestFunctionGroup)(ctx)];
|
|
8
|
+
if (ctx.hasBuildJob()) {
|
|
9
|
+
functionGroups.push(...[(0, build_1.createEasBuildBuildFunctionGroup)(ctx)]);
|
|
10
|
+
}
|
|
11
|
+
return functionGroups;
|
|
8
12
|
}
|
|
9
13
|
exports.getEasFunctionGroups = getEasFunctionGroups;
|
|
10
14
|
//# sourceMappingURL=easFunctionGroups.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easFunctionGroups.js","sourceRoot":"","sources":["../../src/steps/easFunctionGroups.ts"],"names":[],"mappings":";;;AAIA,kDAA0E;AAC1E,8DAAiF;AAEjF,SAAgB,oBAAoB,CAAC,GAAuB;IAC1D,
|
|
1
|
+
{"version":3,"file":"easFunctionGroups.js","sourceRoot":"","sources":["../../src/steps/easFunctionGroups.ts"],"names":[],"mappings":";;;AAIA,kDAA0E;AAC1E,8DAAiF;AAEjF,SAAgB,oBAAoB,CAAC,GAAuB;IAC1D,MAAM,cAAc,GAAG,CAAC,IAAA,+CAAiC,EAAC,GAAG,CAAC,CAAC,CAAC;IAEhE,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QACtB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,IAAA,wCAAgC,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AARD,oDAQC","sourcesContent":["import { BuildFunctionGroup } from '@expo/steps';\n\nimport { CustomBuildContext } from '../customBuildContext';\n\nimport { createEasBuildBuildFunctionGroup } from './functionGroups/build';\nimport { createEasMaestroTestFunctionGroup } from './functionGroups/maestroTest';\n\nexport function getEasFunctionGroups(ctx: CustomBuildContext): BuildFunctionGroup[] {\n const functionGroups = [createEasMaestroTestFunctionGroup(ctx)];\n\n if (ctx.hasBuildJob()) {\n functionGroups.push(...[createEasBuildBuildFunctionGroup(ctx)]);\n }\n\n return functionGroups;\n}\n"]}
|
|
@@ -25,13 +25,12 @@ const sendSlackMessage_1 = require("./functions/sendSlackMessage");
|
|
|
25
25
|
const resolveBuildConfig_1 = require("./functions/resolveBuildConfig");
|
|
26
26
|
const calculateEASUpdateRuntimeVersion_1 = require("./functions/calculateEASUpdateRuntimeVersion");
|
|
27
27
|
function getEasFunctions(ctx) {
|
|
28
|
-
|
|
28
|
+
const functions = [
|
|
29
29
|
(0, checkout_1.createCheckoutBuildFunction)(),
|
|
30
30
|
(0, uploadArtifact_1.createUploadArtifactBuildFunction)(ctx),
|
|
31
31
|
(0, useNpmToken_1.createSetUpNpmrcBuildFunction)(),
|
|
32
32
|
(0, installNodeModules_1.createInstallNodeModulesBuildFunction)(),
|
|
33
33
|
(0, prebuild_1.createPrebuildBuildFunction)(),
|
|
34
|
-
(0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(ctx),
|
|
35
34
|
(0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)(),
|
|
36
35
|
(0, injectAndroidCredentials_1.injectAndroidCredentialsFunction)(),
|
|
37
36
|
(0, configureAndroidVersion_1.configureAndroidVersionFunction)(),
|
|
@@ -44,12 +43,18 @@ function getEasFunctions(ctx) {
|
|
|
44
43
|
(0, startAndroidEmulator_1.createStartAndroidEmulatorBuildFunction)(),
|
|
45
44
|
(0, startIosSimulator_1.createStartIosSimulatorBuildFunction)(),
|
|
46
45
|
(0, installMaestro_1.createInstallMaestroBuildFunction)(),
|
|
47
|
-
(0, getCredentialsForBuildTriggeredByGitHubIntegration_1.createGetCredentialsForBuildTriggeredByGithubIntegration)(ctx),
|
|
48
46
|
(0, installPods_1.createInstallPodsBuildFunction)(),
|
|
49
47
|
(0, sendSlackMessage_1.createSendSlackMessageFunction)(),
|
|
50
|
-
(0,
|
|
51
|
-
(0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)(),
|
|
48
|
+
(0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)(ctx),
|
|
52
49
|
];
|
|
50
|
+
if (ctx.hasBuildJob()) {
|
|
51
|
+
functions.push(...[
|
|
52
|
+
(0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(ctx),
|
|
53
|
+
(0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(ctx),
|
|
54
|
+
(0, getCredentialsForBuildTriggeredByGitHubIntegration_1.createGetCredentialsForBuildTriggeredByGithubIntegration)(ctx),
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
return functions;
|
|
53
58
|
}
|
|
54
59
|
exports.getEasFunctions = getEasFunctions;
|
|
55
60
|
//# sourceMappingURL=easFunctions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAIA,+DAA+E;AAC/E,mDAAmE;AACnE,yDAAwE;AACxE,uEAAuF;AACvF,mDAAmE;AACnE,yFAAyG;AACzG,6FAAkG;AAClG,mFAAwF;AACxF,iFAAsF;AACtF,qDAA0D;AAC1D,qGAA0G;AAC1G,iFAAsF;AACtF,yEAA8E;AAC9E,yFAA8F;AAC9F,yDAA8D;AAC9D,2EAA2F;AAC3F,qEAAqF;AACrF,+DAA+E;AAC/E,uIAA0I;AAC1I,yDAAyE;AACzE,mEAA8E;AAC9E,uEAAuF;AACvF,mGAAwG;AAExG,SAAgB,eAAe,CAAC,GAAuB;IACrD,
|
|
1
|
+
{"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAIA,+DAA+E;AAC/E,mDAAmE;AACnE,yDAAwE;AACxE,uEAAuF;AACvF,mDAAmE;AACnE,yFAAyG;AACzG,6FAAkG;AAClG,mFAAwF;AACxF,iFAAsF;AACtF,qDAA0D;AAC1D,qGAA0G;AAC1G,iFAAsF;AACtF,yEAA8E;AAC9E,yFAA8F;AAC9F,yDAA8D;AAC9D,2EAA2F;AAC3F,qEAAqF;AACrF,+DAA+E;AAC/E,uIAA0I;AAC1I,yDAAyE;AACzE,mEAA8E;AAC9E,uEAAuF;AACvF,mGAAwG;AAExG,SAAgB,eAAe,CAAC,GAAuB;IACrD,MAAM,SAAS,GAAG;QAChB,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,2CAA6B,GAAE;QAC/B,IAAA,0DAAqC,GAAE;QACvC,IAAA,sCAA2B,GAAE;QAE7B,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;QACrB,IAAA,8DAAuC,GAAE;QACzC,IAAA,wDAAoC,GAAE;QACtC,IAAA,kDAAiC,GAAE;QAEnC,IAAA,4CAA8B,GAAE;QAChC,IAAA,iDAA8B,GAAE;QAEhC,IAAA,2EAAwC,EAAC,GAAG,CAAC;KAC9C,CAAC;IAEF,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QACtB,SAAS,CAAC,IAAI,CACZ,GAAG;YACD,IAAA,4EAA8C,EAAC,GAAG,CAAC;YACnD,IAAA,0DAAqC,EAAC,GAAG,CAAC;YAC1C,IAAA,6GAAwD,EAAC,GAAG,CAAC;SAC9D,CACF,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAtCD,0CAsCC","sourcesContent":["import { BuildFunction } from '@expo/steps';\n\nimport { CustomBuildContext } from '../customBuildContext';\n\nimport { createUploadArtifactBuildFunction } from './functions/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/useNpmToken';\nimport { createInstallNodeModulesBuildFunction } from './functions/installNodeModules';\nimport { createPrebuildBuildFunction } from './functions/prebuild';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/findAndUploadBuildArtifacts';\nimport { configureEASUpdateIfInstalledFunction } from './functions/configureEASUpdateIfInstalled';\nimport { injectAndroidCredentialsFunction } from './functions/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from './functions/configureAndroidVersion';\nimport { runGradleFunction } from './functions/runGradle';\nimport { resolveAppleTeamIdFromCredentialsFunction } from './functions/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from './functions/configureIosCredentials';\nimport { configureIosVersionFunction } from './functions/configureIosVersion';\nimport { generateGymfileFromTemplateFunction } from './functions/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from './functions/runFastlane';\nimport { createStartAndroidEmulatorBuildFunction } from './functions/startAndroidEmulator';\nimport { createStartIosSimulatorBuildFunction } from './functions/startIosSimulator';\nimport { createInstallMaestroBuildFunction } from './functions/installMaestro';\nimport { createGetCredentialsForBuildTriggeredByGithubIntegration } from './functions/getCredentialsForBuildTriggeredByGitHubIntegration';\nimport { createInstallPodsBuildFunction } from './functions/installPods';\nimport { createSendSlackMessageFunction } from './functions/sendSlackMessage';\nimport { createResolveBuildConfigBuildFunction } from './functions/resolveBuildConfig';\nimport { calculateEASUpdateRuntimeVersionFunction } from './functions/calculateEASUpdateRuntimeVersion';\n\nexport function getEasFunctions(ctx: CustomBuildContext): BuildFunction[] {\n const functions = [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(),\n createInstallNodeModulesBuildFunction(),\n createPrebuildBuildFunction(),\n\n configureEASUpdateIfInstalledFunction(),\n injectAndroidCredentialsFunction(),\n configureAndroidVersionFunction(),\n runGradleFunction(),\n resolveAppleTeamIdFromCredentialsFunction(),\n configureIosCredentialsFunction(),\n configureIosVersionFunction(),\n generateGymfileFromTemplateFunction(),\n runFastlaneFunction(),\n createStartAndroidEmulatorBuildFunction(),\n createStartIosSimulatorBuildFunction(),\n createInstallMaestroBuildFunction(),\n\n createInstallPodsBuildFunction(),\n createSendSlackMessageFunction(),\n\n calculateEASUpdateRuntimeVersionFunction(ctx),\n ];\n\n if (ctx.hasBuildJob()) {\n functions.push(\n ...[\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n createResolveBuildConfigBuildFunction(ctx),\n createGetCredentialsForBuildTriggeredByGithubIntegration(ctx),\n ]\n );\n }\n\n return functions;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BuildFunctionGroup } from '@expo/steps';
|
|
2
|
+
import { BuildJob } from '@expo/eas-build-job';
|
|
2
3
|
import { CustomBuildContext } from '../../customBuildContext';
|
|
3
|
-
export declare function createEasBuildBuildFunctionGroup(buildToolsContext: CustomBuildContext): BuildFunctionGroup;
|
|
4
|
+
export declare function createEasBuildBuildFunctionGroup(buildToolsContext: CustomBuildContext<BuildJob>): BuildFunctionGroup;
|
|
@@ -41,7 +41,7 @@ function createEasBuildBuildFunctionGroup(buildToolsContext) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
else {
|
|
44
|
+
else if (buildToolsContext.job.platform === eas_build_job_1.Platform.ANDROID) {
|
|
45
45
|
if (!((_b = buildToolsContext.job.secrets) === null || _b === void 0 ? void 0 : _b.buildCredentials)) {
|
|
46
46
|
return createStepsForAndroidBuildWithoutCredentials({
|
|
47
47
|
globalCtx,
|
|
@@ -55,12 +55,13 @@ function createEasBuildBuildFunctionGroup(buildToolsContext) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
throw new Error('Build function group is not supported in generic jobs.');
|
|
58
59
|
},
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
exports.createEasBuildBuildFunctionGroup = createEasBuildBuildFunctionGroup;
|
|
62
63
|
function createStepsForIosSimulatorBuild({ globalCtx, buildToolsContext, }) {
|
|
63
|
-
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
64
|
+
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, {
|
|
64
65
|
id: 'calculate_eas_update_runtime_version',
|
|
65
66
|
});
|
|
66
67
|
const installPods = (0, installPods_1.createInstallPodsBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
@@ -96,7 +97,7 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }
|
|
|
96
97
|
const resolveAppleTeamIdFromCredentials = (0, resolveAppleTeamIdFromCredentials_1.resolveAppleTeamIdFromCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
97
98
|
id: 'resolve_apple_team_id_from_credentials',
|
|
98
99
|
});
|
|
99
|
-
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
100
|
+
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, {
|
|
100
101
|
id: 'calculate_eas_update_runtime_version',
|
|
101
102
|
});
|
|
102
103
|
const prebuildStep = (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
@@ -142,7 +143,7 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }
|
|
|
142
143
|
];
|
|
143
144
|
}
|
|
144
145
|
function createStepsForAndroidBuildWithoutCredentials({ globalCtx, buildToolsContext, }) {
|
|
145
|
-
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
146
|
+
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, {
|
|
146
147
|
id: 'calculate_eas_update_runtime_version',
|
|
147
148
|
});
|
|
148
149
|
const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
@@ -170,7 +171,7 @@ function createStepsForAndroidBuildWithoutCredentials({ globalCtx, buildToolsCon
|
|
|
170
171
|
];
|
|
171
172
|
}
|
|
172
173
|
function createStepsForAndroidBuildWithCredentials({ globalCtx, buildToolsContext, }) {
|
|
173
|
-
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
174
|
+
const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx, {
|
|
174
175
|
id: 'calculate_eas_update_runtime_version',
|
|
175
176
|
});
|
|
176
177
|
const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/steps/functionGroups/build.ts"],"names":[],"mappings":";;;AAAA,uCAAoF;AACpF,uDAA+C;AAE/C,oDAAoE;AACpE,wEAAwF;AACxF,oDAAoE;AACpE,0DAA0E;AAC1E,8FAAmG;AACnG,0FAA+F;AAC/F,0DAA+D;AAC/D,0FAA0G;AAE1G,sGAA2G;AAC3G,kFAAuF;AACvF,sDAA2D;AAC3D,0EAA+E;AAC/E,oFAAyF;AACzF,kFAAuF;AACvF,0DAAyE;AACzE,wEAAwF;AACxF,oGAAyG;AAOzG,SAAgB,gCAAgC,CAC9C,iBAAqC;IAErC,OAAO,IAAI,0BAAkB,CAAC;QAC5B,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,OAAO;QACX,qCAAqC,EAAE,CAAC,SAAS,EAAE,EAAE;;YACnD,IAAI,iBAAiB,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,EAAE,CAAC;gBACpD,wEAAwE;gBACxE,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,CAAA,MAAA,iBAAiB,CAAC,GAAG,CAAC,OAAO,0CAAE,gBAAgB,CAAA,EAAE,CAAC;oBACxF,OAAO,+BAA+B,CAAC;wBACrC,SAAS;wBACT,iBAAiB;qBAClB,CAAC,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACN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SAAS,CAAC;QAClF,IAAA,0DAAqC,EAAC,iBAAiB,CAAC,CAAC,+BAA+B,CACtF,SAAS,CACV;QACD,IAAA,sCAA2B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QACxE,gCAAgC;QAChC,kBAAkB;QAClB,IAAA,2DAAgC,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC7E,IAAA,yDAA+B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC5E,SAAS;QACT,IAAA,4EAA8C,EAC5C,iBAAiB,CAClB,CAAC,+BAA+B,CAAC,SAAS,CAAC;KAC7C,CAAC;AACJ,CAAC","sourcesContent":["import { BuildFunctionGroup, BuildStep, BuildStepGlobalContext } from '@expo/steps';\nimport { Platform } from '@expo/eas-build-job';\n\nimport { createCheckoutBuildFunction } from '../functions/checkout';\nimport { createInstallNodeModulesBuildFunction } from '../functions/installNodeModules';\nimport { createPrebuildBuildFunction } from '../functions/prebuild';\nimport { createInstallPodsBuildFunction } from '../functions/installPods';\nimport { configureEASUpdateIfInstalledFunction } from '../functions/configureEASUpdateIfInstalled';\nimport { generateGymfileFromTemplateFunction } from '../functions/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from '../functions/runFastlane';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from '../functions/findAndUploadBuildArtifacts';\nimport { CustomBuildContext } from '../../customBuildContext';\nimport { resolveAppleTeamIdFromCredentialsFunction } from '../functions/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from '../functions/configureIosCredentials';\nimport { runGradleFunction } from '../functions/runGradle';\nimport { configureIosVersionFunction } from '../functions/configureIosVersion';\nimport { injectAndroidCredentialsFunction } from '../functions/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from '../functions/configureAndroidVersion';\nimport { createSetUpNpmrcBuildFunction } from '../functions/useNpmToken';\nimport { createResolveBuildConfigBuildFunction } from '../functions/resolveBuildConfig';\nimport { calculateEASUpdateRuntimeVersionFunction } from '../functions/calculateEASUpdateRuntimeVersion';\n\ninterface HelperFunctionsInput {\n globalCtx: BuildStepGlobalContext;\n buildToolsContext: CustomBuildContext;\n}\n\nexport function createEasBuildBuildFunctionGroup(\n buildToolsContext: CustomBuildContext\n): BuildFunctionGroup {\n return new BuildFunctionGroup({\n namespace: 'eas',\n id: 'build',\n createBuildStepsFromFunctionGroupCall: (globalCtx) => {\n if (buildToolsContext.job.platform === Platform.IOS) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n if (buildToolsContext.job.simulator || !buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n } else {\n if (!buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n }\n },\n });\n}\n\nfunction createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runFastlane = runFastlaneFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_fastlane',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n installPods,\n configureEASUpdate,\n generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(globalCtx),\n runFastlane,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const resolveAppleTeamIdFromCredentials =\n resolveAppleTeamIdFromCredentialsFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'resolve_apple_team_id_from_credentials',\n });\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const prebuildStep = createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n apple_team_id: '${ steps.resolve_apple_team_id_from_credentials.apple_team_id }',\n },\n });\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const generateGymfile = generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(\n globalCtx,\n {\n callInputs: {\n credentials: '${ eas.job.secrets.buildCredentials }',\n },\n }\n );\n const runFastlane = runFastlaneFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_fastlane',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n resolveAppleTeamIdFromCredentials,\n prebuildStep,\n calculateEASUpdateRuntimeVersion,\n installPods,\n configureEASUpdate,\n configureIosCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureIosVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n generateGymfile,\n runFastlane,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runGradle = runGradleFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_gradle',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n configureEASUpdate,\n runGradle,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runGradle = runGradleFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_gradle',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n configureEASUpdate,\n injectAndroidCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureAndroidVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n runGradle,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["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B,CAAC,SAAS,CAAC;QAC7E,IAAA,yDAA+B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC5E,SAAS;QACT,IAAA,4EAA8C,EAC5C,iBAAiB,CAClB,CAAC,+BAA+B,CAAC,SAAS,CAAC;KAC7C,CAAC;AACJ,CAAC","sourcesContent":["import { BuildFunctionGroup, BuildStep, BuildStepGlobalContext } from '@expo/steps';\nimport { BuildJob, Platform } from '@expo/eas-build-job';\n\nimport { createCheckoutBuildFunction } from '../functions/checkout';\nimport { createInstallNodeModulesBuildFunction } from '../functions/installNodeModules';\nimport { createPrebuildBuildFunction } from '../functions/prebuild';\nimport { createInstallPodsBuildFunction } from '../functions/installPods';\nimport { configureEASUpdateIfInstalledFunction } from '../functions/configureEASUpdateIfInstalled';\nimport { generateGymfileFromTemplateFunction } from '../functions/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from '../functions/runFastlane';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from '../functions/findAndUploadBuildArtifacts';\nimport { CustomBuildContext } from '../../customBuildContext';\nimport { resolveAppleTeamIdFromCredentialsFunction } from '../functions/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from '../functions/configureIosCredentials';\nimport { runGradleFunction } from '../functions/runGradle';\nimport { configureIosVersionFunction } from '../functions/configureIosVersion';\nimport { injectAndroidCredentialsFunction } from '../functions/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from '../functions/configureAndroidVersion';\nimport { createSetUpNpmrcBuildFunction } from '../functions/useNpmToken';\nimport { createResolveBuildConfigBuildFunction } from '../functions/resolveBuildConfig';\nimport { calculateEASUpdateRuntimeVersionFunction } from '../functions/calculateEASUpdateRuntimeVersion';\n\ninterface HelperFunctionsInput {\n globalCtx: BuildStepGlobalContext;\n buildToolsContext: CustomBuildContext<BuildJob>;\n}\n\nexport function createEasBuildBuildFunctionGroup(\n buildToolsContext: CustomBuildContext<BuildJob>\n): BuildFunctionGroup {\n return new BuildFunctionGroup({\n namespace: 'eas',\n id: 'build',\n createBuildStepsFromFunctionGroupCall: (globalCtx) => {\n if (buildToolsContext.job.platform === Platform.IOS) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n if (buildToolsContext.job.simulator || !buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n } else if (buildToolsContext.job.platform === Platform.ANDROID) {\n if (!buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n }\n\n throw new Error('Build function group is not supported in generic jobs.');\n },\n });\n}\n\nfunction createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion = calculateEASUpdateRuntimeVersionFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runFastlane = runFastlaneFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_fastlane',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n installPods,\n configureEASUpdate,\n generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(globalCtx),\n runFastlane,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const resolveAppleTeamIdFromCredentials =\n resolveAppleTeamIdFromCredentialsFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'resolve_apple_team_id_from_credentials',\n });\n const calculateEASUpdateRuntimeVersion = calculateEASUpdateRuntimeVersionFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const prebuildStep = createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n apple_team_id: '${ steps.resolve_apple_team_id_from_credentials.apple_team_id }',\n },\n });\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const generateGymfile = generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(\n globalCtx,\n {\n callInputs: {\n credentials: '${ eas.job.secrets.buildCredentials }',\n },\n }\n );\n const runFastlane = runFastlaneFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_fastlane',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n resolveAppleTeamIdFromCredentials,\n prebuildStep,\n calculateEASUpdateRuntimeVersion,\n installPods,\n configureEASUpdate,\n configureIosCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureIosVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n generateGymfile,\n runFastlane,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion = calculateEASUpdateRuntimeVersionFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runGradle = runGradleFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_gradle',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n configureEASUpdate,\n runGradle,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion = calculateEASUpdateRuntimeVersionFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runGradle = runGradleFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_gradle',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n configureEASUpdate,\n injectAndroidCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureAndroidVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n runGradle,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n"]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { BuildFunction } from '@expo/steps';
|
|
2
|
-
|
|
2
|
+
import { CustomBuildContext } from '../../customBuildContext';
|
|
3
|
+
export declare function calculateEASUpdateRuntimeVersionFunction(ctx: CustomBuildContext): BuildFunction;
|
|
@@ -4,18 +4,26 @@ exports.calculateEASUpdateRuntimeVersionFunction = void 0;
|
|
|
4
4
|
const steps_1 = require("@expo/steps");
|
|
5
5
|
const expoUpdates_1 = require("../../utils/expoUpdates");
|
|
6
6
|
const appConfig_1 = require("../../utils/appConfig");
|
|
7
|
-
function calculateEASUpdateRuntimeVersionFunction() {
|
|
7
|
+
function calculateEASUpdateRuntimeVersionFunction(ctx) {
|
|
8
8
|
return new steps_1.BuildFunction({
|
|
9
9
|
namespace: 'eas',
|
|
10
10
|
id: 'calculate_eas_update_runtime_version',
|
|
11
11
|
name: 'Calculate EAS Update Runtime Version',
|
|
12
|
+
inputProviders: [
|
|
13
|
+
steps_1.BuildStepInput.createProvider({
|
|
14
|
+
id: 'platform',
|
|
15
|
+
defaultValue: ctx.job.platform,
|
|
16
|
+
required: !ctx.job.platform,
|
|
17
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
12
20
|
outputProviders: [
|
|
13
21
|
steps_1.BuildStepOutput.createProvider({
|
|
14
22
|
id: 'resolved_eas_update_runtime_version',
|
|
15
23
|
required: false,
|
|
16
24
|
}),
|
|
17
25
|
],
|
|
18
|
-
fn: async (stepCtx, { env, outputs }) => {
|
|
26
|
+
fn: async (stepCtx, { env, inputs, outputs }) => {
|
|
19
27
|
var _a;
|
|
20
28
|
const appConfig = (0, appConfig_1.readAppConfig)({
|
|
21
29
|
projectDir: stepCtx.workingDirectory,
|
|
@@ -31,7 +39,7 @@ function calculateEASUpdateRuntimeVersionFunction() {
|
|
|
31
39
|
cwd: stepCtx.workingDirectory,
|
|
32
40
|
logger: stepCtx.logger,
|
|
33
41
|
appConfig,
|
|
34
|
-
platform:
|
|
42
|
+
platform: inputs.platform.value,
|
|
35
43
|
});
|
|
36
44
|
if (resolvedRuntimeVersion) {
|
|
37
45
|
outputs.resolved_eas_update_runtime_version.set(resolvedRuntimeVersion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateEASUpdateRuntimeVersion.js","sourceRoot":"","sources":["../../../src/steps/functions/calculateEASUpdateRuntimeVersion.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"calculateEASUpdateRuntimeVersion.js","sourceRoot":"","sources":["../../../src/steps/functions/calculateEASUpdateRuntimeVersion.ts"],"names":[],"mappings":";;;AACA,uCAKqB;AAErB,yDAA+F;AAC/F,qDAAsD;AAGtD,SAAgB,wCAAwC,CAAC,GAAuB;IAC9E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sCAAsC;QAC1C,IAAI,EAAE,sCAAsC;QAC5C,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,UAAU;gBACd,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ;gBAC9B,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ;gBAC3B,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;SACH;QACD,eAAe,EAAE;YACf,uBAAe,CAAC,cAAc,CAAC;gBAC7B,EAAE,EAAE,qCAAqC;gBACzC,QAAQ,EAAE,KAAK;aAChB,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;;YAC9C,MAAM,SAAS,GAAG,IAAA,yBAAa,EAAC;gBAC9B,UAAU,EAAE,OAAO,CAAC,gBAAgB;gBACpC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAC1B,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;;oBACX,GAAG,CAAC,GAAG,CAAC,GAAG,MAAA,GAAG,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;oBAC1B,OAAO,GAAG,CAAC;gBACb,CAAC,EACD,EAA4B,CAC7B;gBACD,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,UAAU,EAAE,MAAA,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,0CAAE,UAAU;aAC9D,CAAC,CAAC,GAAG,CAAC;YACP,MAAM,sBAAsB,GAAG,MAAM,IAAA,kEAAoD,EAAC;gBACxF,GAAG,EAAE,OAAO,CAAC,gBAAgB;gBAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS;gBACT,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAiB;aAC5C,CAAC,CAAC;YACH,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,OAAO,CAAC,mCAAmC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YAC1E,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA7CD,4FA6CC","sourcesContent":["import { Platform } from '@expo/eas-build-job';\nimport {\n BuildFunction,\n BuildStepInput,\n BuildStepInputValueTypeName,\n BuildStepOutput,\n} from '@expo/steps';\n\nimport { resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync } from '../../utils/expoUpdates';\nimport { readAppConfig } from '../../utils/appConfig';\nimport { CustomBuildContext } from '../../customBuildContext';\n\nexport function calculateEASUpdateRuntimeVersionFunction(ctx: CustomBuildContext): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'calculate_eas_update_runtime_version',\n name: 'Calculate EAS Update Runtime Version',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'platform',\n defaultValue: ctx.job.platform,\n required: !ctx.job.platform,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n ],\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'resolved_eas_update_runtime_version',\n required: false,\n }),\n ],\n fn: async (stepCtx, { env, inputs, outputs }) => {\n const appConfig = readAppConfig({\n projectDir: stepCtx.workingDirectory,\n env: Object.keys(env).reduce(\n (acc, key) => {\n acc[key] = env[key] ?? '';\n return acc;\n },\n {} as Record<string, string>\n ),\n logger: stepCtx.logger,\n sdkVersion: stepCtx.global.staticContext.metadata?.sdkVersion,\n }).exp;\n const resolvedRuntimeVersion = await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd: stepCtx.workingDirectory,\n logger: stepCtx.logger,\n appConfig,\n platform: inputs.platform.value as Platform,\n });\n if (resolvedRuntimeVersion) {\n outputs.resolved_eas_update_runtime_version.set(resolvedRuntimeVersion);\n } else {\n stepCtx.logger.info('Skipped because EAS Update is not configured');\n }\n },\n });\n}\n"]}
|
|
@@ -41,6 +41,7 @@ function configureEASUpdateIfInstalledFunction() {
|
|
|
41
41
|
fn: async (stepCtx, { env, inputs }) => {
|
|
42
42
|
(0, assert_1.default)(stepCtx.global.staticContext.job, 'Job is not defined');
|
|
43
43
|
const job = stepCtx.global.staticContext.job;
|
|
44
|
+
(0, assert_1.default)(job.platform, 'Configuring EAS Update in generic jobs is not supported.');
|
|
44
45
|
const metadata = stepCtx.global.staticContext.metadata;
|
|
45
46
|
const appConfig = (0, appConfig_1.readAppConfig)({
|
|
46
47
|
projectDir: stepCtx.workingDirectory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureEASUpdateIfInstalled.js","sourceRoot":"","sources":["../../../src/steps/functions/configureEASUpdateIfInstalled.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uCAAyF;AAEzF,oDAA4B;AAE5B,sDAA+D;AAC/D,qDAAsD;AACtD,4IAAoH;AAEpH,SAAgB,qCAAqC;IACnD,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE;YACd,s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;AACL,CAAC;
|
|
1
|
+
{"version":3,"file":"configureEASUpdateIfInstalled.js","sourceRoot":"","sources":["../../../src/steps/functions/configureEASUpdateIfInstalled.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uCAAyF;AAEzF,oDAA4B;AAE5B,sDAA+D;AAC/D,qDAAsD;AACtD,4IAAoH;AAEpH,SAAgB,qCAAqC;IACnD,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,iBAAiB;gBACrB,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,SAAS;gBACb,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,yBAAyB;gBAC7B,QAAQ,EAAE,KAAK;gBACf,YAAY,EAAE,IAAI;gBAClB,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;aAC1D,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,qCAAqC;gBACzC,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;YACrC,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,GAAG,CAAC;YAC7C,IAAA,gBAAM,EAAC,G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,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,gFAAgF,CACjF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,MAAM,IAAA,qCAAuB,EAAC;gBAC5B,GAAG;gBACH,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;gBAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS;gBACT,MAAM,EAAE;oBACN,cAAc,EAAE,mBAAmB;oBACnC,OAAO,EAAE,mBAAmB;oBAC5B,sBAAsB,EAAE,2BAA2B;iBACpD;gBACD,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ;aAChD,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAxFD,sFAwFC","sourcesContent":["import assert from 'assert';\n\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { Metadata } from '@expo/eas-build-job';\nimport semver from 'semver';\n\nimport { configureEASUpdateAsync } from '../utils/expoUpdates';\nimport { readAppConfig } from '../../utils/appConfig';\nimport getExpoUpdatesPackageVersionIfInstalledAsync from '../../utils/getExpoUpdatesPackageVersionIfInstalledAsync';\n\nexport function configureEASUpdateIfInstalledFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'configure_eas_update',\n name: 'Configure EAS Update',\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 BuildStepInput.createProvider({\n id: 'throw_if_not_configured',\n required: false,\n defaultValue: true,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n BuildStepInput.createProvider({\n id: 'resolved_eas_update_runtime_version',\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;\n assert(job.platform, 'Configuring EAS Update in generic jobs is not supported.');\n const metadata = stepCtx.global.staticContext.metadata as Metadata | undefined;\n\n const appConfig = readAppConfig({\n projectDir: stepCtx.workingDirectory,\n env: Object.keys(env).reduce(\n (acc, key) => {\n acc[key] = env[key] ?? '';\n return acc;\n },\n {} as Record<string, string>\n ),\n logger: stepCtx.logger,\n sdkVersion: metadata?.sdkVersion,\n }).exp;\n\n const releaseChannelInput = inputs.channel.value as string | undefined;\n const runtimeVersionInput = inputs.runtime_version.value as string | undefined;\n const resolvedRuntimeVersionInput = inputs.resolved_eas_update_runtime_version.value as\n | string\n | undefined;\n const throwIfNotConfigured = inputs.throw_if_not_configured.value as boolean;\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 const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n stepCtx.workingDirectory\n );\n if (expoUpdatesPackageVersion === null) {\n if (throwIfNotConfigured) {\n throw new Error(\n 'Cannot configure EAS Update because the expo-updates package is not installed.'\n );\n }\n stepCtx.logger.warn(\n 'Cannot configure EAS Update because the expo-updates package is not installed.'\n );\n return;\n }\n\n await configureEASUpdateAsync({\n job,\n workingDirectory: stepCtx.workingDirectory,\n logger: stepCtx.logger,\n appConfig,\n inputs: {\n runtimeVersion: runtimeVersionInput,\n channel: releaseChannelInput,\n resolvedRuntimeVersion: resolvedRuntimeVersionInput,\n },\n metadata: stepCtx.global.staticContext.metadata,\n });\n },\n });\n}\n"]}
|