zarro 1.207.0 → 1.208.1

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.
@@ -26,7 +26,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  gulp.task("build", "Builds Visual Studio solutions in tree", ["prebuild"], tryBuild);
27
27
  gulp.task("quick-build", "Quick build without pre-cursors", tryBuild);
28
28
  async function tryBuild() {
29
- return tryDo(build, "BUILD_RETRIES", e => console.error(chalk.red(`Build fails: ${e}`)), () => console.log(chalk.magentaBright(`Build fails! If the error looks transient, I suggest setting the environment variable 'BUILD_RETRIES' to some number > 0 🔨.`)));
29
+ return tryDo(build, "BUILD_RETRIES", e => console.error(chalk.red(`Build fails: ${e}`)), e => console.log(chalk.magentaBright(`
30
+ Build fails!
31
+
32
+ ${e}
33
+
34
+ If the error looks transient, I suggest setting the environment
35
+ variable 'BUILD_RETRIES' to some number > 0
36
+ `.trim())));
30
37
  }
31
38
  async function build() {
32
39
  const slnMasks = resolveMasks(env.BUILD_INCLUDE, [env.BUILD_EXCLUDE, env.BUILD_ADDITIONAL_EXCLUDE]);
@@ -55,6 +62,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
55
62
  if (!env.resolveFlag(env.BUILD_MSBUILD_NODE_REUSE)) {
56
63
  msbuildArgs.push("/nodeReuse:false");
57
64
  }
65
+ const concurrency = env.resolveNumber(env.BUILD_MAX_CPU_COUNT);
66
+ msbuildArgs.push(`/m:${concurrency}`);
58
67
  /** @type DotNetBuildOptions */
59
68
  const options = {
60
69
  target: "[not set]",
@@ -376,12 +376,12 @@
376
376
  }
377
377
  return result;
378
378
  }
379
- function resolveNumber(name) {
380
- const value = resolveInternal(name), asNumber = parseInt(value || "", 10);
379
+ function resolveNumber(...names) {
380
+ const value = resolveInternal(names), asNumber = parseInt(value || "", 10);
381
381
  if (isNaN(asNumber)) {
382
382
  throw new ZarroError(`${value} is not a valid numeric value for ${name}`);
383
383
  }
384
- logResolved(name, asNumber);
384
+ logResolved(names, asNumber);
385
385
  return asNumber;
386
386
  }
387
387
  const positiveFlags = ["yes", "true", "1"];
@@ -30,7 +30,7 @@
30
30
  else {
31
31
  if (requestedRetries < 1) {
32
32
  if (onFinalFailure) {
33
- await onFinalFailure();
33
+ await onFinalFailure(e);
34
34
  }
35
35
  else {
36
36
  console.log(chalk.magentaBright(`Failed after ${totalAttempts} attempts`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.207.0",
3
+ "version": "1.208.1",
4
4
  "description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
5
5
  "bin": {
6
6
  "zarro": "index.js"
package/types.d.ts CHANGED
@@ -149,7 +149,7 @@ declare global {
149
149
  logic: AsyncVoidFunc<T>,
150
150
  retries: number | string,
151
151
  onTransientError?: ErrorReporter,
152
- onFinalFailure?: VoidVoid
152
+ onFinalFailure?: ((e: Error) => void) | ((e: Error) => Promise<void>)
153
153
  ) => Promise<T>;
154
154
  type Optional<T> = T | undefined;
155
155
  type Nullable<T> = T | null;
@@ -585,7 +585,7 @@ declare global {
585
585
 
586
586
  resolveMergedArray(name: AnyEnvVar | AnyEnvVar[], delimiter?: string): string[];
587
587
 
588
- resolveNumber(name: NumericEnvVar): number;
588
+ resolveNumber(...names: NumericEnvVar[]): number;
589
589
 
590
590
  resolveFlag(name: FlagEnvVar, fallback?: boolean): boolean;
591
591