@expo/build-tools 0.1.177 → 0.1.178
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
CHANGED
|
@@ -8,6 +8,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
9
|
const steps_1 = require("@expo/steps");
|
|
10
10
|
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
11
|
+
const context_1 = require("../context");
|
|
11
12
|
const projectSources_1 = require("../common/projectSources");
|
|
12
13
|
async function runCustomBuildAsync(ctx) {
|
|
13
14
|
var _a;
|
|
@@ -17,9 +18,37 @@ async function runCustomBuildAsync(ctx) {
|
|
|
17
18
|
const buildStepContext = new steps_1.BuildStepContext(ctx.env.EAS_BUILD_ID, ctx.logger.child({ phase: eas_build_job_1.BuildPhase.CUSTOM }), false, ctx.reactNativeProjectDirectory);
|
|
18
19
|
const parser = new steps_1.BuildConfigParser(buildStepContext, { configPath });
|
|
19
20
|
const workflow = await parser.parseAsync();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
try {
|
|
22
|
+
try {
|
|
23
|
+
await workflow.executeAsync(ctx.env);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {
|
|
27
|
+
var _a;
|
|
28
|
+
try {
|
|
29
|
+
const artifacts = await workflow.collectArtifactsAsync();
|
|
30
|
+
for (const buildArtifactType of Object.keys(artifacts)) {
|
|
31
|
+
const type = buildArtifactType === steps_1.BuildArtifactType.APPLICATION_ARCHIVE
|
|
32
|
+
? context_1.ArtifactType.APPLICATION_ARCHIVE
|
|
33
|
+
: context_1.ArtifactType.BUILD_ARTIFACTS;
|
|
34
|
+
const filePaths = (_a = artifacts[buildArtifactType]) !== null && _a !== void 0 ? _a : [];
|
|
35
|
+
if (filePaths.length > 0) {
|
|
36
|
+
await ctx.uploadArtifacts(type, filePaths);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
ctx.logger.error({ err }, 'Failed to upload artifacts');
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
await workflow.cleanUpAsync();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
err.artifacts = ctx.artifacts;
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
return ctx.artifacts;
|
|
23
52
|
}
|
|
24
53
|
exports.runCustomBuildAsync = runCustomBuildAsync;
|
|
25
54
|
//# sourceMappingURL=custom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/builders/custom.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/builders/custom.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAsD;AACtD,uCAAqF;AACrF,4DAAoC;AAEpC,wCAAmE;AACnE,6DAAsE;AAE/D,KAAK,UAAU,mBAAmB,CAAgB,GAAoB;;IAC3E,MAAM,IAAA,2CAA0B,EAAC,GAAG,CAAC,CAAC;IAEtC,MAAM,kBAAkB,GAAG,IAAA,oBAAU,EACnC,MAAA,GAAG,CAAC,GAAG,CAAC,iBAAiB,0CAAE,IAAI,EAC/B,uDAAuD,CACxD,CAAC;IACF,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;IAElF,MAAM,gBAAgB,GAAG,IAAI,wBAAgB,CAC3C,GAAG,CAAC,GAAG,CAAC,YAAY,EACpB,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,0BAAU,CAAC,MAAM,EAA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G,CAAC,SAAS,CAAC;AACvB,CAAC;AA/CD,kDA+CC","sourcesContent":["import path from 'path';\n\nimport { BuildPhase, Job } from '@expo/eas-build-job';\nimport { BuildArtifactType, BuildConfigParser, BuildStepContext } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, ArtifactType, BuildContext } from '../context';\nimport { prepareProjectSourcesAsync } from '../common/projectSources';\n\nexport async function runCustomBuildAsync<T extends Job>(ctx: BuildContext<T>): Promise<Artifacts> {\n await prepareProjectSourcesAsync(ctx);\n\n const relativeConfigPath = nullthrows(\n ctx.job.customBuildConfig?.path,\n 'Custom build config must be defined for custom builds'\n );\n const configPath = path.join(ctx.reactNativeProjectDirectory, relativeConfigPath);\n\n const buildStepContext = new BuildStepContext(\n ctx.env.EAS_BUILD_ID,\n ctx.logger.child({ phase: BuildPhase.CUSTOM }),\n false,\n ctx.reactNativeProjectDirectory\n );\n const parser = new BuildConfigParser(buildStepContext, { configPath });\n const workflow = await parser.parseAsync();\n try {\n try {\n await workflow.executeAsync(ctx.env);\n } finally {\n await ctx.runBuildPhase(BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {\n try {\n const artifacts = await workflow.collectArtifactsAsync();\n for (const buildArtifactType of Object.keys(artifacts)) {\n const type: ArtifactType =\n buildArtifactType === BuildArtifactType.APPLICATION_ARCHIVE\n ? ArtifactType.APPLICATION_ARCHIVE\n : ArtifactType.BUILD_ARTIFACTS;\n const filePaths = artifacts[buildArtifactType as BuildArtifactType] ?? [];\n if (filePaths.length > 0) {\n await ctx.uploadArtifacts(type, filePaths);\n }\n }\n } catch (err: any) {\n ctx.logger.error({ err }, 'Failed to upload artifacts');\n }\n });\n\n await workflow.cleanUpAsync();\n }\n } catch (err: any) {\n err.artifacts = ctx.artifacts;\n throw err;\n }\n\n return ctx.artifacts;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.178",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@expo/logger": "0.0.27",
|
|
28
28
|
"@expo/package-manager": "^0.0.57",
|
|
29
29
|
"@expo/plist": "^0.0.20",
|
|
30
|
-
"@expo/steps": "0.0.
|
|
30
|
+
"@expo/steps": "0.0.4",
|
|
31
31
|
"@expo/template-file": "0.1.25",
|
|
32
32
|
"@expo/turtle-spawn": "0.0.28",
|
|
33
33
|
"@expo/xcpretty": "^4.2.2",
|