@expo/build-tools 18.6.0 → 18.7.0
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/common/setup.js +1 -4
- package/dist/steps/easFunctions.js +4 -0
- package/dist/steps/functions/readAppConfig.d.ts +2 -0
- package/dist/steps/functions/readAppConfig.js +39 -0
- package/dist/steps/functions/readPackageJson.d.ts +2 -0
- package/dist/steps/functions/readPackageJson.js +28 -0
- package/dist/steps/functions/startAndroidEmulator.js +28 -0
- package/dist/utils/project.d.ts +3 -0
- package/dist/utils/project.js +7 -0
- package/package.json +2 -2
package/dist/common/setup.js
CHANGED
|
@@ -65,10 +65,7 @@ async function setupAsync(ctx) {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
const packageJson = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.READ_PACKAGE_JSON, async () => {
|
|
68
|
-
ctx.logger.
|
|
69
|
-
const packageJson = (0, project_1.readPackageJson)(ctx.getReactNativeProjectDirectory());
|
|
70
|
-
ctx.logger.info(JSON.stringify(packageJson, null, 2));
|
|
71
|
-
return packageJson;
|
|
68
|
+
return (0, project_1.readAndLogPackageJson)(ctx.logger, ctx.getReactNativeProjectDirectory());
|
|
72
69
|
});
|
|
73
70
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.INSTALL_DEPENDENCIES, async () => {
|
|
74
71
|
const expoVersion = ctx.metadata?.sdkVersion ??
|
|
@@ -19,7 +19,9 @@ const installMaestro_1 = require("./functions/installMaestro");
|
|
|
19
19
|
const installNodeModules_1 = require("./functions/installNodeModules");
|
|
20
20
|
const installPods_1 = require("./functions/installPods");
|
|
21
21
|
const prebuild_1 = require("./functions/prebuild");
|
|
22
|
+
const readAppConfig_1 = require("./functions/readAppConfig");
|
|
22
23
|
const readIpaInfo_1 = require("./functions/readIpaInfo");
|
|
24
|
+
const readPackageJson_1 = require("./functions/readPackageJson");
|
|
23
25
|
const repack_1 = require("./functions/repack");
|
|
24
26
|
const reportMaestroTestResults_1 = require("./functions/reportMaestroTestResults");
|
|
25
27
|
const resolveAppleTeamIdFromCredentials_1 = require("./functions/resolveAppleTeamIdFromCredentials");
|
|
@@ -43,6 +45,8 @@ function getEasFunctions(ctx) {
|
|
|
43
45
|
(0, downloadArtifact_1.createDownloadArtifactFunction)(),
|
|
44
46
|
(0, uploadArtifact_1.createUploadArtifactBuildFunction)(ctx),
|
|
45
47
|
(0, useNpmToken_1.createSetUpNpmrcBuildFunction)(),
|
|
48
|
+
(0, readPackageJson_1.createReadPackageJsonBuildFunction)(),
|
|
49
|
+
(0, readAppConfig_1.createReadAppConfigBuildFunction)(),
|
|
46
50
|
(0, installNodeModules_1.createInstallNodeModulesBuildFunction)(),
|
|
47
51
|
(0, prebuild_1.createPrebuildBuildFunction)(),
|
|
48
52
|
(0, readIpaInfo_1.createReadIpaInfoBuildFunction)(),
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createReadAppConfigBuildFunction = createReadAppConfigBuildFunction;
|
|
4
|
+
const steps_1 = require("@expo/steps");
|
|
5
|
+
const appConfig_1 = require("../../utils/appConfig");
|
|
6
|
+
function createReadAppConfigBuildFunction() {
|
|
7
|
+
return new steps_1.BuildFunction({
|
|
8
|
+
namespace: 'eas',
|
|
9
|
+
id: 'read_app_config',
|
|
10
|
+
name: 'Read app config',
|
|
11
|
+
__metricsId: 'eas/read_app_config',
|
|
12
|
+
outputProviders: [
|
|
13
|
+
steps_1.BuildStepOutput.createProvider({
|
|
14
|
+
id: 'app_config',
|
|
15
|
+
required: false,
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
fn: async (stepCtx, { env, outputs }) => {
|
|
19
|
+
const metadata = stepCtx.global.staticContext.metadata;
|
|
20
|
+
try {
|
|
21
|
+
const appConfig = (await (0, appConfig_1.readAppConfig)({
|
|
22
|
+
projectDir: stepCtx.workingDirectory,
|
|
23
|
+
env: Object.keys(env).reduce((acc, key) => {
|
|
24
|
+
acc[key] = env[key] ?? '';
|
|
25
|
+
return acc;
|
|
26
|
+
}, {}),
|
|
27
|
+
logger: stepCtx.logger,
|
|
28
|
+
sdkVersion: metadata?.sdkVersion,
|
|
29
|
+
})).exp;
|
|
30
|
+
stepCtx.logger.info('Using app configuration:');
|
|
31
|
+
stepCtx.logger.info(JSON.stringify(appConfig, null, 2));
|
|
32
|
+
outputs.app_config.set(JSON.stringify(appConfig));
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// readAppConfig logs underlying failures.
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createReadPackageJsonBuildFunction = createReadPackageJsonBuildFunction;
|
|
4
|
+
const steps_1 = require("@expo/steps");
|
|
5
|
+
const project_1 = require("../../utils/project");
|
|
6
|
+
function createReadPackageJsonBuildFunction() {
|
|
7
|
+
return new steps_1.BuildFunction({
|
|
8
|
+
namespace: 'eas',
|
|
9
|
+
id: 'read_package_json',
|
|
10
|
+
name: 'Read package.json',
|
|
11
|
+
__metricsId: 'eas/read_package_json',
|
|
12
|
+
outputProviders: [
|
|
13
|
+
steps_1.BuildStepOutput.createProvider({
|
|
14
|
+
id: 'package_json',
|
|
15
|
+
required: false,
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
fn: async (stepCtx, { outputs }) => {
|
|
19
|
+
try {
|
|
20
|
+
const packageJson = (0, project_1.readAndLogPackageJson)(stepCtx.logger, stepCtx.workingDirectory);
|
|
21
|
+
outputs.package_json.set(JSON.stringify(packageJson));
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
stepCtx.logger.error({ err });
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createStartAndroidEmulatorBuildFunction = createStartAndroidEmulatorBuildFunction;
|
|
7
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
8
|
const results_1 = require("@expo/results");
|
|
8
9
|
const steps_1 = require("@expo/steps");
|
|
9
10
|
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
@@ -43,6 +44,12 @@ function createStartAndroidEmulatorBuildFunction() {
|
|
|
43
44
|
}),
|
|
44
45
|
],
|
|
45
46
|
fn: async ({ logger }, { inputs, env }) => {
|
|
47
|
+
if (env.EAS_NO_EMULATOR_HOST_SUPPORT_CHECK !== '1') {
|
|
48
|
+
await assertAndroidEmulatorHostSupportAsync({ env });
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
logger.info('Skipping Android emulator host support check because $EAS_NO_EMULATOR_HOST_SUPPORT_CHECK is enabled.');
|
|
52
|
+
}
|
|
46
53
|
try {
|
|
47
54
|
const availableDevices = await AndroidEmulatorUtils_1.AndroidEmulatorUtils.getAvailableDevicesAsync({ env });
|
|
48
55
|
logger.info(`Available Android devices:\n- ${availableDevices.join(`\n- `)}`);
|
|
@@ -229,3 +236,24 @@ function createStartAndroidEmulatorBuildFunction() {
|
|
|
229
236
|
},
|
|
230
237
|
});
|
|
231
238
|
}
|
|
239
|
+
async function assertAndroidEmulatorHostSupportAsync({ env, }) {
|
|
240
|
+
const isAndroidEmulatorHostSupported = await isAndroidEmulatorHostSupportedAsync(env);
|
|
241
|
+
if (!isAndroidEmulatorHostSupported) {
|
|
242
|
+
throw new eas_build_job_1.UserError('ANDROID_EMULATOR_ACCEL_CHECK_UNAVAILABLE', 'Could not start the Android emulator on this runner.\n\n' +
|
|
243
|
+
'Android emulator requires nested virtualization on Linux. This job does not have the required virtualization support.\n\n' +
|
|
244
|
+
'Update your workflow YAML to use a nested-virtualization Linux runner, for example:\n' +
|
|
245
|
+
' runs_on: linux-medium-nested-virtualization\n' +
|
|
246
|
+
' runs_on: linux-large-nested-virtualization\n\n' +
|
|
247
|
+
'See https://docs.expo.dev/eas/workflows/syntax/#jobsjob_idruns_on for more information.');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
async function isAndroidEmulatorHostSupportedAsync(env) {
|
|
251
|
+
const androidSdkPath = env.ANDROID_HOME ?? env.ANDROID_SDK_ROOT ?? '';
|
|
252
|
+
try {
|
|
253
|
+
await (0, turtle_spawn_1.default)(`${androidSdkPath}/emulator/emulator`, ['-accel-check'], { env });
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
}
|
package/dist/utils/project.d.ts
CHANGED
|
@@ -11,4 +11,7 @@ export declare function runExpoCliCommand({ packageManager, args, options, }: {
|
|
|
11
11
|
options: SpawnOptions;
|
|
12
12
|
}): SpawnPromise<SpawnResult>;
|
|
13
13
|
export declare function readPackageJson(projectDir: string): any;
|
|
14
|
+
export declare function readAndLogPackageJson(logger: {
|
|
15
|
+
info: (message: string) => void;
|
|
16
|
+
}, projectDir: string): any;
|
|
14
17
|
export declare function readEasJsonContents(projectDir: string): string;
|
package/dist/utils/project.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.isUsingModernYarnVersion = isUsingModernYarnVersion;
|
|
7
7
|
exports.runExpoCliCommand = runExpoCliCommand;
|
|
8
8
|
exports.readPackageJson = readPackageJson;
|
|
9
|
+
exports.readAndLogPackageJson = readAndLogPackageJson;
|
|
9
10
|
exports.readEasJsonContents = readEasJsonContents;
|
|
10
11
|
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
11
12
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
@@ -76,6 +77,12 @@ function readPackageJson(projectDir) {
|
|
|
76
77
|
throw new Error(`Failed to parse or read package.json: ${err.message}`);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
80
|
+
function readAndLogPackageJson(logger, projectDir) {
|
|
81
|
+
logger.info('Using package.json:');
|
|
82
|
+
const packageJson = readPackageJson(projectDir);
|
|
83
|
+
logger.info(JSON.stringify(packageJson, null, 2));
|
|
84
|
+
return packageJson;
|
|
85
|
+
}
|
|
79
86
|
function readEasJsonContents(projectDir) {
|
|
80
87
|
const easJsonPath = path_1.default.join(projectDir, 'eas.json');
|
|
81
88
|
if (!fs_extra_1.default.pathExistsSync(easJsonPath)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.7.0",
|
|
4
4
|
"bugs": "https://github.com/expo/eas-cli/issues",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Expo <support@expo.io>",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"typescript": "^5.5.4",
|
|
99
99
|
"uuid": "^9.0.1"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "7f163e3e529c71db2d394db4826ffff41313ae37"
|
|
102
102
|
}
|