@expo/build-tools 1.0.163 → 1.0.164-alpha.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/custom.js +13 -8
- package/dist/builders/custom.js.map +1 -1
- package/dist/generic.js +5 -11
- package/dist/generic.js.map +1 -1
- package/package.json +4 -4
package/dist/builders/custom.js
CHANGED
|
@@ -16,7 +16,7 @@ const easFunctionGroups_1 = require("../steps/easFunctionGroups");
|
|
|
16
16
|
const xcodeBuildLogs_1 = require("../ios/xcodeBuildLogs");
|
|
17
17
|
const generic_1 = require("../generic");
|
|
18
18
|
async function runCustomBuildAsync(ctx) {
|
|
19
|
-
var _a
|
|
19
|
+
var _a;
|
|
20
20
|
const customBuildCtx = new customBuildContext_1.CustomBuildContext(ctx);
|
|
21
21
|
await (0, generic_1.addEasWorkflows)(customBuildCtx);
|
|
22
22
|
await (0, projectSources_1.prepareProjectSourcesAsync)(ctx, customBuildCtx.projectSourceDirectory);
|
|
@@ -28,16 +28,21 @@ async function runCustomBuildAsync(ctx) {
|
|
|
28
28
|
ctx.updateEnv(env);
|
|
29
29
|
customBuildCtx.updateEnv(ctx.env);
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const configPath = path_1.default.join(ctx.getReactNativeProjectDirectory(customBuildCtx.projectSourceDirectory), relativeConfigPath);
|
|
31
|
+
const customBuildConfig = (0, nullthrows_1.default)(ctx.job.customBuildConfig, 'Custom build config must be defined for custom builds');
|
|
33
32
|
const globalContext = new steps_1.BuildStepGlobalContext(customBuildCtx, false);
|
|
34
33
|
const easFunctions = (0, easFunctions_1.getEasFunctions)(customBuildCtx);
|
|
35
34
|
const easFunctionGroups = (0, easFunctionGroups_1.getEasFunctionGroups)(customBuildCtx);
|
|
36
|
-
const parser =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const parser = customBuildConfig.steps
|
|
36
|
+
? new steps_1.StepsConfigParser(globalContext, {
|
|
37
|
+
externalFunctions: easFunctions,
|
|
38
|
+
externalFunctionGroups: easFunctionGroups,
|
|
39
|
+
steps: customBuildConfig.steps,
|
|
40
|
+
})
|
|
41
|
+
: new steps_1.BuildConfigParser(globalContext, {
|
|
42
|
+
externalFunctions: easFunctions,
|
|
43
|
+
externalFunctionGroups: easFunctionGroups,
|
|
44
|
+
configPath: path_1.default.join(ctx.getReactNativeProjectDirectory(customBuildCtx.projectSourceDirectory), customBuildConfig.path),
|
|
45
|
+
});
|
|
41
46
|
const workflow = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PARSE_CUSTOM_WORKFLOW_CONFIG, async () => {
|
|
42
47
|
try {
|
|
43
48
|
return await parser.parseAsync();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/builders/custom.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAwF;AACxF,
|
|
1
|
+
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/builders/custom.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAwF;AACxF,uCAAmG;AACnG,4DAAoC;AAGpC,6DAAsE;AACtE,wDAAwD;AACxD,8DAA2D;AAC3D,iEAA6E;AAC7E,kEAAkE;AAClE,0DAAyE;AACzE,wCAA6C;AAEtC,KAAK,UAAU,mBAAmB,CAAC,GAA2B;;IACnE,MAAM,cAAc,GAAG,IAAI,uCAAkB,CAAC,GAAG,CAAC,CAAC;IACnD,MAAM,IAAA,yBAAe,EAAC,cAAc,CAAC,CAAC;IACtC,MAAM,IAAA,2CAA0B,EAAC,GAAG,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAC;IAC7E,IAAI,GAAG,CAAC,GAAG,CAAC,WAAW,KAAK,4BAAY,CAAC,qBAAqB,EAAE,CAAC;QAC/D,sCAAsC;QACtC,MAAM,GAAG,GAAG,MAAM,IAAA,kDAA+B,EAAC,GAAG,EAAE;YACrD,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,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;YAClE,IAAI,UAAU,YAAY,cAAM,CAAC,kBAAkB,EAAE,CAAC;gBACpD,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;oBACpC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;YACD,MAAM,UAAU,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,IAAI,CAAC;QACH,IAAI,CAAC;YACH,MAAM,QAAQ,CAAC,YAAY,EAAE,CAAC;QAChC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,gBAAgB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,EAAE,CAAC;gBACzE,IAAI,CAAC;oBACH,MAAM,IAAA,iDAAgC,EAAC,GAA4B,EAAE;wBACnE,MAAM,EAAE,GAAG,CAAC,MAAM;qBACnB,CAAC,CAAC;gBACL,CAAC;gBAAC,MAAM,CAAC;oBACP,yCAAyC;gBAC3C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC9B,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC;AApED,kDAoEC","sourcesContent":["import path from 'path';\n\nimport { BuildJob, BuildPhase, BuildTrigger, Ios, Platform } from '@expo/eas-build-job';\nimport { BuildConfigParser, BuildStepGlobalContext, StepsConfigParser, errors } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, BuildContext } from '../context';\nimport { prepareProjectSourcesAsync } from '../common/projectSources';\nimport { getEasFunctions } from '../steps/easFunctions';\nimport { CustomBuildContext } from '../customBuildContext';\nimport { resolveEnvFromBuildProfileAsync } from '../common/easBuildInternal';\nimport { getEasFunctionGroups } from '../steps/easFunctionGroups';\nimport { findAndUploadXcodeBuildLogsAsync } from '../ios/xcodeBuildLogs';\nimport { addEasWorkflows } from '../generic';\n\nexport async function runCustomBuildAsync(ctx: BuildContext<BuildJob>): Promise<Artifacts> {\n const customBuildCtx = new CustomBuildContext(ctx);\n await addEasWorkflows(customBuildCtx);\n await prepareProjectSourcesAsync(ctx, customBuildCtx.projectSourceDirectory);\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n // We need to setup envs from eas.json\n const env = await resolveEnvFromBuildProfileAsync(ctx, {\n cwd: path.join(customBuildCtx.projectSourceDirectory, ctx.job.projectRootDirectory ?? '.'),\n });\n ctx.updateEnv(env);\n customBuildCtx.updateEnv(ctx.env);\n }\n\n const customBuildConfig = nullthrows(\n ctx.job.customBuildConfig,\n 'Custom build config must be defined for custom builds'\n );\n\n const globalContext = new BuildStepGlobalContext(customBuildCtx, false);\n const easFunctions = getEasFunctions(customBuildCtx);\n const easFunctionGroups = getEasFunctionGroups(customBuildCtx);\n const parser = customBuildConfig.steps\n ? new StepsConfigParser(globalContext, {\n externalFunctions: easFunctions,\n externalFunctionGroups: easFunctionGroups,\n steps: customBuildConfig.steps,\n })\n : new BuildConfigParser(globalContext, {\n externalFunctions: easFunctions,\n externalFunctionGroups: easFunctionGroups,\n configPath: path.join(\n ctx.getReactNativeProjectDirectory(customBuildCtx.projectSourceDirectory),\n customBuildConfig.path\n ),\n });\n const workflow = await ctx.runBuildPhase(BuildPhase.PARSE_CUSTOM_WORKFLOW_CONFIG, async () => {\n try {\n return await parser.parseAsync();\n } catch (parseError: any) {\n ctx.logger.error('Failed to parse the custom build config file.');\n if (parseError instanceof errors.BuildWorkflowError) {\n for (const err of parseError.errors) {\n ctx.logger.error({ err });\n }\n }\n throw parseError;\n }\n });\n try {\n try {\n await workflow.executeAsync();\n } finally {\n if (!ctx.artifacts.XCODE_BUILD_LOGS && ctx.job.platform === Platform.IOS) {\n try {\n await findAndUploadXcodeBuildLogsAsync(ctx as BuildContext<Ios.Job>, {\n logger: ctx.logger,\n });\n } catch {\n // do nothing, it's a non-breaking error.\n }\n }\n }\n } catch (err: any) {\n err.artifacts = ctx.artifacts;\n throw err;\n }\n\n return ctx.artifacts;\n}\n"]}
|
package/dist/generic.js
CHANGED
|
@@ -19,17 +19,11 @@ async function runGenericJobAsync(ctx, { expoApiV2BaseUrl }) {
|
|
|
19
19
|
await (0, projectSources_1.prepareProjectSourcesAsync)(ctx, customBuildCtx.projectSourceDirectory);
|
|
20
20
|
await addEasWorkflows(customBuildCtx);
|
|
21
21
|
const globalContext = new steps_1.BuildStepGlobalContext(customBuildCtx, false);
|
|
22
|
-
const parser =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
: new steps_1.BuildConfigParser(globalContext, {
|
|
29
|
-
externalFunctions: (0, easFunctions_1.getEasFunctions)(customBuildCtx),
|
|
30
|
-
externalFunctionGroups: (0, easFunctionGroups_1.getEasFunctionGroups)(customBuildCtx),
|
|
31
|
-
configPath: path_1.default.join(customBuildCtx.projectSourceDirectory, ctx.job.customBuildConfig.path),
|
|
32
|
-
});
|
|
22
|
+
const parser = new steps_1.StepsConfigParser(globalContext, {
|
|
23
|
+
externalFunctions: (0, easFunctions_1.getEasFunctions)(customBuildCtx),
|
|
24
|
+
externalFunctionGroups: (0, easFunctionGroups_1.getEasFunctionGroups)(customBuildCtx),
|
|
25
|
+
steps: ctx.job.steps,
|
|
26
|
+
});
|
|
33
27
|
const workflow = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PARSE_CUSTOM_WORKFLOW_CONFIG, async () => {
|
|
34
28
|
try {
|
|
35
29
|
return await parser.parseAsync();
|
package/dist/generic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../src/generic.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MAAM,EAAE,CAAC;oBACpC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;YACD,MAAM,UAAU,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,MAAM,IAAA,qBAAW,EAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IAE7D,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,IAAA,oCAA0B,EAAC,GAAG,EAAE;YACpC,KAAK,EAAE,QAAQ,CAAC,UAAU;YAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AAChD,CAAC;AA3CD,gDA2CC;AAEM,KAAK,UAAU,eAAe,CAAC,cAAkC;IACtE,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,cAAc,CAAC,sBAAsB,EAAE,OAAO,CAAC,EAAE;QACjF,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IAEH,MAAM,YAAE,CAAC,QAAQ,CAAC,EAAE,CAClB,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAChD,cAAI,CAAC,IAAI,CAAC,cAAc,CAAC,sBAAsB,EAAE,OAAO,CAAC,EACzD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;AACJ,CAAC;AAVD,0CAUC","sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { BuildPhase, Generic } from '@expo/eas-build-job';\nimport { BuildStepGlobalContext, BuildWorkflow, errors, StepsConfigParser } from '@expo/steps';\nimport { Result, asyncResult } from '@expo/results';\n\nimport { BuildContext } from './context';\nimport { prepareProjectSourcesAsync } from './common/projectSources';\nimport { getEasFunctions } from './steps/easFunctions';\nimport { CustomBuildContext } from './customBuildContext';\nimport { getEasFunctionGroups } from './steps/easFunctionGroups';\nimport { uploadJobOutputsToWwwAsync } from './utils/outputs';\n\nexport async function runGenericJobAsync(\n ctx: BuildContext<Generic.Job>,\n { expoApiV2BaseUrl }: { expoApiV2BaseUrl: string }\n): Promise<{ runResult: Result<void>; buildWorkflow: BuildWorkflow }> {\n const customBuildCtx = new CustomBuildContext(ctx);\n\n await prepareProjectSourcesAsync(ctx, customBuildCtx.projectSourceDirectory);\n\n await addEasWorkflows(customBuildCtx);\n\n const globalContext = new BuildStepGlobalContext(customBuildCtx, false);\n\n const parser = new StepsConfigParser(globalContext, {\n externalFunctions: getEasFunctions(customBuildCtx),\n externalFunctionGroups: getEasFunctionGroups(customBuildCtx),\n steps: ctx.job.steps,\n });\n\n const workflow = await ctx.runBuildPhase(BuildPhase.PARSE_CUSTOM_WORKFLOW_CONFIG, async () => {\n try {\n return await parser.parseAsync();\n } catch (parseError: any) {\n ctx.logger.error('Failed to parse the job definition file.');\n if (parseError instanceof errors.BuildWorkflowError) {\n for (const err of parseError.errors) {\n ctx.logger.error({ err });\n }\n }\n throw parseError;\n }\n });\n\n const runResult = await asyncResult(workflow.executeAsync());\n\n await ctx.runBuildPhase(BuildPhase.COMPLETE_JOB, async () => {\n await uploadJobOutputsToWwwAsync(ctx, {\n steps: workflow.buildSteps,\n logger: ctx.logger,\n expoApiV2BaseUrl,\n });\n });\n\n return { runResult, buildWorkflow: workflow };\n}\n\nexport async function addEasWorkflows(customBuildCtx: CustomBuildContext): Promise<void> {\n await fs.promises.mkdir(path.join(customBuildCtx.projectSourceDirectory, '__eas'), {\n recursive: true,\n });\n\n await fs.promises.cp(\n path.join(__dirname, '..', 'resources', '__eas'),\n path.join(customBuildCtx.projectSourceDirectory, '__eas'),\n { recursive: true }\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.164-alpha.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"@expo/config": "10.0.6",
|
|
26
26
|
"@expo/config-plugins": "9.0.12",
|
|
27
27
|
"@expo/downloader": "1.0.118",
|
|
28
|
-
"@expo/eas-build-job": "1.0.
|
|
28
|
+
"@expo/eas-build-job": "1.0.164-alpha.0",
|
|
29
29
|
"@expo/env": "^0.4.0",
|
|
30
30
|
"@expo/logger": "1.0.117",
|
|
31
31
|
"@expo/package-manager": "1.7.0",
|
|
32
32
|
"@expo/plist": "^0.2.0",
|
|
33
33
|
"@expo/repack-app": "0.0.6",
|
|
34
34
|
"@expo/results": "^1.0.0",
|
|
35
|
-
"@expo/steps": "1.0.
|
|
35
|
+
"@expo/steps": "1.0.164-alpha.0",
|
|
36
36
|
"@expo/template-file": "1.0.117",
|
|
37
37
|
"@expo/turtle-spawn": "1.0.117",
|
|
38
38
|
"@expo/xcpretty": "^4.3.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"node": "20.14.0",
|
|
75
75
|
"yarn": "1.22.21"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "75a90c3f4ecb2a123425e02c7b3f6ce22c490bd6"
|
|
78
78
|
}
|