@expo/build-tools 1.0.18 → 1.0.20
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/gradle.d.ts +8 -1
- package/dist/android/gradle.js +24 -6
- package/dist/android/gradle.js.map +1 -1
- package/dist/builders/android.js +11 -20
- package/dist/builders/android.js.map +1 -1
- package/dist/builders/ios.js +5 -1
- package/dist/builders/ios.js.map +1 -1
- package/dist/common/installDependencies.d.ts +6 -1
- package/dist/common/installDependencies.js +13 -12
- package/dist/common/installDependencies.js.map +1 -1
- package/dist/common/prebuild.d.ts +9 -1
- package/dist/common/prebuild.js +12 -6
- package/dist/common/prebuild.js.map +1 -1
- package/dist/common/setup.js +4 -1
- package/dist/common/setup.js.map +1 -1
- package/dist/context.d.ts +1 -0
- package/dist/ios/fastlane.d.ts +1 -0
- package/dist/ios/xcpretty.d.ts +1 -0
- package/dist/steps/easFunctions.js +6 -0
- package/dist/steps/easFunctions.js.map +1 -1
- package/dist/steps/functions/buildReactNativeApp.d.ts +4 -0
- package/dist/steps/functions/buildReactNativeApp.js +37 -0
- package/dist/steps/functions/buildReactNativeApp.js.map +1 -0
- package/dist/steps/functions/installNodeModules.js +4 -1
- package/dist/steps/functions/installNodeModules.js.map +1 -1
- package/dist/steps/functions/prebuild.d.ts +4 -0
- package/dist/steps/functions/prebuild.js +44 -0
- package/dist/steps/functions/prebuild.js.map +1 -0
- package/dist/steps/functions/runGradle.d.ts +4 -0
- package/dist/steps/functions/runGradle.js +35 -0
- package/dist/steps/functions/runGradle.js.map +1 -0
- package/dist/steps/functions/uploadArtifact.js +2 -2
- package/dist/steps/functions/uploadArtifact.js.map +1 -1
- package/dist/utils/appConfig.d.ts +1 -0
- package/dist/utils/artifacts.d.ts +1 -0
- package/dist/utils/npmrc.d.ts +1 -0
- package/package.json +5 -5
package/dist/android/gradle.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/// <reference types="bunyan" />
|
|
1
2
|
import { Android, Job } from '@expo/eas-build-job';
|
|
3
|
+
import { bunyan } from '@expo/logger';
|
|
2
4
|
import { BuildContext } from '../context';
|
|
3
5
|
export declare function ensureLFLineEndingsInGradlewScript<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void>;
|
|
4
|
-
export declare function runGradleCommand(ctx: BuildContext<Android.Job>, gradleCommand
|
|
6
|
+
export declare function runGradleCommand(ctx: BuildContext<Android.Job>, { logger, gradleCommand, androidDir, }: {
|
|
7
|
+
logger: bunyan;
|
|
8
|
+
gradleCommand: string;
|
|
9
|
+
androidDir: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare function resolveGradleCommand(job: Android.Job): string;
|
package/dist/android/gradle.js
CHANGED
|
@@ -3,10 +3,11 @@ 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.runGradleCommand = exports.ensureLFLineEndingsInGradlewScript = void 0;
|
|
6
|
+
exports.resolveGradleCommand = exports.runGradleCommand = exports.ensureLFLineEndingsInGradlewScript = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const assert_1 = __importDefault(require("assert"));
|
|
9
9
|
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
10
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
10
11
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
12
|
const processes_1 = require("../utils/processes");
|
|
12
13
|
async function ensureLFLineEndingsInGradlewScript(ctx) {
|
|
@@ -18,12 +19,11 @@ async function ensureLFLineEndingsInGradlewScript(ctx) {
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
exports.ensureLFLineEndingsInGradlewScript = ensureLFLineEndingsInGradlewScript;
|
|
21
|
-
async function runGradleCommand(ctx, gradleCommand) {
|
|
22
|
-
|
|
23
|
-
ctx.logger.info(`Running 'gradlew ${gradleCommand}' in ${androidDir}`);
|
|
22
|
+
async function runGradleCommand(ctx, { logger, gradleCommand, androidDir, }) {
|
|
23
|
+
logger.info(`Running 'gradlew ${gradleCommand}' in ${androidDir}`);
|
|
24
24
|
const spawnPromise = (0, turtle_spawn_1.default)('bash', ['-c', `sh gradlew ${gradleCommand}`], {
|
|
25
25
|
cwd: androidDir,
|
|
26
|
-
logger
|
|
26
|
+
logger,
|
|
27
27
|
lineTransformer: (line) => {
|
|
28
28
|
if (!line || /^\.+$/.exec(line)) {
|
|
29
29
|
return null;
|
|
@@ -35,7 +35,7 @@ async function runGradleCommand(ctx, gradleCommand) {
|
|
|
35
35
|
env: { ...ctx.env, ...resolveVersionOverridesEnvs(ctx) },
|
|
36
36
|
});
|
|
37
37
|
if (ctx.env.EAS_BUILD_RUNNER === 'eas-build' && process.platform === 'linux') {
|
|
38
|
-
adjustOOMScore(spawnPromise,
|
|
38
|
+
adjustOOMScore(spawnPromise, logger);
|
|
39
39
|
}
|
|
40
40
|
await spawnPromise;
|
|
41
41
|
}
|
|
@@ -80,4 +80,22 @@ function resolveVersionOverridesEnvs(ctx) {
|
|
|
80
80
|
}
|
|
81
81
|
return extraEnvs;
|
|
82
82
|
}
|
|
83
|
+
function resolveGradleCommand(job) {
|
|
84
|
+
if (job.gradleCommand) {
|
|
85
|
+
return job.gradleCommand;
|
|
86
|
+
}
|
|
87
|
+
else if (job.developmentClient) {
|
|
88
|
+
return ':app:assembleDebug';
|
|
89
|
+
}
|
|
90
|
+
else if (!job.buildType) {
|
|
91
|
+
return ':app:bundleRelease';
|
|
92
|
+
}
|
|
93
|
+
else if (job.buildType === eas_build_job_1.Android.BuildType.APK) {
|
|
94
|
+
return ':app:assembleRelease';
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
return ':app:bundleRelease';
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.resolveGradleCommand = resolveGradleCommand;
|
|
83
101
|
//# sourceMappingURL=gradle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradle.js","sourceRoot":"","sources":["../../src/android/gradle.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oDAA4B;AAE5B,sEAAsE;
|
|
1
|
+
{"version":3,"file":"gradle.js","sourceRoot":"","sources":["../../src/android/gradle.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oDAA4B;AAE5B,sEAAsE;AACtE,uDAAwD;AACxD,wDAA0B;AAI1B,kDAA4E;AAErE,KAAK,UAAU,kCAAkC,CACtD,GAAuB;IAEvB,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1F,MAAM,cAAc,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9D,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACjC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACzE,MAAM,kBAAE,CAAC,SAAS,CAAC,WAAW,EAAE,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;KAChF;AACH,CAAC;AATD,gFASC;AAEM,KAAK,UAAU,gBAAgB,CACpC,GAA8B,EAC9B,EACE,MAAM,EACN,aAAa,EACb,UAAU,GACoD;IAEhE,MAAM,CAAC,IAAI,CAAC,oBAAoB,aAAa,QAAQ,UAAU,EAAE,CAAC,CAAC;IACnE,MAAM,YAAY,GAAG,IAAA,sBAAK,EAAC,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,aAAa,EAAE,CAAC,EAAE;QACxE,GAAG,EAAE,UAAU;QACf,MAAM;QACN,eAAe,EAAE,CAAC,IAAa,EAAE,EAAE;YACjC,IAAI,CAAC,IAAI,I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ACJ,CAAC;AAED,8EAA8E;AAC9E,gDAAgD;AAChD,SAAS,2BAA2B,CAAC,GAA8B;;IACjE,MAAM,SAAS,GAAQ,EAAE,CAAC;IAC1B,IAAI,CAAA,MAAA,GAAG,CAAC,GAAG,CAAC,OAAO,0CAAE,WAAW,KAAI,CAAC,GAAG,CAAC,GAAG,CAAC,8BAA8B,EAAE;QAC3E,SAAS,CAAC,8BAA8B,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC;KACxE;IACD,IAAI,CAAA,MAAA,GAAG,CAAC,GAAG,CAAC,OAAO,0CAAE,WAAW,KAAI,CAAC,GAAG,CAAC,GAAG,CAAC,8BAA8B,EAAE;QAC3E,SAAS,CAAC,8BAA8B,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC;KACxE;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,oBAAoB,CAAC,GAAgB;IACnD,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;AAZD,oDAYC","sourcesContent":["import path from 'path';\nimport assert from 'assert';\n\nimport spawn, { SpawnPromise, SpawnResult } from '@expo/turtle-spawn';\nimport { Android, Env, Job } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport { bunyan } from '@expo/logger';\n\nimport { BuildContext } from '../context';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nexport async function ensureLFLineEndingsInGradlewScript<TJob extends Job>(\n ctx: BuildContext<TJob>\n): Promise<void> {\n const gradlewPath = path.join(ctx.getReactNativeProjectDirectory(), 'android', 'gradlew');\n const gradlewContent = await fs.readFile(gradlewPath, 'utf8');\n if (gradlewContent.includes('\\r')) {\n ctx.logger.info('Replacing CRLF line endings with LF in gradlew script');\n await fs.writeFile(gradlewPath, gradlewContent.replace(/\\r\\n/g, '\\n'), 'utf8');\n }\n}\n\nexport async function runGradleCommand(\n ctx: BuildContext<Android.Job>,\n {\n logger,\n gradleCommand,\n androidDir,\n }: { logger: bunyan; gradleCommand: string; androidDir: string }\n): Promise<void> {\n logger.info(`Running 'gradlew ${gradleCommand}' in ${androidDir}`);\n const spawnPromise = spawn('bash', ['-c', `sh gradlew ${gradleCommand}`], {\n cwd: androidDir,\n logger,\n lineTransformer: (line?: string) => {\n if (!line || /^\\.+$/.exec(line)) {\n return null;\n } else {\n return line;\n }\n },\n env: { ...ctx.env, ...resolveVersionOverridesEnvs(ctx) },\n });\n if (ctx.env.EAS_BUILD_RUNNER === 'eas-build' && process.platform === 'linux') {\n adjustOOMScore(spawnPromise, logger);\n }\n\n await spawnPromise;\n}\n\n/**\n * OOM Killer sometimes kills worker server while build is exceeding memory limits.\n * `oom_score_adj` is a value between -1000 and 1000 and it defaults to 0.\n * It defines which process is more likely to get killed (higher value more likely).\n *\n * This function sets oom_score_adj for Gradle process and all its child processes.\n */\nfunction adjustOOMScore(spawnPromise: SpawnPromise<SpawnResult>, logger: bunyan): void {\n setTimeout(\n async () => {\n try {\n assert(spawnPromise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(spawnPromise.child.pid);\n await Promise.all(\n pids.map(async (pid: number) => {\n // Value 800 is just a guess here. It's probably higher than most other\n // process. I didn't want to set it any higher, because I'm not sure if OOM Killer\n // can start killing processes when there is still enough memory left.\n const oomScoreOverride = 800;\n await fs.writeFile(`/proc/${pid}/oom_score_adj`, `${oomScoreOverride}\\n`);\n })\n );\n } catch (err: any) {\n logger.debug({ err, stderr: err?.stderr }, 'Failed to override oom_score_adj');\n }\n },\n // Wait 20 seconds to make sure all child processes are started\n 20000\n );\n}\n\n// Version envs should be set at the beginning of the build, but when building\n// from github those values are resolved latter.\nfunction resolveVersionOverridesEnvs(ctx: BuildContext<Android.Job>): Env {\n const extraEnvs: Env = {};\n if (ctx.job.version?.versionCode && !ctx.env.EAS_BUILD_ANDROID_VERSION_CODE) {\n extraEnvs.EAS_BUILD_ANDROID_VERSION_CODE = ctx.job.version.versionCode;\n }\n if (ctx.job.version?.versionName && !ctx.env.EAS_BUILD_ANDROID_VERSION_NAME) {\n extraEnvs.EAS_BUILD_ANDROID_VERSION_NAME = ctx.job.version.versionName;\n }\n return extraEnvs;\n}\n\nexport function resolveGradleCommand(job: Android.Job): string {\n if (job.gradleCommand) {\n return job.gradleCommand;\n } else if (job.developmentClient) {\n return ':app:assembleDebug';\n } else if (!job.buildType) {\n return ':app:bundleRelease';\n } else if (job.buildType === Android.BuildType.APK) {\n return ':app:assembleRelease';\n } else {\n return ':app:bundleRelease';\n }\n}\n"]}
|
package/dist/builders/android.js
CHANGED
|
@@ -3,6 +3,7 @@ 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
|
+
const path_1 = __importDefault(require("path"));
|
|
6
7
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
8
|
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
8
9
|
const context_1 = require("../context");
|
|
@@ -45,7 +46,10 @@ async function buildAsync(ctx) {
|
|
|
45
46
|
ctx.logger.info('Skipped running "expo prebuild" because the "android" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/android-builds/');
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
|
-
await (0, prebuild_1.prebuildAsync)(ctx
|
|
49
|
+
await (0, prebuild_1.prebuildAsync)(ctx, {
|
|
50
|
+
logger: ctx.logger,
|
|
51
|
+
workingDir: ctx.getReactNativeProjectDirectory(),
|
|
52
|
+
});
|
|
49
53
|
});
|
|
50
54
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RESTORE_CACHE, async () => {
|
|
51
55
|
var _a;
|
|
@@ -67,8 +71,12 @@ async function buildAsync(ctx) {
|
|
|
67
71
|
throw new context_1.SkipNativeBuildError('Skipping Gradle build');
|
|
68
72
|
}
|
|
69
73
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RUN_GRADLEW, async () => {
|
|
70
|
-
const gradleCommand = resolveGradleCommand(ctx.job);
|
|
71
|
-
await (0, gradle_1.runGradleCommand)(ctx,
|
|
74
|
+
const gradleCommand = (0, gradle_1.resolveGradleCommand)(ctx.job);
|
|
75
|
+
await (0, gradle_1.runGradleCommand)(ctx, {
|
|
76
|
+
logger: ctx.logger,
|
|
77
|
+
gradleCommand,
|
|
78
|
+
androidDir: path_1.default.join(ctx.getReactNativeProjectDirectory(), 'android'),
|
|
79
|
+
});
|
|
72
80
|
});
|
|
73
81
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {
|
|
74
82
|
await (0, hooks_1.runHookIfPresent)(ctx, hooks_1.Hook.PRE_UPLOAD_ARTIFACTS);
|
|
@@ -84,21 +92,4 @@ async function buildAsync(ctx) {
|
|
|
84
92
|
await ctx.uploadArtifacts(context_1.ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);
|
|
85
93
|
});
|
|
86
94
|
}
|
|
87
|
-
function resolveGradleCommand(job) {
|
|
88
|
-
if (job.gradleCommand) {
|
|
89
|
-
return job.gradleCommand;
|
|
90
|
-
}
|
|
91
|
-
else if (job.developmentClient) {
|
|
92
|
-
return ':app:assembleDebug';
|
|
93
|
-
}
|
|
94
|
-
else if (!job.buildType) {
|
|
95
|
-
return ':app:bundleRelease';
|
|
96
|
-
}
|
|
97
|
-
else if (job.buildType === eas_build_job_1.Android.BuildType.APK) {
|
|
98
|
-
return ':app:assembleRelease';
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return ':app:bundleRelease';
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
95
|
//# sourceMappingURL=android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+E;AAC/E,4DAAoC;AAEpC,wCAAyF;AACzF,sDAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,uDAA+E;AAC/E,4DAAoC;AAEpC,wCAAyF;AACzF,sDAA4E;AAC5E,8CAI2B;AAC3B,kDAAmD;AACnD,0CAAwD;AACxD,wDAA4D;AAC5D,0DAA+D;AAC/D,2CAA6C;AAC7C,iDAAmD;AAEnD,qCAAoD;AACpD,qCAA+C;AAEhC,KAAK,UAAU,cAAc,CAAC,GAA8B;IACzE,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,KAAK,EAAE;QACpC,OAAO,MAAM,IAAA,iCAAwB,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;KACxD;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,MAAM,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,MAAM,EAAE;QAC5C,OAAO,MAAM,IAAA,4BAAmB,EAAC,GAAG,CAAC,CAAC;KACvC;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;AACH,CAAC;AAVD,iCAUC;AAED,KAAK,UAAU,UAAU,CAAC,GAA8B;IACtD,MAAM,IAAA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AAM,mBAAmB,GAAG,MAAM,IAAA,yBAAa,EAC7C,GAAG,CAAC,8BAA8B,EAAE,EACpC,MAAA,GAAG,CAAC,GAAG,CAAC,sBAAsB,mCAAI,0CAA0C,EAC5E,GAAG,CAAC,MAAM,CACX,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3E,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import path from 'path';\n\nimport { Android, BuildMode, BuildPhase, Workflow } from '@expo/eas-build-job';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, ArtifactType, BuildContext, SkipNativeBuildError } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport {\n runGradleCommand,\n ensureLFLineEndingsInGradlewScript,\n resolveGradleCommand,\n} from '../android/gradle';\nimport { findArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { restoreCredentials } from '../android/credentials';\nimport { configureBuildGradle } from '../android/gradleConfig';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nexport default async function androidBuilder(ctx: BuildContext<Android.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n throw new Error('Not implemented');\n } else if (ctx.job.mode === BuildMode.CUSTOM) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n if (hasNativeCode) {\n await ctx.runBuildPhase(BuildPhase.FIX_GRADLEW, async () => {\n await ensureLFLineEndingsInGradlewScript(ctx);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"android\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/android-builds/'\n );\n return;\n }\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\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 (\n nullthrows(ctx.job.secrets, 'Secrets must be defined for non-custom builds').buildCredentials\n ) {\n await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n await restoreCredentials(ctx);\n await configureBuildGradle(ctx);\n });\n }\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n if (ctx.skipNativeBuild) {\n throw new SkipNativeBuildError('Skipping Gradle build');\n }\n await ctx.runBuildPhase(BuildPhase.RUN_GRADLEW, async () => {\n const gradleCommand = resolveGradleCommand(ctx.job);\n await runGradleCommand(ctx, {\n logger: ctx.logger,\n gradleCommand,\n androidDir: path.join(ctx.getReactNativeProjectDirectory(), 'android'),\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n const applicationArchives = await findArtifacts(\n ctx.getReactNativeProjectDirectory(),\n ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}',\n ctx.logger\n );\n ctx.logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);\n });\n}\n"]}
|
package/dist/builders/ios.js
CHANGED
|
@@ -54,7 +54,11 @@ async function buildAsync(ctx) {
|
|
|
54
54
|
const extraEnvs = (credentials === null || credentials === void 0 ? void 0 : credentials.teamId)
|
|
55
55
|
? { APPLE_TEAM_ID: credentials.teamId }
|
|
56
56
|
: {};
|
|
57
|
-
await (0, prebuild_1.prebuildAsync)(ctx, {
|
|
57
|
+
await (0, prebuild_1.prebuildAsync)(ctx, {
|
|
58
|
+
logger: ctx.logger,
|
|
59
|
+
workingDir: ctx.getReactNativeProjectDirectory(),
|
|
60
|
+
options: { extraEnvs },
|
|
61
|
+
});
|
|
58
62
|
});
|
|
59
63
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RESTORE_CACHE, async () => {
|
|
60
64
|
var _a;
|
package/dist/builders/ios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/builders/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yDAAiD;AACjD,uDAA2E;AAC3E,wDAA0B;AAC1B,4DAAoC;AAEpC,wCAAmE;AACnE,sDAA4E;AAC5E,kDAAmD;AACnD,0CAAwD;AACxD,gDAAyD;AACzD,yEAA4D;AAC5D,8CAAoE;AACpE,oCAAyC;AACzC,0CAAgE;AAChE,4CAA+F;AAC/F,2CAA6C;AAC7C,iDAAmD;AAEnD,qCAAoD;AACpD,qCAA+C;AAEhC,KAAK,UAAU,UAAU,CAAC,GAA0B;IACjE,IAAI,GAAG,CAAC,GAAG,CAAC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AAM,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;YAC1D,MAAM,IAAA,4BAAiB,EAAC,GAAG,EAAE;gBAC3B,WAAW,EAAE,IAAA,oBAAU,EAAC,WAAW,CAAC;gBACpC,OAAO,EAAE,sBAAsB;aAChC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;YAAS;QACR,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;YAClE,MAAM,kBAAkB,CAAC,OAAO,EAAE,CAAC;QACrC,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,sBAAsB,EAAE,CAAC,CAAC;QAClE,MAAM,GAAG,CAAC,eAAe,CACvB,sBAAY,CAAC,mBAAmB,EAChC,CAAC,sBAAsB,CAAC,EACxB,GAAG,CAAC,MAAM,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IACD,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC","sourcesContent":["import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { BuildMode, BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, ArtifactType, BuildContext } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { findArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym, runFastlaneResign } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { downloadApplicationArchiveAsync } from '../ios/resign';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n return await resignAsync(ctx);\n } else if (ctx.job.mode === BuildMode.CUSTOM) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, { extraEnvs });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await installPods(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n const applicationArchives = await findArtifacts(\n ctx.getReactNativeProjectDirectory(),\n resolveArtifactPath(ctx),\n ctx.logger\n );\n ctx.logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName =\n await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.getReactNativeProjectDirectory(),\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.getReactNativeProjectDirectory(),\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n\nasync function resignAsync(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n const applicationArchivePath = await ctx.runBuildPhase(\n BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE,\n async () => {\n return await downloadApplicationArchiveAsync(ctx);\n }\n );\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n await runFastlaneResign(ctx, {\n credentials: nullthrows(credentials),\n ipaPath: applicationArchivePath,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n ctx.logger.info(`Application archive: ${applicationArchivePath}`);\n await ctx.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n [applicationArchivePath],\n ctx.logger\n );\n });\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n return ctx.artifacts;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/builders/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yDAAiD;AACjD,uDAA2E;AAC3E,wDAA0B;AAC1B,4DAAoC;AAEpC,wCAAmE;AACnE,sDAA4E;AAC5E,kDAAmD;AACnD,0CAAwD;AACxD,gDAAyD;AACzD,yEAA4D;AAC5D,8CAAoE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import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { BuildMode, BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, ArtifactType, BuildContext } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { findArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym, runFastlaneResign } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { downloadApplicationArchiveAsync } from '../ios/resign';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n return await resignAsync(ctx);\n } else if (ctx.job.mode === BuildMode.CUSTOM) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\n options: { extraEnvs },\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await installPods(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n const applicationArchives = await findArtifacts(\n ctx.getReactNativeProjectDirectory(),\n resolveArtifactPath(ctx),\n ctx.logger\n );\n ctx.logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName =\n await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.getReactNativeProjectDirectory(),\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.getReactNativeProjectDirectory(),\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n\nasync function resignAsync(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n const applicationArchivePath = await ctx.runBuildPhase(\n BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE,\n async () => {\n return await downloadApplicationArchiveAsync(ctx);\n }\n );\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n await runFastlaneResign(ctx, {\n credentials: nullthrows(credentials),\n ipaPath: applicationArchivePath,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n ctx.logger.info(`Application archive: ${applicationArchivePath}`);\n await ctx.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n [applicationArchivePath],\n ctx.logger\n );\n });\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n return ctx.artifacts;\n}\n"]}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/// <reference types="bunyan" />
|
|
1
2
|
import { Job } from '@expo/eas-build-job';
|
|
2
3
|
import { bunyan } from '@expo/logger';
|
|
3
4
|
import { BuildContext } from '../context';
|
|
4
|
-
export declare function installDependenciesAsync<TJob extends Job>(ctx: BuildContext<TJob>, logger
|
|
5
|
+
export declare function installDependenciesAsync<TJob extends Job>(ctx: BuildContext<TJob>, { logger, workingDir }: {
|
|
6
|
+
logger: bunyan;
|
|
7
|
+
workingDir: string;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
export declare function resolvePackagerDir(ctx: BuildContext<Job>): string;
|
|
@@ -3,18 +3,12 @@ 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.installDependenciesAsync = void 0;
|
|
6
|
+
exports.resolvePackagerDir = exports.installDependenciesAsync = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
9
9
|
const packageManager_1 = require("../utils/packageManager");
|
|
10
10
|
const project_1 = require("../utils/project");
|
|
11
|
-
async function installDependenciesAsync(ctx, logger) {
|
|
12
|
-
const packagerRunDir = (0, packageManager_1.findPackagerRootDir)(ctx.getReactNativeProjectDirectory());
|
|
13
|
-
if (packagerRunDir !== ctx.getReactNativeProjectDirectory()) {
|
|
14
|
-
const relativeReactNativeProjectDirectory = path_1.default.relative(ctx.buildDirectory, ctx.getReactNativeProjectDirectory());
|
|
15
|
-
logger.info(`We detected that '${relativeReactNativeProjectDirectory}' is a ${ctx.packageManager} workspace`);
|
|
16
|
-
}
|
|
17
|
-
const relativePackagerRunDir = path_1.default.relative(ctx.buildDirectory, packagerRunDir);
|
|
11
|
+
async function installDependenciesAsync(ctx, { logger, workingDir }) {
|
|
18
12
|
let args = ['install'];
|
|
19
13
|
if (ctx.packageManager === packageManager_1.PackageManager.PNPM) {
|
|
20
14
|
args = ['install', '--no-frozen-lockfile'];
|
|
@@ -25,14 +19,21 @@ async function installDependenciesAsync(ctx, logger) {
|
|
|
25
19
|
args = ['install', '--no-immutable'];
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
|
-
logger.info(`Running "${ctx.packageManager} ${args.join(' ')}" in ${
|
|
29
|
-
? `directory '${relativePackagerRunDir}'`
|
|
30
|
-
: 'the root dir of your repository'} `);
|
|
22
|
+
logger.info(`Running "${ctx.packageManager} ${args.join(' ')}" in ${workingDir} directory`);
|
|
31
23
|
await (0, turtle_spawn_1.default)(ctx.packageManager, args, {
|
|
32
|
-
cwd:
|
|
24
|
+
cwd: workingDir,
|
|
33
25
|
logger,
|
|
34
26
|
env: ctx.env,
|
|
35
27
|
});
|
|
36
28
|
}
|
|
37
29
|
exports.installDependenciesAsync = installDependenciesAsync;
|
|
30
|
+
function resolvePackagerDir(ctx) {
|
|
31
|
+
const packagerRunDir = (0, packageManager_1.findPackagerRootDir)(ctx.getReactNativeProjectDirectory());
|
|
32
|
+
if (packagerRunDir !== ctx.getReactNativeProjectDirectory()) {
|
|
33
|
+
const relativeReactNativeProjectDirectory = path_1.default.relative(ctx.buildDirectory, ctx.getReactNativeProjectDirectory());
|
|
34
|
+
ctx.logger.info(`We detected that '${relativeReactNativeProjectDirectory}' is a ${ctx.packageManager} workspace`);
|
|
35
|
+
}
|
|
36
|
+
return packagerRunDir;
|
|
37
|
+
}
|
|
38
|
+
exports.resolvePackagerDir = resolvePackagerDir;
|
|
38
39
|
//# sourceMappingURL=installDependencies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installDependencies.js","sourceRoot":"","sources":["../../src/common/installDependencies.ts"],"names":[],"mappings":";;;;;;AA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;QAC3D,MAAM,mCAAmC,GAAG,cAAI,CAAC,QAAQ,CACvD,GAAG,CAAC,cAAc,EAClB,GAAG,CAAC,8BAA8B,EAAE,CACrC,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,qBAAqB,mCAAmC,UAAU,GAAG,CAAC,cAAc,YAAY,CACjG,CAAC;KACH;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAZD,gDAYC","sourcesContent":["import path from 'path';\n\nimport { Job } from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport spawn from '@expo/turtle-spawn';\n\nimport { BuildContext } from '../context';\nimport { PackageManager, findPackagerRootDir } from '../utils/packageManager';\nimport { isUsingYarn2 } from '../utils/project';\n\nexport async function installDependenciesAsync<TJob extends Job>(\n ctx: BuildContext<TJob>,\n { logger, workingDir }: { logger: bunyan; workingDir: string }\n): Promise<void> {\n let args = ['install'];\n if (ctx.packageManager === PackageManager.PNPM) {\n args = ['install', '--no-frozen-lockfile'];\n } else if (ctx.packageManager === PackageManager.YARN) {\n const isYarn2 = await isUsingYarn2(ctx.getReactNativeProjectDirectory());\n if (isYarn2) {\n args = ['install', '--no-immutable'];\n }\n }\n logger.info(`Running \"${ctx.packageManager} ${args.join(' ')}\" in ${workingDir} directory`);\n await spawn(ctx.packageManager, args, {\n cwd: workingDir,\n logger,\n env: ctx.env,\n });\n}\n\nexport function resolvePackagerDir(ctx: BuildContext<Job>): string {\n const packagerRunDir = findPackagerRootDir(ctx.getReactNativeProjectDirectory());\n if (packagerRunDir !== ctx.getReactNativeProjectDirectory()) {\n const relativeReactNativeProjectDirectory = path.relative(\n ctx.buildDirectory,\n ctx.getReactNativeProjectDirectory()\n );\n ctx.logger.info(\n `We detected that '${relativeReactNativeProjectDirectory}' is a ${ctx.packageManager} workspace`\n );\n }\n return packagerRunDir;\n}\n"]}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
/// <reference types="bunyan" />
|
|
1
2
|
import { Job } from '@expo/eas-build-job';
|
|
3
|
+
import { bunyan } from '@expo/logger';
|
|
2
4
|
import { BuildContext } from '../context';
|
|
3
5
|
export interface PrebuildOptions {
|
|
4
6
|
extraEnvs?: Record<string, string>;
|
|
7
|
+
clean?: boolean;
|
|
8
|
+
skipDependencyUpdate?: string;
|
|
5
9
|
}
|
|
6
|
-
export declare function prebuildAsync<TJob extends Job>(ctx: BuildContext<TJob>, options
|
|
10
|
+
export declare function prebuildAsync<TJob extends Job>(ctx: BuildContext<TJob>, { logger, workingDir, options }: {
|
|
11
|
+
logger: bunyan;
|
|
12
|
+
workingDir: string;
|
|
13
|
+
options?: PrebuildOptions;
|
|
14
|
+
}): Promise<void>;
|
package/dist/common/prebuild.js
CHANGED
|
@@ -8,32 +8,38 @@ const semver_1 = __importDefault(require("semver"));
|
|
|
8
8
|
const packageManager_1 = require("../utils/packageManager");
|
|
9
9
|
const project_1 = require("../utils/project");
|
|
10
10
|
const installDependencies_1 = require("./installDependencies");
|
|
11
|
-
async function prebuildAsync(ctx, options) {
|
|
11
|
+
async function prebuildAsync(ctx, { logger, workingDir, options }) {
|
|
12
12
|
var _a;
|
|
13
13
|
const customExpoCliVersion = (_a = ctx.job.builderEnvironment) === null || _a === void 0 ? void 0 : _a.expoCli;
|
|
14
14
|
const shouldDisableSharp = !customExpoCliVersion || semver_1.default.satisfies(customExpoCliVersion, '>=5.4.4');
|
|
15
15
|
const spawnOptions = {
|
|
16
|
-
cwd:
|
|
17
|
-
logger
|
|
16
|
+
cwd: workingDir,
|
|
17
|
+
logger,
|
|
18
18
|
env: {
|
|
19
19
|
...(shouldDisableSharp ? { EXPO_IMAGE_UTILS_NO_SHARP: '1' } : {}),
|
|
20
20
|
...options === null || options === void 0 ? void 0 : options.extraEnvs,
|
|
21
21
|
...ctx.env,
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
|
-
const prebuildCommandArgs = getPrebuildCommandArgs(ctx);
|
|
24
|
+
const prebuildCommandArgs = getPrebuildCommandArgs(ctx, { options });
|
|
25
25
|
await (0, project_1.runExpoCliCommand)(ctx, prebuildCommandArgs, spawnOptions, {
|
|
26
26
|
npmVersionAtLeast7: await (0, packageManager_1.isAtLeastNpm7Async)(),
|
|
27
27
|
});
|
|
28
|
-
await (0, installDependencies_1.installDependenciesAsync)(ctx,
|
|
28
|
+
await (0, installDependencies_1.installDependenciesAsync)(ctx, { logger, workingDir });
|
|
29
29
|
}
|
|
30
30
|
exports.prebuildAsync = prebuildAsync;
|
|
31
|
-
function getPrebuildCommandArgs(ctx) {
|
|
31
|
+
function getPrebuildCommandArgs(ctx, { options }) {
|
|
32
32
|
var _a, _b;
|
|
33
33
|
let prebuildCommand = (_b = (_a = ctx.job.experimental) === null || _a === void 0 ? void 0 : _a.prebuildCommand) !== null && _b !== void 0 ? _b : `prebuild --non-interactive --no-install --platform ${ctx.job.platform}`;
|
|
34
34
|
if (!prebuildCommand.match(/(?:--platform| -p)/)) {
|
|
35
35
|
prebuildCommand = `${prebuildCommand} --platform ${ctx.job.platform}`;
|
|
36
36
|
}
|
|
37
|
+
if (options === null || options === void 0 ? void 0 : options.skipDependencyUpdate) {
|
|
38
|
+
prebuildCommand = `${prebuildCommand} --skip-dependency-update ${options.skipDependencyUpdate}`;
|
|
39
|
+
}
|
|
40
|
+
if (options === null || options === void 0 ? void 0 : options.clean) {
|
|
41
|
+
prebuildCommand = `${prebuildCommand} --clean`;
|
|
42
|
+
}
|
|
37
43
|
const npxCommandPrefix = 'npx ';
|
|
38
44
|
const expoCommandPrefix = 'expo ';
|
|
39
45
|
const expoCliCommandPrefix = 'expo-cli ';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../src/common/prebuild.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;
|
|
1
|
+
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../src/common/prebuild.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;AAI5B,4DAA6D;AAC7D,8CAA6E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G,CAAC,QAAQ,EAAE,CAAC;KACvE;IACD,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,EAAE;QACjC,eAAe,GAAG,GAAG,eAAe,6BAA6B,OAAO,CAAC,oBAAoB,EAAE,CAAC;KACjG;IACD,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE;QAClB,eAAe,GAAG,GAAG,eAAe,UAAU,CAAC;KAChD;IACD,MAAM,gBAAgB,GAAG,MAAM,CAAC;IAChC,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAClC,MAAM,oBAAoB,GAAG,WAAW,CAAC;IACzC,IAAI,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;QAChD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KAC7E;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;QACjD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KAC9E;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE;QACpD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KACjF;IACD,IAAI,CAAC,IAAA,gCAAsB,EAAC,GAAG,CAAC,EAAE;QAChC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;KACrE;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { SpawnOptions } from '@expo/turtle-spawn';\nimport semver from 'semver';\nimport { bunyan } from '@expo/logger';\n\nimport { BuildContext } from '../context';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\nimport { runExpoCliCommand, shouldUseGlobalExpoCli } from '../utils/project';\n\nimport { installDependenciesAsync } from './installDependencies';\n\nexport interface PrebuildOptions {\n extraEnvs?: Record<string, string>;\n clean?: boolean;\n skipDependencyUpdate?: string;\n}\n\nexport async function prebuildAsync<TJob extends Job>(\n ctx: BuildContext<TJob>,\n { logger, workingDir, options }: { logger: bunyan; workingDir: string; options?: PrebuildOptions }\n): Promise<void> {\n const customExpoCliVersion = ctx.job.builderEnvironment?.expoCli;\n const shouldDisableSharp =\n !customExpoCliVersion || semver.satisfies(customExpoCliVersion, '>=5.4.4');\n\n const spawnOptions: SpawnOptions = {\n cwd: workingDir,\n logger,\n env: {\n ...(shouldDisableSharp ? { EXPO_IMAGE_UTILS_NO_SHARP: '1' } : {}),\n ...options?.extraEnvs,\n ...ctx.env,\n },\n };\n\n const prebuildCommandArgs = getPrebuildCommandArgs(ctx, { options });\n await runExpoCliCommand(ctx, prebuildCommandArgs, spawnOptions, {\n npmVersionAtLeast7: await isAtLeastNpm7Async(),\n });\n await installDependenciesAsync(ctx, { logger, workingDir });\n}\n\nfunction getPrebuildCommandArgs<TJob extends Job>(\n ctx: BuildContext<TJob>,\n { options }: { options?: PrebuildOptions }\n): string[] {\n let prebuildCommand =\n ctx.job.experimental?.prebuildCommand ??\n `prebuild --non-interactive --no-install --platform ${ctx.job.platform}`;\n if (!prebuildCommand.match(/(?:--platform| -p)/)) {\n prebuildCommand = `${prebuildCommand} --platform ${ctx.job.platform}`;\n }\n if (options?.skipDependencyUpdate) {\n prebuildCommand = `${prebuildCommand} --skip-dependency-update ${options.skipDependencyUpdate}`;\n }\n if (options?.clean) {\n prebuildCommand = `${prebuildCommand} --clean`;\n }\n const npxCommandPrefix = 'npx ';\n const expoCommandPrefix = 'expo ';\n const expoCliCommandPrefix = 'expo-cli ';\n if (prebuildCommand.startsWith(npxCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(npxCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCliCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCliCommandPrefix.length).trim();\n }\n if (!shouldUseGlobalExpoCli(ctx)) {\n prebuildCommand = prebuildCommand.replace(' --non-interactive', '');\n }\n return prebuildCommand.split(' ');\n}\n"]}
|
package/dist/common/setup.js
CHANGED
|
@@ -47,7 +47,10 @@ async function setupAsync(ctx) {
|
|
|
47
47
|
ctx.logger.info(JSON.stringify(packageJson, null, 2));
|
|
48
48
|
});
|
|
49
49
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.INSTALL_DEPENDENCIES, async () => {
|
|
50
|
-
await (0, installDependencies_1.installDependenciesAsync)(ctx,
|
|
50
|
+
await (0, installDependencies_1.installDependenciesAsync)(ctx, {
|
|
51
|
+
logger: ctx.logger,
|
|
52
|
+
workingDir: (0, installDependencies_1.resolvePackagerDir)(ctx),
|
|
53
|
+
});
|
|
51
54
|
});
|
|
52
55
|
if (ctx.job.triggeredBy === common_1.BuildTrigger.GIT_BASED_INTEGRATION) {
|
|
53
56
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.EAS_BUILD_INTERNAL, async () => {
|
package/dist/common/setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/common/setup.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,sEAAsE;AACtE,wDAA0B;AAC1B,uDAAqE;AACrE,4DAA+D;AAC/D,4DAAoC;AAEpC,4DAAkE;AAGlE,8CAAmE;AACnE,0CAAwD;AACxD,0CAAiD;AACjD,4DAA6D;AAC7D,8CAA2E;AAC3E,kDAA4E;AAE5E,qDAA8D;AAC9D,+DAAiE;AACjE,yDAAiG;AAEjG,MAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,CAAC;AAE7C,MAAM,kBAAmB,SAAQ,KAAK;CAAG;AAEl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A8B,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;QAC1F,MAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,WAAW,KAAK,qBAAY,CAAC,qBAAqB,CAAC;QACjF,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,IAAI,aAAa,IAAI,oBAAoB,EAAE;YACzC,YAAY;gBACV,mOAAmO,CAAC;SACvO;aAAM,IAAI,aAAa,EAAE;YACxB,YAAY,GAAG,8EAA8E,CAAC;SAC/F;aAAM,IAAI,oBAAoB,EAAE;YAC/B,YAAY;gBACV,2NAA2N,CAAC;SAC/N;QACD,MAAM,IAAI,wBAAe,CACvB,+BAA+B,EAC/B,iDAAiD,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,8DAA8D,GAAG,CAAC,GAAG,CAAC,oBAAoB,MAAM,YAAY,mDAAmD,CAC9O,CAAC;KACH;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,CAAA,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAE,GAAG,0CAAE,SAAS,CAAA,EAAE;QAC5E,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,GAAG,CAAC,yBAAyB,EAAE,CAAC;KACjC;AACH,CAAC","sourcesContent":["import path from 'path';\n\nimport spawn, { SpawnPromise, SpawnResult } from '@expo/turtle-spawn';\nimport fs from 'fs-extra';\nimport { BuildPhase, Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildTrigger } from '@expo/eas-build-job/dist/common';\nimport nullthrows from 'nullthrows';\nimport { ExpoConfig } from '@expo/config';\nimport { UserFacingError } from '@expo/eas-build-job/dist/errors';\n\nimport { BuildContext } from '../context';\nimport { deleteXcodeEnvLocalIfExistsAsync } from '../ios/xcodeEnv';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { setUpNpmrcAsync } from '../utils/npmrc';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\nimport { readPackageJson, shouldUseGlobalExpoCli } from '../utils/project';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nimport { prepareProjectSourcesAsync } from './projectSources';\nimport { installDependenciesAsync } from './installDependencies';\nimport { configureEnvFromBuildProfileAsync, runEasBuildInternalAsync } from './easBuildInternal';\n\nconst MAX_EXPO_DOCTOR_TIMEOUT_MS = 30 * 1000;\n\nclass DoctorTimeoutError extends Error {}\n\nexport async function setupAsync<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void> {\n const packageJson = await ctx.runBuildPhase(BuildPhase.PREPARE_PROJECT, async () => {\n await prepareProjectSourcesAsync(ctx);\n await setUpNpmrcAsync(ctx, ctx.logger);\n if (ctx.job.platform === Platform.IOS && ctx.env.EAS_BUILD_RUNNER === 'eas-build') {\n await deleteXcodeEnvLocalIfExistsAsync(ctx as BuildContext<Ios.Job>);\n }\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n // We need to setup envs from eas.json before\n // eas-build-pre-install hook is called.\n await configureEnvFromBuildProfileAsync(ctx);\n }\n // try to read package.json to see if it exists and is valid\n return readPackageJson(ctx.getReactNativeProjectDirectory());\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_INSTALL);\n });\n\n await ctx.runBuildPhase(BuildPhase.READ_PACKAGE_JSON, async () => {\n ctx.logger.info('Using package.json:');\n ctx.logger.info(JSON.stringify(packageJson, null, 2));\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_DEPENDENCIES, async () => {\n await installDependenciesAsync(ctx, ctx.logger);\n });\n\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n await ctx.runBuildPhase(BuildPhase.EAS_BUILD_INTERNAL, async () => {\n await runEasBuildInternalAsync(ctx);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.READ_APP_CONFIG, async () => {\n const appConfig = ctx.appConfig;\n ctx.logger.info('Using app configuration:');\n ctx.logger.info(JSON.stringify(appConfig, null, 2));\n await validateAppConfigAsync(ctx, appConfig);\n });\n\n const hasExpoPackage = !!packageJson.dependencies?.expo;\n if (hasExpoPackage) {\n await ctx.runBuildPhase(BuildPhase.RUN_EXPO_DOCTOR, async () => {\n try {\n const { stdout } = await runExpoDoctor(ctx);\n if (!stdout.match(/Didn't find any issues with the project/)) {\n ctx.markBuildPhaseHasWarnings();\n }\n } catch (err) {\n if (err instanceof DoctorTimeoutError) {\n ctx.logger.error(err.message);\n } else {\n ctx.logger.error({ err }, 'Command \"expo doctor\" failed.');\n }\n ctx.markBuildPhaseHasWarnings();\n }\n });\n }\n}\n\nasync function runExpoDoctor<TJob extends Job>(ctx: BuildContext<TJob>): Promise<SpawnResult> {\n ctx.logger.info('Running \"expo doctor\"');\n let timeout: NodeJS.Timeout | undefined;\n let timedOut = false;\n const isAtLeastNpm7 = await isAtLeastNpm7Async();\n try {\n let promise: SpawnPromise<SpawnResult>;\n if (!shouldUseGlobalExpoCli(ctx)) {\n const argsPrefix = isAtLeastNpm7 ? ['-y'] : [];\n promise = spawn('npx', [...argsPrefix, 'expo-doctor'], {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n });\n } else {\n promise = ctx.runGlobalExpoCliCommand(\n ['doctor'],\n {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n },\n isAtLeastNpm7\n );\n }\n timeout = setTimeout(async () => {\n timedOut = true;\n const ppid = nullthrows(promise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.(`\"expo doctor\" timed out`, undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, MAX_EXPO_DOCTOR_TIMEOUT_MS);\n return await promise;\n } catch (err: any) {\n if (timedOut) {\n throw new DoctorTimeoutError('\"expo doctor\" timed out, skipping...');\n }\n throw err;\n } finally {\n if (timeout) {\n clearTimeout(timeout);\n }\n }\n}\n\nasync function validateAppConfigAsync(\n ctx: BuildContext<Job>,\n appConfig: ExpoConfig\n): Promise<void> {\n if (\n appConfig?.extra?.eas?.projectId &&\n ctx.env.EAS_BUILD_PROJECT_ID &&\n appConfig.extra.eas.projectId !== ctx.env.EAS_BUILD_PROJECT_ID\n ) {\n const isUsingDynamicConfig =\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.ts'))) ||\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.js')));\n const isGitHubBuild = ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION;\n let extraMessage = '';\n if (isGitHubBuild && isUsingDynamicConfig) {\n extraMessage =\n 'Make sure you connected your GitHub repository to the correct Expo project and if you are using environment variables to switch between projects in app.config.js/app.config.ts remember to set those variables in eas.json too. ';\n } else if (isGitHubBuild) {\n extraMessage = 'Make sure you connected your GitHub repository to the correct Expo project. ';\n } else if (isUsingDynamicConfig) {\n extraMessage =\n 'If you are using environment variables to switch between projects in app.config.js/app.config.ts, make sure those variables are also set inside EAS Build. You can do that using \"env\" field in eas.json or EAS Secrets. ';\n }\n throw new UserFacingError(\n 'EAS_BUILD_PROJECT_ID_MISMATCH',\n `The value of the \"extra.eas.projectId\" field (${appConfig.extra.eas.projectId}) in the app config does not match the current project id (${ctx.env.EAS_BUILD_PROJECT_ID}). ${extraMessage}Learn more: https://expo.fyi/eas-config-mismatch.`\n );\n } else if (ctx.env.EAS_BUILD_PROJECT_ID && !appConfig?.extra?.eas?.projectId) {\n ctx.logger.error(`The \"extra.eas.projectId\" field is missing from your app config.`);\n ctx.markBuildPhaseHasWarnings();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/common/setup.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,sEAAsE;AACtE,wDAA0B;AAC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romise, SpawnResult } from '@expo/turtle-spawn';\nimport fs from 'fs-extra';\nimport { BuildPhase, Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildTrigger } from '@expo/eas-build-job/dist/common';\nimport nullthrows from 'nullthrows';\nimport { ExpoConfig } from '@expo/config';\nimport { UserFacingError } from '@expo/eas-build-job/dist/errors';\n\nimport { BuildContext } from '../context';\nimport { deleteXcodeEnvLocalIfExistsAsync } from '../ios/xcodeEnv';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { setUpNpmrcAsync } from '../utils/npmrc';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\nimport { readPackageJson, shouldUseGlobalExpoCli } from '../utils/project';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nimport { prepareProjectSourcesAsync } from './projectSources';\nimport { installDependenciesAsync, resolvePackagerDir } from './installDependencies';\nimport { configureEnvFromBuildProfileAsync, runEasBuildInternalAsync } from './easBuildInternal';\n\nconst MAX_EXPO_DOCTOR_TIMEOUT_MS = 30 * 1000;\n\nclass DoctorTimeoutError extends Error {}\n\nexport async function setupAsync<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void> {\n const packageJson = await ctx.runBuildPhase(BuildPhase.PREPARE_PROJECT, async () => {\n await prepareProjectSourcesAsync(ctx);\n await setUpNpmrcAsync(ctx, ctx.logger);\n if (ctx.job.platform === Platform.IOS && ctx.env.EAS_BUILD_RUNNER === 'eas-build') {\n await deleteXcodeEnvLocalIfExistsAsync(ctx as BuildContext<Ios.Job>);\n }\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n // We need to setup envs from eas.json before\n // eas-build-pre-install hook is called.\n await configureEnvFromBuildProfileAsync(ctx);\n }\n // try to read package.json to see if it exists and is valid\n return readPackageJson(ctx.getReactNativeProjectDirectory());\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_INSTALL);\n });\n\n await ctx.runBuildPhase(BuildPhase.READ_PACKAGE_JSON, async () => {\n ctx.logger.info('Using package.json:');\n ctx.logger.info(JSON.stringify(packageJson, null, 2));\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_DEPENDENCIES, async () => {\n await installDependenciesAsync(ctx, {\n logger: ctx.logger,\n workingDir: resolvePackagerDir(ctx),\n });\n });\n\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n await ctx.runBuildPhase(BuildPhase.EAS_BUILD_INTERNAL, async () => {\n await runEasBuildInternalAsync(ctx);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.READ_APP_CONFIG, async () => {\n const appConfig = ctx.appConfig;\n ctx.logger.info('Using app configuration:');\n ctx.logger.info(JSON.stringify(appConfig, null, 2));\n await validateAppConfigAsync(ctx, appConfig);\n });\n\n const hasExpoPackage = !!packageJson.dependencies?.expo;\n if (hasExpoPackage) {\n await ctx.runBuildPhase(BuildPhase.RUN_EXPO_DOCTOR, async () => {\n try {\n const { stdout } = await runExpoDoctor(ctx);\n if (!stdout.match(/Didn't find any issues with the project/)) {\n ctx.markBuildPhaseHasWarnings();\n }\n } catch (err) {\n if (err instanceof DoctorTimeoutError) {\n ctx.logger.error(err.message);\n } else {\n ctx.logger.error({ err }, 'Command \"expo doctor\" failed.');\n }\n ctx.markBuildPhaseHasWarnings();\n }\n });\n }\n}\n\nasync function runExpoDoctor<TJob extends Job>(ctx: BuildContext<TJob>): Promise<SpawnResult> {\n ctx.logger.info('Running \"expo doctor\"');\n let timeout: NodeJS.Timeout | undefined;\n let timedOut = false;\n const isAtLeastNpm7 = await isAtLeastNpm7Async();\n try {\n let promise: SpawnPromise<SpawnResult>;\n if (!shouldUseGlobalExpoCli(ctx)) {\n const argsPrefix = isAtLeastNpm7 ? ['-y'] : [];\n promise = spawn('npx', [...argsPrefix, 'expo-doctor'], {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n });\n } else {\n promise = ctx.runGlobalExpoCliCommand(\n ['doctor'],\n {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n },\n isAtLeastNpm7\n );\n }\n timeout = setTimeout(async () => {\n timedOut = true;\n const ppid = nullthrows(promise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.(`\"expo doctor\" timed out`, undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, MAX_EXPO_DOCTOR_TIMEOUT_MS);\n return await promise;\n } catch (err: any) {\n if (timedOut) {\n throw new DoctorTimeoutError('\"expo doctor\" timed out, skipping...');\n }\n throw err;\n } finally {\n if (timeout) {\n clearTimeout(timeout);\n }\n }\n}\n\nasync function validateAppConfigAsync(\n ctx: BuildContext<Job>,\n appConfig: ExpoConfig\n): Promise<void> {\n if (\n appConfig?.extra?.eas?.projectId &&\n ctx.env.EAS_BUILD_PROJECT_ID &&\n appConfig.extra.eas.projectId !== ctx.env.EAS_BUILD_PROJECT_ID\n ) {\n const isUsingDynamicConfig =\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.ts'))) ||\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.js')));\n const isGitHubBuild = ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION;\n let extraMessage = '';\n if (isGitHubBuild && isUsingDynamicConfig) {\n extraMessage =\n 'Make sure you connected your GitHub repository to the correct Expo project and if you are using environment variables to switch between projects in app.config.js/app.config.ts remember to set those variables in eas.json too. ';\n } else if (isGitHubBuild) {\n extraMessage = 'Make sure you connected your GitHub repository to the correct Expo project. ';\n } else if (isUsingDynamicConfig) {\n extraMessage =\n 'If you are using environment variables to switch between projects in app.config.js/app.config.ts, make sure those variables are also set inside EAS Build. You can do that using \"env\" field in eas.json or EAS Secrets. ';\n }\n throw new UserFacingError(\n 'EAS_BUILD_PROJECT_ID_MISMATCH',\n `The value of the \"extra.eas.projectId\" field (${appConfig.extra.eas.projectId}) in the app config does not match the current project id (${ctx.env.EAS_BUILD_PROJECT_ID}). ${extraMessage}Learn more: https://expo.fyi/eas-config-mismatch.`\n );\n } else if (ctx.env.EAS_BUILD_PROJECT_ID && !appConfig?.extra?.eas?.projectId) {\n ctx.logger.error(`The \"extra.eas.projectId\" field is missing from your app config.`);\n ctx.markBuildPhaseHasWarnings();\n }\n}\n"]}
|
package/dist/context.d.ts
CHANGED
package/dist/ios/fastlane.d.ts
CHANGED
package/dist/ios/xcpretty.d.ts
CHANGED
|
@@ -5,12 +5,18 @@ const uploadArtifact_1 = require("./functions/uploadArtifact");
|
|
|
5
5
|
const checkout_1 = require("./functions/checkout");
|
|
6
6
|
const setUpNpmrc_1 = require("./functions/setUpNpmrc");
|
|
7
7
|
const installNodeModules_1 = require("./functions/installNodeModules");
|
|
8
|
+
const runGradle_1 = require("./functions/runGradle");
|
|
9
|
+
const prebuild_1 = require("./functions/prebuild");
|
|
10
|
+
const buildReactNativeApp_1 = require("./functions/buildReactNativeApp");
|
|
8
11
|
function getEasFunctions(ctx) {
|
|
9
12
|
return [
|
|
10
13
|
(0, checkout_1.createCheckoutBuildFunction)(),
|
|
11
14
|
(0, uploadArtifact_1.createUploadArtifactBuildFunction)(ctx),
|
|
12
15
|
(0, setUpNpmrc_1.createSetUpNpmrcBuildFunction)(ctx),
|
|
13
16
|
(0, installNodeModules_1.createInstallNodeModulesBuildFunction)(ctx),
|
|
17
|
+
(0, prebuild_1.createPrebuildBuildFunction)(ctx),
|
|
18
|
+
(0, runGradle_1.createRunGradleBuildFunction)(ctx),
|
|
19
|
+
(0, buildReactNativeApp_1.createBuildReactNativeAppBuildFunction)(ctx),
|
|
14
20
|
];
|
|
15
21
|
}
|
|
16
22
|
exports.getEasFunctions = getEasFunctions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAKA,+DAA+E;AAC/E,mDAAmE;AACnE,uDAAuE;AACvE,uEAAuF;
|
|
1
|
+
{"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAKA,+DAA+E;AAC/E,mDAAmE;AACnE,uDAAuE;AACvE,uEAAuF;AACvF,qDAAqE;AACrE,mDAAmE;AACnE,yEAAyF;AAEzF,SAAgB,eAAe,CAAgB,GAAoB;IACjE,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,0CAA6B,EAAC,GAAG,CAAC;QAClC,IAAA,0DAAqC,EAAC,GAAG,CAAC;QAC1C,IAAA,sCAA2B,EAAC,GAAG,CAAC;QAChC,IAAA,wCAA4B,EAAC,GAAG,CAAC;QACjC,IAAA,4DAAsC,EAAC,GAAG,CAAC;KAC5C,CAAC;AACJ,CAAC;AAVD,0CAUC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../context';\n\nimport { createUploadArtifactBuildFunction } from './functions/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/setUpNpmrc';\nimport { createInstallNodeModulesBuildFunction } from './functions/installNodeModules';\nimport { createRunGradleBuildFunction } from './functions/runGradle';\nimport { createPrebuildBuildFunction } from './functions/prebuild';\nimport { createBuildReactNativeAppBuildFunction } from './functions/buildReactNativeApp';\n\nexport function getEasFunctions<T extends Job>(ctx: BuildContext<T>): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(ctx),\n createInstallNodeModulesBuildFunction(ctx),\n createPrebuildBuildFunction(ctx),\n createRunGradleBuildFunction(ctx),\n createBuildReactNativeAppBuildFunction(ctx),\n ];\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createBuildReactNativeAppBuildFunction = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
|
+
const steps_1 = require("@expo/steps");
|
|
10
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
|
+
const gradle_1 = require("../../android/gradle");
|
|
12
|
+
function createBuildReactNativeAppBuildFunction(ctx) {
|
|
13
|
+
return new steps_1.BuildFunction({
|
|
14
|
+
namespace: 'eas',
|
|
15
|
+
id: 'build_react_native_app',
|
|
16
|
+
name: 'Build React Native app',
|
|
17
|
+
fn: async (stepsCtx) => {
|
|
18
|
+
if (ctx.job.platform === eas_build_job_1.Platform.ANDROID) {
|
|
19
|
+
const androidDir = path_1.default.join(stepsCtx.workingDirectory, 'android');
|
|
20
|
+
if (!(await fs_extra_1.default.exists(androidDir))) {
|
|
21
|
+
throw new steps_1.errors.BuildStepRuntimeError(`Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run "eas/prebuild" step to generate your native code.`);
|
|
22
|
+
}
|
|
23
|
+
stepsCtx.logger.info('Building Android project');
|
|
24
|
+
await (0, gradle_1.runGradleCommand)(ctx, {
|
|
25
|
+
logger: stepsCtx.logger,
|
|
26
|
+
gradleCommand: (0, gradle_1.resolveGradleCommand)(ctx.job),
|
|
27
|
+
androidDir,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw new steps_1.errors.BuildStepRuntimeError('iOS builds are not supported yet');
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.createBuildReactNativeAppBuildFunction = createBuildReactNativeAppBuildFunction;
|
|
37
|
+
//# sourceMappingURL=buildReactNativeApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildReactNativeApp.js","sourceRoot":"","sources":["../../../src/steps/functions/buildReactNativeApp.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAA6D;AAC7D,uCAAoD;AACpD,wDAA0B;AAG1B,iDAA8E;AAE9E,SAAgB,sCAAsC,CACpD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,wBAAwB;QAC5B,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;oBAClC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,8BAA8B,UAAU,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CAC/S,CAAC;iBACH;gBACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACjD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;oBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,aAAa,EAAE,IAAA,6BAAoB,EAAC,GAAG,CAAC,GAAG,CAAC;oBAC5C,UAAU;iBACX,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,IAAI,cAAM,CAAC,qBAAqB,CAAC,kCAAkC,CAAC,CAAC;aAC5E;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1BD,wFA0BC","sourcesContent":["import path from 'path';\n\nimport { Android, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, errors } from '@expo/steps';\nimport fs from 'fs-extra';\n\nimport { BuildContext } from '../../context';\nimport { resolveGradleCommand, runGradleCommand } from '../../android/gradle';\n\nexport function createBuildReactNativeAppBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'build_react_native_app',\n name: 'Build React Native app',\n fn: async (stepsCtx) => {\n if (ctx.job.platform === Platform.ANDROID) {\n const androidDir = path.join(stepsCtx.workingDirectory, 'android');\n if (!(await fs.exists(androidDir))) {\n throw new errors.BuildStepRuntimeError(\n `Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n stepsCtx.logger.info('Building Android project');\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: resolveGradleCommand(ctx.job),\n androidDir,\n });\n } else {\n throw new errors.BuildStepRuntimeError('iOS builds are not supported yet');\n }\n },\n });\n}\n"]}
|
|
@@ -9,7 +9,10 @@ function createInstallNodeModulesBuildFunction(ctx) {
|
|
|
9
9
|
id: 'install_node_modules',
|
|
10
10
|
name: 'Install node modules',
|
|
11
11
|
fn: async (stepsCtx) => {
|
|
12
|
-
await (0, installDependencies_1.installDependenciesAsync)(ctx,
|
|
12
|
+
await (0, installDependencies_1.installDependenciesAsync)(ctx, {
|
|
13
|
+
logger: stepsCtx.logger,
|
|
14
|
+
workingDir: stepsCtx.workingDirectory,
|
|
15
|
+
});
|
|
13
16
|
},
|
|
14
17
|
});
|
|
15
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installNodeModules.js","sourceRoot":"","sources":["../../../src/steps/functions/installNodeModules.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,0EAA4E;AAE5E,SAAgB,qCAAqC,CACnD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,8CAAwB,EAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"installNodeModules.js","sourceRoot":"","sources":["../../../src/steps/functions/installNodeModules.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,0EAA4E;AAE5E,SAAgB,qCAAqC,CACnD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,8CAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;aACtC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAdD,sFAcC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../context';\nimport { installDependenciesAsync } from '../../common/installDependencies';\n\nexport function createInstallNodeModulesBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'install_node_modules',\n name: 'Install node modules',\n fn: async (stepsCtx) => {\n await installDependenciesAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n });\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPrebuildBuildFunction = void 0;
|
|
4
|
+
const steps_1 = require("@expo/steps");
|
|
5
|
+
const prebuild_1 = require("../../common/prebuild");
|
|
6
|
+
function createPrebuildBuildFunction(ctx) {
|
|
7
|
+
return new steps_1.BuildFunction({
|
|
8
|
+
namespace: 'eas',
|
|
9
|
+
id: 'prebuild',
|
|
10
|
+
name: 'Prebuild',
|
|
11
|
+
inputProviders: [
|
|
12
|
+
steps_1.BuildStepInput.createProvider({
|
|
13
|
+
id: 'skip_dependency_update',
|
|
14
|
+
defaultValue: false,
|
|
15
|
+
}),
|
|
16
|
+
steps_1.BuildStepInput.createProvider({
|
|
17
|
+
id: 'clean',
|
|
18
|
+
defaultValue: false,
|
|
19
|
+
}),
|
|
20
|
+
steps_1.BuildStepInput.createProvider({
|
|
21
|
+
id: 'apple_team_id',
|
|
22
|
+
required: false,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
fn: async (stepsCtx, { inputs }) => {
|
|
26
|
+
var _a;
|
|
27
|
+
// TODO: make sure we can pass Apple Team ID to prebuild when adding credentials for custom builds
|
|
28
|
+
const extraEnvs = inputs.apple_team_id.value
|
|
29
|
+
? { APPLE_TEAM_ID: inputs.apple_team_id.value.toString() }
|
|
30
|
+
: {};
|
|
31
|
+
await (0, prebuild_1.prebuildAsync)(ctx, {
|
|
32
|
+
logger: stepsCtx.logger,
|
|
33
|
+
workingDir: stepsCtx.workingDirectory,
|
|
34
|
+
options: {
|
|
35
|
+
extraEnvs,
|
|
36
|
+
clean: !!inputs.clean.value,
|
|
37
|
+
skipDependencyUpdate: (_a = inputs.skip_dependency_update.value) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.createPrebuildBuildFunction = createPrebuildBuildFunction;
|
|
44
|
+
//# sourceMappingURL=prebuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../../src/steps/functions/prebuild.ts"],"names":[],"mappings":";;;AACA,uCAA4D;AAG5D,oDAAsD;AAEtD,SAAgB,2BAA2B,CAAgB,GAAoB;IAC7E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,wBAAwB;gBAC5B,YAAY,EAAE,KAAK;aACpB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,OAAO;gBACX,YAAY,EAAE,KAAK;aACpB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,eAAe;gBACnB,QAAQ,EAAE,KAAK;aAChB,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;;YACjC,kGAAkG;YAClG,MAAM,SAAS,GAA2B,MAAM,CAAC,aAAa,CAAC,KAAK;gBAClE,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE;gBAC1D,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,IAAA,wBAAa,EAAC,GAAG,EAAE;gBACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;gBACrC,OAAO,EAAE;oBACP,SAAS;oBACT,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;oBAC3B,oBAAoB,EAAE,MAAA,MAAM,CAAC,sBAAsB,CAAC,KAAK,0CAAE,QAAQ,EAAE;iBACtE;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAnCD,kEAmCC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\n\nimport { BuildContext } from '../../context';\nimport { prebuildAsync } from '../../common/prebuild';\n\nexport function createPrebuildBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'prebuild',\n name: 'Prebuild',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'skip_dependency_update',\n defaultValue: false,\n }),\n BuildStepInput.createProvider({\n id: 'clean',\n defaultValue: false,\n }),\n BuildStepInput.createProvider({\n id: 'apple_team_id',\n required: false,\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n // TODO: make sure we can pass Apple Team ID to prebuild when adding credentials for custom builds\n const extraEnvs: Record<string, string> = inputs.apple_team_id.value\n ? { APPLE_TEAM_ID: inputs.apple_team_id.value.toString() }\n : {};\n await prebuildAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n options: {\n extraEnvs,\n clean: !!inputs.clean.value,\n skipDependencyUpdate: inputs.skip_dependency_update.value?.toString(),\n },\n });\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createRunGradleBuildFunction = void 0;
|
|
7
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
8
|
+
const steps_1 = require("@expo/steps");
|
|
9
|
+
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
10
|
+
const gradle_1 = require("../../android/gradle");
|
|
11
|
+
function createRunGradleBuildFunction(ctx) {
|
|
12
|
+
return new steps_1.BuildFunction({
|
|
13
|
+
namespace: 'utils',
|
|
14
|
+
id: 'run_gradle',
|
|
15
|
+
name: 'Run Gradle',
|
|
16
|
+
inputProviders: [
|
|
17
|
+
steps_1.BuildStepInput.createProvider({
|
|
18
|
+
id: 'gradle_command',
|
|
19
|
+
defaultValue: ':app:bundleRelease',
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
22
|
+
fn: async (stepsCtx, { inputs }) => {
|
|
23
|
+
if (ctx.job.platform !== eas_build_job_1.Platform.ANDROID) {
|
|
24
|
+
throw new steps_1.errors.BuildStepRuntimeError('This step is only supported for Android');
|
|
25
|
+
}
|
|
26
|
+
await (0, gradle_1.runGradleCommand)(ctx, {
|
|
27
|
+
logger: stepsCtx.logger,
|
|
28
|
+
gradleCommand: (0, nullthrows_1.default)(inputs.gradle_command.value).toString(),
|
|
29
|
+
androidDir: stepsCtx.workingDirectory,
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.createRunGradleBuildFunction = createRunGradleBuildFunction;
|
|
35
|
+
//# sourceMappingURL=runGradle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runGradle.js","sourceRoot":"","sources":["../../../src/steps/functions/runGradle.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA6D;AAC7D,uCAAoE;AACpE,4DAAoC;AAGpC,iDAAwD;AAExD,SAAgB,4BAA4B,CAAgB,GAAoB;IAC9E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,OAAO;QAClB,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,gBAAgB;gBACpB,YAAY,EAAE,oBAAoB;aACnC,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACjC,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CAAC,yCAAyC,CAAC,CAAC;aACnF;YACD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;gBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,aAAa,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;gBACjE,UAAU,EAAE,QAAQ,CAAC,gBAAgB;aACtC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAtBD,oEAsBC","sourcesContent":["import { Android, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput, errors } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { BuildContext } from '../../context';\nimport { runGradleCommand } from '../../android/gradle';\n\nexport function createRunGradleBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'utils',\n id: 'run_gradle',\n name: 'Run Gradle',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'gradle_command',\n defaultValue: ':app:bundleRelease',\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n if (ctx.job.platform !== Platform.ANDROID) {\n throw new errors.BuildStepRuntimeError('This step is only supported for Android');\n }\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: nullthrows(inputs.gradle_command.value).toString(),\n androidDir: stepsCtx.workingDirectory,\n });\n },\n });\n}\n"]}
|
|
@@ -27,8 +27,8 @@ function createUploadArtifactBuildFunction(ctx) {
|
|
|
27
27
|
steps_1.BuildStepInput.createProvider({ id: 'path', required: true }),
|
|
28
28
|
],
|
|
29
29
|
fn: async (stepsCtx, { inputs }) => {
|
|
30
|
-
const artifactType = validateAndConvertBuildArtifactType((0, nullthrows_1.default)(inputs.type.value));
|
|
31
|
-
const filePath = path_1.default.resolve(stepsCtx.workingDirectory, (0, nullthrows_1.default)(inputs.path.value));
|
|
30
|
+
const artifactType = validateAndConvertBuildArtifactType((0, nullthrows_1.default)(inputs.type.value).toString());
|
|
31
|
+
const filePath = path_1.default.resolve(stepsCtx.workingDirectory, (0, nullthrows_1.default)(inputs.path.value).toString());
|
|
32
32
|
await ctx.uploadArtifacts(artifactType, [filePath], stepsCtx.logger);
|
|
33
33
|
},
|
|
34
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadArtifact.js","sourceRoot":"","sources":["../../../src/steps/functions/uploadArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,uCAA4D;AAC5D,4DAAoC;AAEpC,2CAA2D;AAE3D,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,gEAA2C,CAAA;IAC3C,sDAAiC,CAAA;AACnC,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,SAAgB,iCAAiC,CAC/C,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,MAAM;gBACV,YAAY,EAAE,iBAAiB,CAAC,mBAAmB;gBACnD,aAAa,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,cAAc,CAAC;aACzF,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC9D;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACjC,MAAM,YAAY,GAAG,mCAAmC,
|
|
1
|
+
{"version":3,"file":"uploadArtifact.js","sourceRoot":"","sources":["../../../src/steps/functions/uploadArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,uCAA4D;AAC5D,4DAAoC;AAEpC,2CAA2D;AAE3D,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,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AI,KAAK,CACb,IAAI,KAAK,mDAAmD,aAAa;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;KACH;IACD,OAAO,KAAK,KAAK,iBAAiB,CAAC,mBAAmB;QACpD,CAAC,CAAC,sBAAY,CAAC,mBAAmB;QAClC,CAAC,CAAC,sBAAY,CAAC,eAAe,CAAC;AACnC,CAAC","sourcesContent":["import path from 'path';\n\nimport { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { ArtifactType, BuildContext } from '../../context';\n\nenum BuildArtifactType {\n APPLICATION_ARCHIVE = 'application-archive',\n BUILD_ARTIFACT = 'build-artifact',\n}\n\nexport function createUploadArtifactBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'upload_artifact',\n name: 'Upload artifact',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'type',\n defaultValue: BuildArtifactType.APPLICATION_ARCHIVE,\n allowedValues: [BuildArtifactType.APPLICATION_ARCHIVE, BuildArtifactType.BUILD_ARTIFACT],\n }),\n BuildStepInput.createProvider({ id: 'path', required: true }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n const artifactType = validateAndConvertBuildArtifactType(\n nullthrows(inputs.type.value).toString()\n );\n const filePath = path.resolve(\n stepsCtx.workingDirectory,\n nullthrows(inputs.path.value).toString()\n );\n await ctx.uploadArtifacts(artifactType, [filePath], stepsCtx.logger);\n },\n });\n}\n\nfunction validateAndConvertBuildArtifactType(input: string): ArtifactType {\n const allowedValues: string[] = Object.values(BuildArtifactType);\n if (!allowedValues.includes(input)) {\n throw new Error(\n `\"${input}\" is not allowed artifact type, allowed values: ${allowedValues\n .map((i) => `\"${i}\"`)\n .join(', ')}`\n );\n }\n return input === BuildArtifactType.APPLICATION_ARCHIVE\n ? ArtifactType.APPLICATION_ARCHIVE\n : ArtifactType.BUILD_ARTIFACTS;\n}\n"]}
|
package/dist/utils/npmrc.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"@expo/config-plugins": "^5.0.4",
|
|
25
25
|
"@expo/downloader": "1.0.13",
|
|
26
26
|
"@expo/eas-build-job": "1.0.13",
|
|
27
|
-
"@expo/logger": "1.0.
|
|
27
|
+
"@expo/logger": "1.0.19",
|
|
28
28
|
"@expo/package-manager": "^0.0.57",
|
|
29
29
|
"@expo/plist": "^0.0.20",
|
|
30
|
-
"@expo/steps": "1.0.
|
|
30
|
+
"@expo/steps": "1.0.20",
|
|
31
31
|
"@expo/template-file": "1.0.13",
|
|
32
|
-
"@expo/turtle-spawn": "1.0.
|
|
32
|
+
"@expo/turtle-spawn": "1.0.19",
|
|
33
33
|
"@expo/xcpretty": "^4.2.2",
|
|
34
34
|
"fast-glob": "^3.2.12",
|
|
35
35
|
"fs-extra": "^11.1.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"node": "18.13.0",
|
|
62
62
|
"yarn": "1.22.19"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "22325ec07e078567c6ef416bdfdd253320227774"
|
|
65
65
|
}
|