zarro 1.168.0 → 1.168.3

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.
@@ -20,8 +20,16 @@
20
20
  const node = packageVersionPropGroup.PackageVersion;
21
21
  const newVersion = incrementVersion(node[0], env.resolveFlag("BETA")
22
22
  ? env.resolveWithFallback(env.VERSION_INCREMENT_STRATEGY, "prerelease")
23
- : env.resolve(env.VERSION_INCREMENT_STRATEGY), env.resolveFlag("VERSION_INCREMENT_ZERO"), env.resolveNumber("PACK_INCREMENT_VERSION_BY"));
23
+ : env.resolve(env.VERSION_INCREMENT_STRATEGY), env.resolveFlag(env.VERSION_INCREMENT_ZERO), env.resolveNumber(env.PACK_INCREMENT_VERSION_BY));
24
24
  node[0] = newVersion;
25
+ const incrementProjectVersion = env.resolveFlag(env.PACK_SYNC_PROJECT_VERSION);
26
+ if (incrementProjectVersion) {
27
+ const projectVersionPropGroup = xml.Project.PropertyGroup.filter((g) => !!g.Version);
28
+ if (!projectVersionPropGroup) {
29
+ throw new ZarroError(`${env.PACK_SYNC_PROJECT_VERSION} was set, but no PropertyGroup with a Version child was found.`);
30
+ }
31
+ projectVersionPropGroup.Version[0] = newVersion;
32
+ }
25
33
  let packageIdPropGroup = xml.Project.PropertyGroup.filter((g) => !!g.PackageId)[0];
26
34
  let packageName = "(unknown)";
27
35
  if (!packageIdPropGroup) {
@@ -12,7 +12,7 @@
12
12
  });
13
13
  env.register({
14
14
  name: "BUILD_TOOLS_INSTALL_FORCE_NUGET_EXE",
15
- help: `Flag: when set, revert to the original behavior for downloading tooling via nuget.exe
15
+ help: `Flag: when set, revert to the original behavior for downloading tooling via nuget.exe
16
16
  (default is to use node-nuget-client since nuget.exe now refuses to download packages marked as tools)`,
17
17
  default: "false"
18
18
  });
@@ -157,8 +157,8 @@
157
157
  default: "auto",
158
158
  help: "process model for nunit-runner to use"
159
159
  });
160
- const extra = `
161
- - globs match dotnet core projects or .net framework built assemblies
160
+ const extra = `
161
+ - globs match dotnet core projects or .net framework built assemblies
162
162
  - elements surrounded with () are treated as pure gulp.src masks`, defaultTestInclude = "*.Tests,*.Tests.*,Tests,Test,Test.*", defaultTestExclude = `{!**/node_modules/**/*},{!./${getToolsFolder(env)}/**/*}`;
163
163
  env.register({
164
164
  name: "TEST_INCLUDE",
@@ -502,6 +502,11 @@
502
502
  help: "Flag: should package version be incremented before packing?",
503
503
  default: "true"
504
504
  });
505
+ env.register({
506
+ name: "PACK_SYNC_PROJECT_VERSION",
507
+ help: "Flag: should the project version be synchronised with the package version when packing?",
508
+ default: "false"
509
+ });
505
510
  env.register({
506
511
  name: "PACK_INCREMENT_VERSION_BY",
507
512
  help: "Number (default 1): increment the selected version number by this value",
@@ -656,9 +661,9 @@
656
661
  env.register({
657
662
  name: "ZARRO_ALLOW_FILE_RESOLUTION",
658
663
  default: "true",
659
- help: `when enabled, the value provided by an environment variable may be the path
660
- to a file to use for that configuration; for example MSBUILD_PROPERTIES=foo.json will
661
- instruct Zarro to read the mapping in foo.json for extra msbuild properties to pass on
664
+ help: `when enabled, the value provided by an environment variable may be the path
665
+ to a file to use for that configuration; for example MSBUILD_PROPERTIES=foo.json will
666
+ instruct Zarro to read the mapping in foo.json for extra msbuild properties to pass on
662
667
  where applicable.`
663
668
  });
664
669
  env.register({