@expo/build-tools 0.1.99 → 0.1.103
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/builders/android.js +4 -0
- package/dist/builders/android.js.map +1 -1
- package/dist/context.d.ts +4 -0
- package/dist/context.js +5 -1
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/ios/fastlane.js +4 -0
- package/dist/ios/fastlane.js.map +1 -1
- package/dist/utils/expoUpdates.js +4 -3
- package/dist/utils/expoUpdates.js.map +1 -1
- package/package.json +2 -2
package/dist/builders/android.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
4
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
|
+
const context_1 = require("../context");
|
|
5
6
|
const expoUpdates_1 = require("../utils/expoUpdates");
|
|
6
7
|
const gradle_1 = require("../android/gradle");
|
|
7
8
|
const project_1 = require("../utils/project");
|
|
@@ -36,6 +37,9 @@ async function androidBuilder(ctx) {
|
|
|
36
37
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {
|
|
37
38
|
await expoUpdates_1.configureExpoUpdatesIfInstalledAsync(ctx);
|
|
38
39
|
});
|
|
40
|
+
if (ctx.skipNativeBuild) {
|
|
41
|
+
throw new context_1.SkipNativeBuildError('Skipping Gradle build');
|
|
42
|
+
}
|
|
39
43
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RUN_GRADLEW, async () => {
|
|
40
44
|
const gradleCommand = resolveGradleCommand(ctx.job);
|
|
41
45
|
await gradle_1.runGradleCommand(ctx, gradleCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":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AAoB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjE,OAAO,cAAc,CAAC;IACxB,CAAC,EACD,EAAE,YAAY,EAAE,IAAI,EAAE,CACvB,CAAC;AACJ,CAAC;AA5DD,iCA4DC;AAED,SAAS,oBAAoB,CAAC,GAAgB;IAC5C,IAAI,GAAG,CAAC,aAAa,EAAE;QACrB,OAAO,GAAG,CAAC,aAAa,CAAC;KAC1B;SAAM,IAAI,GAAG,CAAC,iBAAiB,EAAE;QAChC,OAAO,oBAAoB,CAAC;KAC7B;SAAM,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;QACzB,OAAO,oBAAoB,CAAC;KAC7B;SAAM,IAAI,GAAG,CAAC,SAAS,KAAK,uBAAO,CAAC,SAAS,CAAC,GAAG,EAAE;QAClD,OAAO,sBAAsB,CAAC;KAC/B;SAAM;QACL,OAAO,oBAAoB,CAAC;KAC7B;AACH,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,GAA8B;IACxD,MAAM,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,8BAAa,CAAC,QAAQ,CAAC,sBAAsB,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AACvF,CAAC","sourcesContent":["import { AndroidConfig } from '@expo/config-plugins';\nimport { Android, BuildPhase, Workflow } from '@expo/eas-build-job';\n\nimport { BuildContext, SkipNativeBuildError } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { runGradleCommand, ensureLFLineEndingsInGradlewScript } from '../android/gradle';\nimport { setup } from '../utils/project';\nimport { findBuildArtifacts } from '../utils/buildArtifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { restoreCredentials } from '../android/credentials';\n\nexport default async function androidBuilder(ctx: BuildContext<Android.Job>): Promise<string[]> {\n await setup(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 } else {\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n await ejectProject(ctx);\n });\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 });\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 return await ctx.runBuildPhase(\n BuildPhase.UPLOAD_ARTIFACTS,\n async () => {\n const buildArtifacts = await findBuildArtifacts(\n ctx.reactNativeProjectDirectory,\n ctx.job.artifactPath ?? 'android/app/build/outputs/**/*.{apk,aab}',\n ctx.logger\n );\n ctx.logger.info(`Build artifacts: ${buildArtifacts.join(', ')}`);\n return buildArtifacts;\n },\n { doNotMarkEnd: true }\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\nasync function ejectProject(ctx: BuildContext<Android.Job>): Promise<void> {\n await ctx.ejectProvider.runEject(ctx);\n await AndroidConfig.EasBuild.configureEasBuildAsync(ctx.reactNativeProjectDirectory);\n}\n"]}
|
package/dist/context.d.ts
CHANGED
|
@@ -18,8 +18,11 @@ export interface BuildContextOptions<TJob extends Job> {
|
|
|
18
18
|
env: Env;
|
|
19
19
|
cacheManager?: CacheManager;
|
|
20
20
|
ejectProvider?: EjectProvider<TJob>;
|
|
21
|
+
skipNativeBuild?: boolean;
|
|
21
22
|
metadata?: Metadata;
|
|
22
23
|
}
|
|
24
|
+
export declare class SkipNativeBuildError extends Error {
|
|
25
|
+
}
|
|
23
26
|
export declare class BuildContext<TJob extends Job> {
|
|
24
27
|
readonly job: TJob;
|
|
25
28
|
readonly workingdir: string;
|
|
@@ -29,6 +32,7 @@ export declare class BuildContext<TJob extends Job> {
|
|
|
29
32
|
readonly cacheManager?: CacheManager;
|
|
30
33
|
readonly ejectProvider: EjectProvider<TJob>;
|
|
31
34
|
readonly metadata?: Metadata;
|
|
35
|
+
readonly skipNativeBuild?: boolean;
|
|
32
36
|
private readonly defaultLogger;
|
|
33
37
|
private buildPhase?;
|
|
34
38
|
private _appConfig?;
|
package/dist/context.js
CHANGED
|
@@ -3,13 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BuildContext = void 0;
|
|
6
|
+
exports.BuildContext = exports.SkipNativeBuildError = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
9
|
const packageManager_1 = require("./utils/packageManager");
|
|
10
10
|
const detectUserError_1 = require("./utils/detectUserError");
|
|
11
11
|
const NpxExpoCliEject_1 = require("./managed/NpxExpoCliEject");
|
|
12
12
|
const appConfig_1 = require("./utils/appConfig");
|
|
13
|
+
class SkipNativeBuildError extends Error {
|
|
14
|
+
}
|
|
15
|
+
exports.SkipNativeBuildError = SkipNativeBuildError;
|
|
13
16
|
class BuildContext {
|
|
14
17
|
constructor(job, options) {
|
|
15
18
|
var _a, _b, _c;
|
|
@@ -21,6 +24,7 @@ class BuildContext {
|
|
|
21
24
|
this.cacheManager = options.cacheManager;
|
|
22
25
|
this.ejectProvider = (_a = options.ejectProvider) !== null && _a !== void 0 ? _a : new NpxExpoCliEject_1.NpxExpoCliEjectProvider();
|
|
23
26
|
this.metadata = options.metadata;
|
|
27
|
+
this.skipNativeBuild = options.skipNativeBuild;
|
|
24
28
|
this.env = Object.assign(Object.assign(Object.assign({}, options.env), (_b = job === null || job === void 0 ? void 0 : job.builderEnvironment) === null || _b === void 0 ? void 0 : _b.env), (_c = job === null || job === void 0 ? void 0 : job.secrets) === null || _c === void 0 ? void 0 : _c.environmentSecrets);
|
|
25
29
|
}
|
|
26
30
|
get buildDirectory() {
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAwF;AAIxF,2DAA+E;AAC/E,6DAA0D;AAE1D,+DAAoE;AACpE,iDAAkD;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAwF;AAIxF,2DAA+E;AAC/E,6DAA0D;AAE1D,+DAAoE;AACpE,iDAAkD;AAuBlD,MAAa,oBAAqB,SAAQ,KAAK;CAAG;AAAlD,oDAAkD;AAElD,MAAa,YAAY;IAcvB,YAA4B,GAAS,EAAE,OAAkC;;QAA7C,QAAG,GAAH,GAAG,CAA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';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\n\nimport { PackageManager, resolvePackageManager } from './utils/packageManager';\nimport { detectUserError } from './utils/detectUserError';\nimport { EjectProvider } from './managed/EjectProvider';\nimport { NpxExpoCliEjectProvider } from './managed/NpxExpoCliEject';\nimport { readAppConfig } from './utils/appConfig';\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 interface BuildContextOptions<TJob extends Job> {\n workingdir: string;\n logger: bunyan;\n logBuffer: LogBuffer;\n env: Env;\n cacheManager?: CacheManager;\n ejectProvider?: EjectProvider<TJob>;\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 env: Env;\n public readonly cacheManager?: CacheManager;\n public readonly ejectProvider: EjectProvider<TJob>;\n public readonly metadata?: Metadata;\n public readonly skipNativeBuild?: boolean;\n\n private readonly defaultLogger: bunyan;\n private buildPhase?: BuildPhase;\n private _appConfig?: ExpoConfig;\n\n constructor(public readonly job: TJob, options: BuildContextOptions<TJob>) {\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.ejectProvider = options.ejectProvider ?? new NpxExpoCliEjectProvider();\n this.metadata = options.metadata;\n this.skipNativeBuild = options.skipNativeBuild;\n this.env = {\n ...options.env,\n ...job?.builderEnvironment?.env,\n ...job?.secrets?.environmentSecrets,\n };\n }\n\n public get buildDirectory(): string {\n return path.join(this.workingdir, 'build');\n }\n public get reactNativeProjectDirectory(): string {\n return path.join(this.buildDirectory, this.job.projectRootDirectory);\n }\n public get packageManager(): PackageManager {\n return resolvePackageManager(this.reactNativeProjectDirectory);\n }\n public get appConfig(): ExpoConfig {\n if (!this._appConfig) {\n this._appConfig = readAppConfig(this.reactNativeProjectDirectory, this.env, this.logger).exp;\n }\n return this._appConfig;\n }\n\n public async runBuildPhase<T>(\n buildPhase: BuildPhase,\n phase: () => Promise<T>,\n { doNotMarkStart = false, doNotMarkEnd = false } = {}\n ): Promise<T> {\n try {\n this.setBuildPhase(buildPhase, { doNotMarkStart });\n const result = await phase();\n this.endCurrentBuildPhase({ result: 'success', doNotMarkEnd });\n return result;\n } catch (err: any) {\n let userError: errors.UserError | undefined;\n if (err instanceof errors.UserError) {\n userError = err;\n } else {\n const detectedError = detectUserError(this.logBuffer.getPhaseLogs(buildPhase), {\n job: this.job,\n phase: buildPhase,\n });\n if (detectedError) {\n detectedError.innerError = err;\n userError = detectedError;\n }\n }\n if (userError) {\n this.logger.error(`Error: ${userError.message}`);\n } else {\n // leaving message empty, website will display err.stack which already includes err.message\n this.logger.error({ err }, '');\n }\n this.endCurrentBuildPhase({ result: 'failed' });\n throw userError ?? err;\n }\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: '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 endCurrentBuildPhase({\n result,\n doNotMarkEnd = false,\n }: {\n result: 'success' | 'failed';\n doNotMarkEnd?: boolean;\n }): void {\n if (!this.buildPhase) {\n return;\n }\n if (!doNotMarkEnd) {\n this.logger.info({ marker: LogMarker.END_PHASE, result }, `End phase: ${this.buildPhase}`);\n }\n this.logger = this.defaultLogger;\n this.buildPhase = undefined;\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as Builders from './builders';
|
|
2
2
|
export { Builders };
|
|
3
|
-
export { BuildContext, CacheManager, LogBuffer } from './context';
|
|
3
|
+
export { BuildContext, CacheManager, LogBuffer, SkipNativeBuildError } from './context';
|
|
4
4
|
export { EjectProvider, EjectOptions } from './managed/EjectProvider';
|
package/dist/index.js
CHANGED
|
@@ -19,9 +19,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.BuildContext = exports.Builders = void 0;
|
|
22
|
+
exports.SkipNativeBuildError = exports.BuildContext = exports.Builders = void 0;
|
|
23
23
|
const Builders = __importStar(require("./builders"));
|
|
24
24
|
exports.Builders = Builders;
|
|
25
25
|
var context_1 = require("./context");
|
|
26
26
|
Object.defineProperty(exports, "BuildContext", { enumerable: true, get: function () { return context_1.BuildContext; } });
|
|
27
|
+
Object.defineProperty(exports, "SkipNativeBuildError", { enumerable: true, get: function () { return context_1.SkipNativeBuildError; } });
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAE9B,4BAAQ;AAEjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAE9B,4BAAQ;AAEjB,qCAAwF;AAA/E,uGAAA,YAAY,OAAA;AAA2B,+GAAA,oBAAoB,OAAA","sourcesContent":["import * as Builders from './builders';\n\nexport { Builders };\n\nexport { BuildContext, CacheManager, LogBuffer, SkipNativeBuildError } from './context';\nexport { EjectProvider, EjectOptions } from './managed/EjectProvider';\n"]}
|
package/dist/ios/fastlane.js
CHANGED
|
@@ -8,6 +8,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const fastlane_1 = __importDefault(require("@expo/fastlane"));
|
|
9
9
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
10
|
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
11
|
+
const context_1 = require("../context");
|
|
11
12
|
const gymfile_1 = require("./gymfile");
|
|
12
13
|
const xcpretty_1 = require("./xcpretty");
|
|
13
14
|
async function runFastlaneGym(ctx, { scheme, buildConfiguration, credentials, entitlements, }) {
|
|
@@ -19,6 +20,9 @@ async function runFastlaneGym(ctx, { scheme, buildConfiguration, credentials, en
|
|
|
19
20
|
logsDirectory,
|
|
20
21
|
entitlements,
|
|
21
22
|
});
|
|
23
|
+
if (ctx.skipNativeBuild) {
|
|
24
|
+
throw new context_1.SkipNativeBuildError('Skipping fastlane build');
|
|
25
|
+
}
|
|
22
26
|
const buildLogger = new xcpretty_1.XcodeBuildLogger(ctx.logger, ctx.reactNativeProjectDirectory);
|
|
23
27
|
void buildLogger.watchLogFiles(logsDirectory);
|
|
24
28
|
try {
|
package/dist/ios/fastlane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastlane.js","sourceRoot":"","sources":["../../src/ios/fastlane.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,8DAAsC;AACtC,wDAA0B;AAC1B,4DAAoC;
|
|
1
|
+
{"version":3,"file":"fastlane.js","sourceRoot":"","sources":["../../src/ios/fastlane.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,8DAAsC;AACtC,wDAA0B;AAC1B,4DAAoC;AAEpC,wCAAgE;AAEhE,uCAAyF;AAEzF,yCAA8C;AAEvC,KAAK,UAAU,cAAc,CAClC,GAAuB,EACvB,EACE,MAAM,EACN,kBAAkB,EAClB,WAAW,EACX,YAAY,G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B,MAAM,wCAA8B,CAAC;YACnC,UAAU,EAAE,WAAW;YACvB,MAAM;YACN,kBAAkB,EAAE,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,SAAS;YACnD,eAAe,EAAE,SAAS;YAC1B,KAAK,EAAE,KAAK;YACZ,aAAa;SACd,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,sCAA4B,CAAC;YACjC,UAAU,EAAE,WAAW;YACvB,WAAW,EAAE,oBAAU,CAAC,WAAW,EAAE,iDAAiD,CAAC;YACvF,MAAM;YACN,kBAAkB;YAClB,eAAe,EAAE,SAAS;YAC1B,KAAK,EAAE,KAAK;YACZ,aAAa;YACb,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,SAAS;SACxC,CAAC,CAAC;KACJ;IACD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport fastlane from '@expo/fastlane';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { BuildContext, SkipNativeBuildError } from '../context';\n\nimport { createGymfileForArchiveBuild, createGymfileForSimulatorBuild } from './gymfile';\nimport { Credentials } from './credentials/manager';\nimport { XcodeBuildLogger } from './xcpretty';\n\nexport async function runFastlaneGym<TJob extends Ios.Job>(\n ctx: BuildContext<TJob>,\n {\n scheme,\n buildConfiguration,\n credentials,\n entitlements,\n }: {\n scheme: string;\n buildConfiguration?: string;\n credentials: Credentials | null;\n entitlements: object | null;\n }\n): Promise<void> {\n const logsDirectory = path.join(ctx.workingdir, 'logs');\n await ensureGymfileExists(ctx, {\n scheme,\n buildConfiguration,\n credentials,\n logsDirectory,\n entitlements,\n });\n if (ctx.skipNativeBuild) {\n throw new SkipNativeBuildError('Skipping fastlane build');\n }\n const buildLogger = new XcodeBuildLogger(ctx.logger, ctx.reactNativeProjectDirectory);\n void buildLogger.watchLogFiles(logsDirectory);\n try {\n await fastlane(['gym'], {\n cwd: path.join(ctx.reactNativeProjectDirectory, 'ios'),\n logger: ctx.logger,\n envs: ctx.env,\n });\n } finally {\n await buildLogger.flush();\n }\n}\n\nasync function ensureGymfileExists<TJob extends Ios.Job>(\n ctx: BuildContext<TJob>,\n {\n scheme,\n buildConfiguration,\n credentials,\n logsDirectory,\n entitlements,\n }: {\n scheme: string;\n buildConfiguration?: string;\n credentials: Credentials | null;\n logsDirectory: string;\n entitlements: object | null;\n }\n): Promise<void> {\n const gymfilePath = path.join(ctx.reactNativeProjectDirectory, 'ios/Gymfile');\n\n if (await fs.pathExists(gymfilePath)) {\n ctx.logger.info('Gymfile already exists');\n return;\n }\n\n ctx.logger.info('Creating Gymfile');\n if (ctx.job.simulator) {\n await createGymfileForSimulatorBuild({\n outputFile: gymfilePath,\n scheme,\n buildConfiguration: buildConfiguration ?? 'release',\n derivedDataPath: './build',\n clean: false,\n logsDirectory,\n });\n } else {\n await createGymfileForArchiveBuild({\n outputFile: gymfilePath,\n credentials: nullthrows(credentials, 'credentials must exist for non-simulator builds'),\n scheme,\n buildConfiguration,\n outputDirectory: './build',\n clean: false,\n logsDirectory,\n entitlements: entitlements ?? undefined,\n });\n }\n ctx.logger.info('Gymfile created');\n}\n"]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getRuntimeVersionAsync = exports.configureExpoUpdatesIfInstalledAsync = exports.configureEASExpoUpdatesAsync = exports.configureClassicExpoUpdatesAsync = exports.getNativelyDefinedClassicReleaseChannelAsync = exports.setClassicReleaseChannelNativelyAsync = exports.setChannelNativelyAsync = void 0;
|
|
7
7
|
const assert_1 = __importDefault(require("assert"));
|
|
8
8
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
|
+
const Updates_1 = require("@expo/config-plugins/build/utils/Updates");
|
|
9
10
|
const expoUpdates_1 = require("../android/expoUpdates");
|
|
10
11
|
const expoUpdates_2 = require("../ios/expoUpdates");
|
|
11
12
|
const isExpoUpdatesInstalled_1 = __importDefault(require("./isExpoUpdatesInstalled"));
|
|
@@ -107,9 +108,9 @@ const configureExpoUpdatesIfInstalledAsync = async (ctx) => {
|
|
|
107
108
|
if (!(await isExpoUpdatesInstalled_1.default(ctx.reactNativeProjectDirectory))) {
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ctx.logger.warn(`Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${
|
|
111
|
+
const appConfigRuntimeVersion = Updates_1.getRuntimeVersionNullable(ctx.appConfig, ctx.job.platform);
|
|
112
|
+
if (((_a = ctx.metadata) === null || _a === void 0 ? void 0 : _a.runtimeVersion) && ((_b = ctx.metadata) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== appConfigRuntimeVersion) {
|
|
113
|
+
ctx.logger.warn(`Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${appConfigRuntimeVersion}).`);
|
|
113
114
|
ctx.logger.warn("If you're using conditional app configs, e.g. depending on an environment variable, make sure to set the variable in eas.json or configure it with EAS Secret.");
|
|
114
115
|
}
|
|
115
116
|
if ((_c = ctx.job.updates) === null || _c === void 0 ? void 0 : _c.channel) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAoD;
|
|
1
|
+
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAoD;AACpD,sEAAqF;AAErF,wDAKgC;AAChC,oDAK4B;AAG5B,sFAAmE;AAEnE;;;;GAIG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAAE,GAAsB,EAAiB,EAAE;;IACrF,gBAAM,CAAC,MAA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,wBAAQ,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,MAAM,sDAAwC,CAAC,GAAG,CAAC,CAAC;SAC5D;QACD;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;KACjD;AACH,CAAC,CAAC;AAXW,QAAA,sBAAsB,0BAWjC","sourcesContent":["import assert from 'assert';\n\nimport { Platform, Job } from '@expo/eas-build-job';\nimport { getRuntimeVersionNullable } from '@expo/config-plugins/build/utils/Updates';\n\nimport {\n androidSetChannelNativelyAsync,\n androidSetClassicReleaseChannelNativelyAsync,\n androidGetNativelyDefinedClassicReleaseChannelAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetChannelNativelyAsync,\n iosSetClassicReleaseChannelNativelyAsync,\n iosGetNativelyDefinedClassicReleaseChannelAsync,\n iosGetNativelyDefinedRuntimeVersionAsync,\n} from '../ios/expoUpdates';\nimport { BuildContext } from '../context';\n\nimport isExpoUpdatesInstalledAsync from './isExpoUpdatesInstalled';\n\n/**\n * Used for when Expo Updates is pointed at an EAS server.\n * @param ctx\n * @param platform\n */\nexport const setChannelNativelyAsync = async (ctx: BuildContext<Job>): Promise<void> => {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n const newUpdateRequestHeaders: Record<string, string> = {\n 'expo-channel-name': ctx.job.updates.channel,\n };\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(\n `Setting the update response headers in '${configFile}' to '${JSON.stringify(\n newUpdateRequestHeaders\n )}'`\n );\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n\n/**\n * Used for classic Expo Updates\n * @param ctx\n * @param platform\n */\nexport const setClassicReleaseChannelNativelyAsync = async (\n ctx: BuildContext<Job>\n): Promise<void> => {\n assert(ctx.job.releaseChannel, 'releaseChannel must be defined');\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`Setting the release channel in '${configFile}' to '${ctx.job.releaseChannel}'`);\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n\n/**\n * Used for classic Expo Updates\n * @param ctx\n * @param platform\n */\nexport const getNativelyDefinedClassicReleaseChannelAsync = async (\n ctx: BuildContext<Job>\n): Promise<string | null> => {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return androidGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n case Platform.IOS: {\n return iosGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n\nexport const configureClassicExpoUpdatesAsync = async (ctx: BuildContext<Job>): Promise<void> => {\n if (ctx.job.releaseChannel) {\n await setClassicReleaseChannelNativelyAsync(ctx);\n } else {\n /**\n * If releaseChannel is not defined:\n * 1. Try to infer it from the native value.\n * 2. If it is not set, fallback to 'default'.\n */\n const releaseChannel = await getNativelyDefinedClassicReleaseChannelAsync(ctx);\n if (releaseChannel) {\n ctx.logger.info(\n `Using the release channel pre-configured in native project (${releaseChannel})`\n );\n ctx.logger.warn('Please add the \"releaseChannel\" field to your build profile (eas.json)');\n } else {\n ctx.logger.info(`Using default release channel for 'expo-updates' (default)`);\n }\n }\n};\n\nexport const configureEASExpoUpdatesAsync = async (ctx: BuildContext<Job>): Promise<void> => {\n await setChannelNativelyAsync(ctx);\n};\n\nexport const configureExpoUpdatesIfInstalledAsync = async (\n ctx: BuildContext<Job>\n): Promise<void> => {\n if (!(await isExpoUpdatesInstalledAsync(ctx.reactNativeProjectDirectory))) {\n return;\n }\n\n const appConfigRuntimeVersion = getRuntimeVersionNullable(ctx.appConfig, ctx.job.platform);\n if (ctx.metadata?.runtimeVersion && ctx.metadata?.runtimeVersion !== appConfigRuntimeVersion) {\n ctx.logger.warn(\n `Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${appConfigRuntimeVersion}).`\n );\n ctx.logger.warn(\n \"If you're using conditional app configs, e.g. depending on an environment variable, make sure to set the variable in eas.json or configure it with EAS Secret.\"\n );\n }\n\n if (ctx.job.updates?.channel) {\n await configureEASExpoUpdatesAsync(ctx);\n } else {\n await configureClassicExpoUpdatesAsync(ctx);\n }\n};\n\nexport const getRuntimeVersionAsync = async (ctx: BuildContext<Job>): Promise<string | null> => {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.103",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@expo/config": "6.0.11",
|
|
23
23
|
"@expo/config-plugins": "4.0.11",
|
|
24
24
|
"@expo/downloader": "0.0.16",
|
|
25
|
-
"@expo/eas-build-job": "0.2.
|
|
25
|
+
"@expo/eas-build-job": "0.2.62",
|
|
26
26
|
"@expo/fastlane": "0.0.26",
|
|
27
27
|
"@expo/logger": "0.0.21",
|
|
28
28
|
"@expo/package-manager": "^0.0.47",
|