zarro 1.100.1 → 1.100.4
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/gulp-tasks/build.js
CHANGED
|
@@ -17,7 +17,7 @@ const
|
|
|
17
17
|
tryDo = requireModule("try-do"),
|
|
18
18
|
msbuild = require("gulp-msbuild");
|
|
19
19
|
|
|
20
|
-
gulp.task("prebuild",
|
|
20
|
+
gulp.task("prebuild", gulp.series("nuget-restore", "clean"));
|
|
21
21
|
|
|
22
22
|
const myTasks = ["build"],
|
|
23
23
|
myVars = [
|
|
@@ -51,7 +51,7 @@ gulp.task("quick-build", "Quick build without pre-cursors", tryBuild);
|
|
|
51
51
|
async function tryBuild() {
|
|
52
52
|
return tryDo(
|
|
53
53
|
build,
|
|
54
|
-
|
|
54
|
+
"BUILD_RETRIES",
|
|
55
55
|
e => console.error(chalk.red(`Build fails: ${e}`)),
|
|
56
56
|
() => console.log(chalk.magentaBright(`Build fails! If the error looks transient, I suggest setting the environment variable 'BUILD_RETRIES' to some number > 0 🔨.`))
|
|
57
57
|
);
|
package/gulp-tasks/clean.js
CHANGED
|
@@ -522,9 +522,19 @@ module.exports = function _env(env) {
|
|
|
522
522
|
default: "public"
|
|
523
523
|
});
|
|
524
524
|
|
|
525
|
+
function retryMessage(label) {
|
|
526
|
+
return `Retry ${label} again up to this many times on failure (work around transient errors on build host)`
|
|
527
|
+
}
|
|
528
|
+
|
|
525
529
|
env.register({
|
|
526
530
|
name: "BUILD_RETRIES",
|
|
527
|
-
help: "
|
|
531
|
+
help: retryMessage("the build"),
|
|
532
|
+
default: "0"
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
env.register({
|
|
536
|
+
name: "RESTORE_RETRIES",
|
|
537
|
+
help: retryMessage("nuget package restore"),
|
|
528
538
|
default: "0"
|
|
529
539
|
});
|
|
530
540
|
|
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
const
|
|
2
|
+
chalk = require("ansi-colors"),
|
|
3
|
+
env = requireModule("env"),
|
|
4
|
+
gulp = requireModule("gulp"),
|
|
5
|
+
debug = require("debug")("nuget-restore"),
|
|
6
|
+
nugetRestore = requireModule("./gulp-nuget-restore"),
|
|
7
|
+
promisify = requireModule("promisify"),
|
|
8
|
+
resolveMasks = requireModule("resolve-masks"),
|
|
9
|
+
{ ZarroError } = requireModule("zarro-error"),
|
|
10
|
+
tryDo = requireModule("try-do"),
|
|
11
|
+
findLocalNuget = requireModule("find-local-nuget");
|
|
12
|
+
|
|
13
|
+
const myTasks = [ "nuget-restore" ],
|
|
14
|
+
myVars = [
|
|
15
|
+
"DOTNET_CORE",
|
|
16
|
+
"BUILD_INCLUDE",
|
|
17
|
+
"BUILD_EXCLUDE",
|
|
18
|
+
"BUILD_ADDITIONAL_EXCLUDE",
|
|
19
|
+
"RESTORE_RETRIES"
|
|
20
|
+
];
|
|
21
|
+
env.associate(myVars, myTasks);
|
|
22
|
+
|
|
23
|
+
gulp.task(
|
|
24
|
+
"nuget-restore",
|
|
25
|
+
"Restores all nuget packages in all solutions",
|
|
26
|
+
[ "install-tools" ],
|
|
27
|
+
tryRestore
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
async function tryRestore() {
|
|
31
|
+
tryDo(
|
|
32
|
+
restore,
|
|
33
|
+
"RESTORE_RETRIES",
|
|
34
|
+
e => console.error(chalk.red(`Clean fails: ${e}`))
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function restore() {
|
|
39
|
+
const
|
|
40
|
+
allDNC = env.resolveFlag("DOTNET_CORE"),
|
|
41
|
+
slnMasks = resolveMasks("BUILD_INCLUDE", [ "BUILD_EXCLUDE", "BUILD_EXTRA_EXCLUDE" ]);
|
|
42
|
+
debug({
|
|
43
|
+
allDNC,
|
|
44
|
+
slnMasks,
|
|
45
|
+
cwd: process.cwd()
|
|
46
|
+
});
|
|
47
|
+
const options = {
|
|
48
|
+
debug: false
|
|
49
|
+
};
|
|
50
|
+
const start = allDNC
|
|
51
|
+
? () => Promise.resolve()
|
|
52
|
+
: findLocalNuget();
|
|
53
|
+
if (allDNC) {
|
|
54
|
+
options.nuget = "dotnet";
|
|
55
|
+
}
|
|
56
|
+
await start();
|
|
57
|
+
await promisify(
|
|
58
|
+
gulp.src(slnMasks, { allowEmpty: true })
|
|
59
|
+
.pipe(
|
|
60
|
+
nugetRestore(options)
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
debug("nuget restore complete!");
|
|
64
|
+
}
|