@expo/build-tools 18.6.0 → 18.8.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/builders/ios.js +15 -2
- package/dist/common/easBuildInternal.js +3 -27
- package/dist/common/setup.js +1 -4
- package/dist/context.js +3 -1
- package/dist/ios/fastlane.d.ts +4 -1
- package/dist/ios/fastlane.js +9 -1
- package/dist/ios/gymfile.d.ts +5 -2
- package/dist/ios/gymfile.js +5 -2
- package/dist/steps/easFunctions.js +10 -0
- package/dist/steps/functionGroups/build.js +4 -0
- package/dist/steps/functions/configureIosCredentials.js +9 -3
- package/dist/steps/functions/configureIosVersion.js +32 -14
- package/dist/steps/functions/deploy.d.ts +2 -0
- package/dist/steps/functions/deploy.js +136 -0
- package/dist/steps/functions/eagerBundle.js +1 -1
- package/dist/steps/functions/export.d.ts +2 -0
- package/dist/steps/functions/export.js +115 -0
- package/dist/steps/functions/generateGymfileFromTemplate.js +9 -0
- package/dist/steps/functions/installNodeModules.js +1 -1
- package/dist/steps/functions/parseXcactivitylog.d.ts +2 -0
- package/dist/steps/functions/parseXcactivitylog.js +49 -0
- package/dist/steps/functions/prebuild.js +1 -1
- 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/restoreBuildCache.js +1 -1
- package/dist/steps/functions/saveBuildCache.js +1 -1
- package/dist/steps/functions/startAndroidEmulator.js +28 -0
- package/dist/steps/utils/ios/xcactivitylog.d.ts +57 -0
- package/dist/steps/utils/ios/xcactivitylog.js +278 -0
- package/dist/templates/GymfileArchive.d.ts +1 -1
- package/dist/templates/GymfileArchive.js +4 -0
- package/dist/templates/GymfileSimulator.d.ts +1 -1
- package/dist/templates/GymfileSimulator.js +3 -0
- package/dist/utils/easCli.d.ts +11 -0
- package/dist/utils/easCli.js +57 -0
- package/dist/utils/packageManager.d.ts +4 -1
- package/dist/utils/packageManager.js +13 -4
- package/dist/utils/project.d.ts +3 -0
- package/dist/utils/project.js +7 -0
- package/package.json +4 -4
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEasExportBuildFunction = createEasExportBuildFunction;
|
|
4
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
|
+
const steps_1 = require("@expo/steps");
|
|
6
|
+
const packageManager_1 = require("../../utils/packageManager");
|
|
7
|
+
const project_1 = require("../../utils/project");
|
|
8
|
+
function createEasExportBuildFunction() {
|
|
9
|
+
return new steps_1.BuildFunction({
|
|
10
|
+
namespace: 'eas',
|
|
11
|
+
id: 'export',
|
|
12
|
+
name: 'Export',
|
|
13
|
+
__metricsId: 'eas/export',
|
|
14
|
+
inputProviders: [
|
|
15
|
+
steps_1.BuildStepInput.createProvider({
|
|
16
|
+
id: 'output_dir',
|
|
17
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
18
|
+
required: false,
|
|
19
|
+
defaultValue: 'dist',
|
|
20
|
+
}),
|
|
21
|
+
steps_1.BuildStepInput.createProvider({
|
|
22
|
+
id: 'dev',
|
|
23
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
steps_1.BuildStepInput.createProvider({
|
|
27
|
+
id: 'minify',
|
|
28
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
steps_1.BuildStepInput.createProvider({
|
|
32
|
+
id: 'dump_assetmap',
|
|
33
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
steps_1.BuildStepInput.createProvider({
|
|
37
|
+
id: 'ssg',
|
|
38
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
39
|
+
required: false,
|
|
40
|
+
}),
|
|
41
|
+
steps_1.BuildStepInput.createProvider({
|
|
42
|
+
id: 'api_only',
|
|
43
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
46
|
+
steps_1.BuildStepInput.createProvider({
|
|
47
|
+
id: 'platform',
|
|
48
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
49
|
+
required: false,
|
|
50
|
+
defaultValue: 'web',
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
outputProviders: [
|
|
54
|
+
steps_1.BuildStepOutput.createProvider({
|
|
55
|
+
id: 'export_dir',
|
|
56
|
+
required: true,
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
fn: async (stepsCtx, { inputs, outputs, env }) => {
|
|
60
|
+
const outputDir = inputs.output_dir.value;
|
|
61
|
+
const dev = inputs.dev.value;
|
|
62
|
+
const minify = inputs.minify.value;
|
|
63
|
+
const dumpAssetmap = inputs.dump_assetmap.value;
|
|
64
|
+
const ssg = inputs.ssg.value;
|
|
65
|
+
const apiOnly = inputs.api_only.value;
|
|
66
|
+
const platform = inputs.platform.value;
|
|
67
|
+
const packageManager = (0, packageManager_1.resolvePackageManager)(stepsCtx.workingDirectory, { env });
|
|
68
|
+
const exportCommand = getExportCommand({
|
|
69
|
+
outputDir,
|
|
70
|
+
dev,
|
|
71
|
+
minify,
|
|
72
|
+
dumpAssetmap,
|
|
73
|
+
ssg,
|
|
74
|
+
apiOnly,
|
|
75
|
+
platform,
|
|
76
|
+
});
|
|
77
|
+
stepsCtx.logger.info(`Running export command: expo ${exportCommand.join(' ')}`);
|
|
78
|
+
try {
|
|
79
|
+
await (0, project_1.runExpoCliCommand)({
|
|
80
|
+
packageManager,
|
|
81
|
+
args: exportCommand,
|
|
82
|
+
options: {
|
|
83
|
+
cwd: stepsCtx.workingDirectory,
|
|
84
|
+
env,
|
|
85
|
+
logger: stepsCtx.logger,
|
|
86
|
+
stdio: 'pipe',
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
outputs.export_dir.set(outputDir);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
throw new eas_build_job_1.UserError('EXPO_EXPORT_FAILED', `Export command failed: ${error instanceof Error ? error.message : 'unknown error'}`);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function getExportCommand({ outputDir, dev, minify, dumpAssetmap, ssg, apiOnly, platform, }) {
|
|
98
|
+
const exportCommand = ['export', '--output-dir', outputDir, '--platform', platform];
|
|
99
|
+
if (dev) {
|
|
100
|
+
exportCommand.push('--dev');
|
|
101
|
+
}
|
|
102
|
+
if (minify === false) {
|
|
103
|
+
exportCommand.push('--no-minify');
|
|
104
|
+
}
|
|
105
|
+
if (dumpAssetmap) {
|
|
106
|
+
exportCommand.push('--dump-assetmap');
|
|
107
|
+
}
|
|
108
|
+
if (ssg === false) {
|
|
109
|
+
exportCommand.push('--no-ssg');
|
|
110
|
+
}
|
|
111
|
+
if (apiOnly) {
|
|
112
|
+
exportCommand.push('--api-only');
|
|
113
|
+
}
|
|
114
|
+
return exportCommand;
|
|
115
|
+
}
|
|
@@ -10,6 +10,7 @@ const steps_1 = require("@expo/steps");
|
|
|
10
10
|
const template_file_1 = require("@expo/template-file");
|
|
11
11
|
const assert_1 = __importDefault(require("assert"));
|
|
12
12
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
13
|
+
const os_1 = __importDefault(require("os"));
|
|
13
14
|
const path_1 = __importDefault(require("path"));
|
|
14
15
|
const credentials_1 = require("../utils/ios/credentials/credentials");
|
|
15
16
|
const manager_1 = __importDefault(require("../utils/ios/credentials/manager"));
|
|
@@ -38,6 +39,10 @@ const DEFAULT_CREDENTIALS_TEMPLATE = `
|
|
|
38
39
|
disable_xcpretty(true)
|
|
39
40
|
buildlog_path("<%- LOGS_DIRECTORY %>")
|
|
40
41
|
|
|
42
|
+
derived_data_path("<%- DERIVED_DATA_PATH %>")
|
|
43
|
+
result_bundle(true)
|
|
44
|
+
result_bundle_path("<%- RESULT_BUNDLE_PATH %>")
|
|
45
|
+
|
|
41
46
|
output_directory("<%- OUTPUT_DIRECTORY %>")
|
|
42
47
|
`;
|
|
43
48
|
const DEFAULT_SIMULATOR_TEMPLATE = `
|
|
@@ -56,6 +61,9 @@ const DEFAULT_SIMULATOR_TEMPLATE = `
|
|
|
56
61
|
|
|
57
62
|
disable_xcpretty(true)
|
|
58
63
|
buildlog_path("<%- LOGS_DIRECTORY %>")
|
|
64
|
+
|
|
65
|
+
result_bundle(true)
|
|
66
|
+
result_bundle_path("<%- RESULT_BUNDLE_PATH %>")
|
|
59
67
|
`;
|
|
60
68
|
function generateGymfileFromTemplateFunction() {
|
|
61
69
|
return new steps_1.BuildFunction({
|
|
@@ -158,6 +166,7 @@ function generateGymfileFromTemplateFunction() {
|
|
|
158
166
|
ICLOUD_CONTAINER_ENVIRONMENT,
|
|
159
167
|
SCHEME_SIMULATOR_DESTINATION: simulatorDestination,
|
|
160
168
|
DERIVED_DATA_PATH: './build',
|
|
169
|
+
RESULT_BUNDLE_PATH: path_1.default.join(os_1.default.tmpdir(), `result-bundle-${Date.now()}.xcresult`),
|
|
161
170
|
...(PROFILES ? { PROFILES } : {}),
|
|
162
171
|
...(credentials
|
|
163
172
|
? {
|
|
@@ -23,7 +23,7 @@ function createInstallNodeModulesBuildFunction() {
|
|
|
23
23
|
}
|
|
24
24
|
async function installNodeModules(stepCtx, env) {
|
|
25
25
|
const { logger } = stepCtx;
|
|
26
|
-
const packageManager = (0, packageManager_1.resolvePackageManager)(stepCtx.workingDirectory);
|
|
26
|
+
const packageManager = (0, packageManager_1.resolvePackageManager)(stepCtx.workingDirectory, { env });
|
|
27
27
|
const packagerRunDir = (0, packageManager_1.findPackagerRootDir)(stepCtx.workingDirectory);
|
|
28
28
|
if (packagerRunDir !== stepCtx.workingDirectory) {
|
|
29
29
|
const relativeReactNativeProjectDirectory = path_1.default.relative(stepCtx.global.projectTargetDirectory, stepCtx.workingDirectory);
|
|
@@ -0,0 +1,49 @@
|
|
|
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.parseXcactivitylogFunction = parseXcactivitylogFunction;
|
|
7
|
+
const steps_1 = require("@expo/steps");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const xcactivitylog_1 = require("../utils/ios/xcactivitylog");
|
|
10
|
+
function parseXcactivitylogFunction() {
|
|
11
|
+
return new steps_1.BuildFunction({
|
|
12
|
+
namespace: 'eas',
|
|
13
|
+
id: 'parse_xcactivitylog',
|
|
14
|
+
name: 'Analyze build performance',
|
|
15
|
+
__metricsId: 'eas/parse_xcactivitylog',
|
|
16
|
+
supportedRuntimePlatforms: [steps_1.BuildRuntimePlatform.DARWIN],
|
|
17
|
+
inputProviders: [
|
|
18
|
+
steps_1.BuildStepInput.createProvider({
|
|
19
|
+
id: 'derived_data_path',
|
|
20
|
+
required: false,
|
|
21
|
+
defaultValue: 'ios/build',
|
|
22
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
23
|
+
}),
|
|
24
|
+
steps_1.BuildStepInput.createProvider({
|
|
25
|
+
id: 'workspace_path',
|
|
26
|
+
required: false,
|
|
27
|
+
defaultValue: 'ios',
|
|
28
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
29
|
+
}),
|
|
30
|
+
steps_1.BuildStepInput.createProvider({
|
|
31
|
+
id: 'xclogparser_version',
|
|
32
|
+
required: false,
|
|
33
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
fn: async (stepCtx, { inputs, env }) => {
|
|
37
|
+
const derivedDataPath = inputs.derived_data_path.value;
|
|
38
|
+
const workspacePath = inputs.workspace_path.value;
|
|
39
|
+
const version = inputs.xclogparser_version.value;
|
|
40
|
+
await (0, xcactivitylog_1.parseAndReportXcactivitylog)({
|
|
41
|
+
derivedDataPath: path_1.default.resolve(stepCtx.workingDirectory, derivedDataPath),
|
|
42
|
+
workspacePath: path_1.default.resolve(stepCtx.workingDirectory, workspacePath),
|
|
43
|
+
xclogparserVersion: version,
|
|
44
|
+
logger: stepCtx.logger,
|
|
45
|
+
proxyBaseUrl: env.EAS_BUILD_COCOAPODS_CACHE_URL,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -35,7 +35,7 @@ function createPrebuildBuildFunction() {
|
|
|
35
35
|
fn: async (stepCtx, { inputs, env }) => {
|
|
36
36
|
const { logger } = stepCtx;
|
|
37
37
|
const appleTeamId = inputs.apple_team_id.value;
|
|
38
|
-
const packageManager = (0, packageManager_1.resolvePackageManager)(stepCtx.workingDirectory);
|
|
38
|
+
const packageManager = (0, packageManager_1.resolvePackageManager)(stepCtx.workingDirectory, { env });
|
|
39
39
|
const defaultPlatform = process.platform === 'darwin' ? 'ios' : 'android';
|
|
40
40
|
const job = stepCtx.global.staticContext.job;
|
|
41
41
|
const prebuildCommandArgs = getPrebuildCommandArgs({
|
|
@@ -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
|
+
}
|
|
@@ -154,7 +154,7 @@ async function restoreCcacheAsync({ logger, workingDirectory, platform, env, sec
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
async function restoreGradleCacheAsync({ logger, workingDirectory, env, secrets, }) {
|
|
157
|
-
if (env.
|
|
157
|
+
if (env.EAS_GRADLE_CACHE !== '1') {
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
try {
|
|
@@ -112,7 +112,7 @@ async function saveCcacheAsync({ logger, workingDirectory, platform, evictUsedBe
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
async function saveGradleCacheAsync({ logger, workingDirectory, env, secrets, }) {
|
|
115
|
-
if (env.
|
|
115
|
+
if (env.EAS_GRADLE_CACHE !== '1') {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
const gradleCachesPath = path_1.default.join(os_1.default.homedir(), '.gradle', 'caches');
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { bunyan } from '@expo/logger';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Download xclogparser, parse xcactivitylog from derived data, and log a
|
|
5
|
+
* compile metrics report. Never throws — all errors are logged at debug level.
|
|
6
|
+
*
|
|
7
|
+
* Can be called from both the step-based flow (BuildFunction) and the
|
|
8
|
+
* traditional builder flow (runBuildPhase).
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseAndReportXcactivitylog({ derivedDataPath, workspacePath, xclogparserVersion, logger, proxyBaseUrl, }: {
|
|
11
|
+
derivedDataPath: string;
|
|
12
|
+
workspacePath: string;
|
|
13
|
+
xclogparserVersion?: string;
|
|
14
|
+
logger: bunyan;
|
|
15
|
+
proxyBaseUrl?: string;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
declare const XcactivitylogStepSchemaZ: z.ZodObject<{
|
|
18
|
+
title: z.ZodOptional<z.ZodString>;
|
|
19
|
+
detailStepType: z.ZodOptional<z.ZodString>;
|
|
20
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
21
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
startTimestamp: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
endTimestamp: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
subSteps: z.ZodOptional<z.ZodArray<z.ZodObject</*elided*/ any, z.core.$strip>>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
declare const XcactivitylogDataSchemaZ: z.ZodObject<{
|
|
27
|
+
schema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
28
|
+
name: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>]>>;
|
|
30
|
+
subSteps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
|
+
title: z.ZodOptional<z.ZodString>;
|
|
32
|
+
detailStepType: z.ZodOptional<z.ZodString>;
|
|
33
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
34
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
startTimestamp: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
endTimestamp: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
subSteps: z.ZodOptional<z.ZodArray<z.ZodObject</*elided*/ any, z.core.$strip>>>;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
type XcactivitylogStep = z.infer<typeof XcactivitylogStepSchemaZ>;
|
|
41
|
+
type XcactivitylogData = z.infer<typeof XcactivitylogDataSchemaZ>;
|
|
42
|
+
interface TargetMetric {
|
|
43
|
+
moduleName: string;
|
|
44
|
+
taskSeconds: number;
|
|
45
|
+
wallSpan: number;
|
|
46
|
+
activeWallTime: number;
|
|
47
|
+
}
|
|
48
|
+
export declare function isCompileStep(step: Partial<XcactivitylogStep>): boolean;
|
|
49
|
+
export declare function collectTopLevelCompileSteps(step: XcactivitylogStep, results?: XcactivitylogStep[]): XcactivitylogStep[];
|
|
50
|
+
export declare function buildTargetMetrics(data: XcactivitylogData, { minTaskSeconds }?: {
|
|
51
|
+
minTaskSeconds?: number;
|
|
52
|
+
}): {
|
|
53
|
+
results: TargetMetric[];
|
|
54
|
+
totalTaskSeconds: number;
|
|
55
|
+
};
|
|
56
|
+
export declare function formatReport(data: XcactivitylogData): string;
|
|
57
|
+
export {};
|