From 0d5d730d0d7b1bb3ef9ca13a4302a6257ff91a56 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Fri, 13 Mar 2020 15:14:23 +0200 Subject: [PATCH] use /output json and /output buildserver --- dist/azure/gitversion/execute/bundle.js | 4 ++-- dist/azure/gitversion/setup/bundle.js | 4 ++-- dist/github/gitversion/execute/bundle.js | 4 ++-- dist/github/gitversion/setup/bundle.js | 4 ++-- dist/mock/gitversion/execute/bundle.js | 4 ++-- dist/mock/gitversion/setup/bundle.js | 4 ++-- src/tasks/gitversion/main.ts | 4 +++- src/tools/gitversion/tool.ts | 2 +- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dist/azure/gitversion/execute/bundle.js b/dist/azure/gitversion/execute/bundle.js index ca8d12294..1151e1c31 100644 --- a/dist/azure/gitversion/execute/bundle.js +++ b/dist/azure/gitversion/execute/bundle.js @@ -460,7 +460,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tasks/gitversion/main.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),n=JSON.parse(t.stdout);l.writeGitVersionToAgent(n),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tools/gitversion/models.ts": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),{stdout:n}=t,r=n.substr(n.indexOf("{")),i=JSON.parse(r);l.writeGitVersionToAgent(i),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tools/gitversion/models.ts": /*!****************************************!*\ !*** ./src/tools/gitversion/models.ts ***! \****************************************/ @@ -472,7 +472,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tools/gitversion/tool.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json","/output","buildserver"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: /*!*************************!*\ !*** external "assert" ***! \*************************/ diff --git a/dist/azure/gitversion/setup/bundle.js b/dist/azure/gitversion/setup/bundle.js index 6ba272502..f5290a6b7 100644 --- a/dist/azure/gitversion/setup/bundle.js +++ b/dist/azure/gitversion/setup/bundle.js @@ -456,7 +456,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tasks/gitversion/main.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),n=JSON.parse(t.stdout);l.writeGitVersionToAgent(n),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tasks/gitversion/setup.ts": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),{stdout:n}=t,r=n.substr(n.indexOf("{")),i=JSON.parse(r);l.writeGitVersionToAgent(i),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tasks/gitversion/setup.ts": /*!***************************************!*\ !*** ./src/tasks/gitversion/setup.ts ***! \***************************************/ @@ -472,7 +472,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tools/gitversion/tool.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json","/output","buildserver"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: /*!*************************!*\ !*** external "assert" ***! \*************************/ diff --git a/dist/github/gitversion/execute/bundle.js b/dist/github/gitversion/execute/bundle.js index aee76de9b..ea3c053c3 100644 --- a/dist/github/gitversion/execute/bundle.js +++ b/dist/github/gitversion/execute/bundle.js @@ -333,7 +333,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tasks/gitversion/main.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),n=JSON.parse(t.stdout);l.writeGitVersionToAgent(n),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tools/gitversion/models.ts": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),{stdout:n}=t,r=n.substr(n.indexOf("{")),i=JSON.parse(r);l.writeGitVersionToAgent(i),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tools/gitversion/models.ts": /*!****************************************!*\ !*** ./src/tools/gitversion/models.ts ***! \****************************************/ @@ -345,7 +345,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tools/gitversion/tool.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json","/output","buildserver"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: /*!*************************!*\ !*** external "assert" ***! \*************************/ diff --git a/dist/github/gitversion/setup/bundle.js b/dist/github/gitversion/setup/bundle.js index d48f9cb5e..e198e17b8 100644 --- a/dist/github/gitversion/setup/bundle.js +++ b/dist/github/gitversion/setup/bundle.js @@ -329,7 +329,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tasks/gitversion/main.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),n=JSON.parse(t.stdout);l.writeGitVersionToAgent(n),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tasks/gitversion/setup.ts": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),{stdout:n}=t,r=n.substr(n.indexOf("{")),i=JSON.parse(r);l.writeGitVersionToAgent(i),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tasks/gitversion/setup.ts": /*!***************************************!*\ !*** ./src/tasks/gitversion/setup.ts ***! \***************************************/ @@ -345,7 +345,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tools/gitversion/tool.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json","/output","buildserver"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: /*!*************************!*\ !*** external "assert" ***! \*************************/ diff --git a/dist/mock/gitversion/execute/bundle.js b/dist/mock/gitversion/execute/bundle.js index f8d98effa..48dcd60e7 100644 --- a/dist/mock/gitversion/execute/bundle.js +++ b/dist/mock/gitversion/execute/bundle.js @@ -261,7 +261,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tasks/gitversion/main.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),n=JSON.parse(t.stdout);l.writeGitVersionToAgent(n),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tools/gitversion/models.ts": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),{stdout:n}=t,r=n.substr(n.indexOf("{")),i=JSON.parse(r);l.writeGitVersionToAgent(i),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tools/gitversion/models.ts": /*!****************************************!*\ !*** ./src/tools/gitversion/models.ts ***! \****************************************/ @@ -273,7 +273,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tools/gitversion/tool.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json","/output","buildserver"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: /*!*************************!*\ !*** external "assert" ***! \*************************/ diff --git a/dist/mock/gitversion/setup/bundle.js b/dist/mock/gitversion/setup/bundle.js index 5ffe6fe9c..9689b777e 100644 --- a/dist/mock/gitversion/setup/bundle.js +++ b/dist/mock/gitversion/setup/bundle.js @@ -257,7 +257,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tasks/gitversion/main.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),n=JSON.parse(t.stdout);l.writeGitVersionToAgent(n),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tasks/gitversion/setup.ts": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(/*! ../../core/models */"./src/core/models.ts"),s=n(/*! ../../core/settings */"./src/core/settings.ts"),a=n(/*! ../../tools/gitversion/settings */"./src/tools/gitversion/settings.ts"),u=n(/*! ../../tools/gitversion/tool */"./src/tools/gitversion/tool.ts"),c=i(n(/*! ../../core/ioc */"./src/core/ioc.ts"));c.default.bind(o.TYPES.IGitVersionTool).to(u.GitVersionTool);const l=c.default.get(o.TYPES.IGitVersionTool),d=c.default.get(o.TYPES.IBuildAgent);t.setup=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=s.Settings.getSetupSettings(d);yield l.install(e.versionSpec,e.includePrerelease),d.setSucceeded("GitVersion installed successfully",!0)}catch(e){d.setFailed(e.message,!0)}}))},t.run=function(){return r(this,void 0,void 0,(function*(){try{l.disableTelemetry();const e=a.Settings.getGitVersionSettings(d),t=yield l.run(e),{stdout:n}=t,r=n.substr(n.indexOf("{")),i=JSON.parse(r);l.writeGitVersionToAgent(i),0===t.code?d.setSucceeded("GitVersion executed successfully",!0):d.setFailed(t.error.message,!0)}catch(e){d.setFailed(e,!0)}}))}},"./src/tasks/gitversion/setup.ts": /*!***************************************!*\ !*** ./src/tasks/gitversion/setup.ts ***! \***************************************/ @@ -273,7 +273,7 @@ var n;!function(e){!function(t){var n="object"==typeof global?global:"object"==t /*!**************************************!*\ !*** ./src/tools/gitversion/tool.ts ***! \**************************************/ -/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const a=n(/*! path */"path"),u=n(/*! inversify */"./node_modules/inversify/lib/inversify.js"),c=n(/*! ../../core/models */"./src/core/models.ts"),l=n(/*! ../../core/dotnet-tool */"./src/core/dotnet-tool.ts");let d=class extends l.DotnetTool{constructor(e,t){super(e,t)}install(e,t){return s(this,void 0,void 0,(function*(){yield this.toolInstall("GitVersion.Tool",e,!1,t)}))}run(e){const t=this.getRepoDir(e.targetPath),n=this.getArguments(t,e);return this.execute("dotnet-gitversion",n)}getRepoDir(e){let t;const n=this.buildAgent.getSourceDir()||".";if(e){if(!this.buildAgent.directoryExists(e))throw new Error("Directory not found at "+e);t=a.join(n,e)}else t=n;return t.replace(/\\/g,"/")}getArguments(e,t){const n=[e,"/output","json","/output","buildserver"],{useConfigFile:r,configFilePath:i,updateAssemblyInfo:o,updateAssemblyInfoFilename:s,additionalArguments:a}=t;if(r){if(!this.buildAgent.isValidInputFile("configFilePath",i))throw new Error("GitVersion configuration file not found at "+i);n.push("/config",i)}if(o){if(n.push("/updateassemblyinfo"),!this.buildAgent.isValidInputFile("updateAssemblyInfoFilename",s))throw new Error("AssemblyInfoFilename file not found at "+s);n.push(s)}return a&&n.push(a),n}writeGitVersionToAgent(e){this.buildAgent.setOutput("major",e.Major.toString()),this.buildAgent.setOutput("minor",e.Minor.toString()),this.buildAgent.setOutput("patch",e.Patch.toString()),this.buildAgent.setOutput("preReleaseTag",e.PreReleaseTag),this.buildAgent.setOutput("preReleaseTagWithDash",e.PreReleaseTagWithDash),this.buildAgent.setOutput("preReleaseLabel",e.PreReleaseLabel),this.buildAgent.setOutput("preReleaseNumber",e.PreReleaseNumber.toString()),this.buildAgent.setOutput("weightedPreReleaseNumber",e.WeightedPreReleaseNumber.toString()),this.buildAgent.setOutput("buildMetaData",e.BuildMetaData.toString()),this.buildAgent.setOutput("buildMetaDataPadded",e.BuildMetaDataPadded),this.buildAgent.setOutput("fullBuildMetaData",e.FullBuildMetaData),this.buildAgent.setOutput("majorMinorPatch",e.MajorMinorPatch),this.buildAgent.setOutput("semVer",e.SemVer),this.buildAgent.setOutput("legacySemVer",e.LegacySemVer),this.buildAgent.setOutput("legacySemVerPadded",e.LegacySemVerPadded),this.buildAgent.setOutput("assemblySemVer",e.AssemblySemVer),this.buildAgent.setOutput("assemblySemFileVer",e.AssemblySemFileVer),this.buildAgent.setOutput("fullSemVer",e.FullSemVer),this.buildAgent.setOutput("informationalVersion",e.InformationalVersion),this.buildAgent.setOutput("branchName",e.BranchName),this.buildAgent.setOutput("sha",e.Sha),this.buildAgent.setOutput("shortSha",e.ShortSha),this.buildAgent.setOutput("nuGetVersionV2",e.NuGetVersionV2),this.buildAgent.setOutput("nuGetVersion",e.NuGetVersion),this.buildAgent.setOutput("nuGetPreReleaseTagV2",e.NuGetPreReleaseTagV2),this.buildAgent.setOutput("nuGetPreReleaseTag",e.NuGetPreReleaseTag),this.buildAgent.setOutput("versionSourceSha",e.VersionSourceSha),this.buildAgent.setOutput("commitsSinceVersionSource",e.CommitsSinceVersionSource.toString()),this.buildAgent.setOutput("commitsSinceVersionSourcePadded",e.CommitsSinceVersionSourcePadded),this.buildAgent.setOutput("commitDate",e.CommitDate)}};d=r([u.injectable(),o(0,u.inject(c.TYPES.IBuildAgent)),o(1,u.inject(c.TYPES.IVersionManager)),i("design:paramtypes",[Object,Object])],d),t.GitVersionTool=d},assert: /*!*************************!*\ !*** external "assert" ***! \*************************/ diff --git a/src/tasks/gitversion/main.ts b/src/tasks/gitversion/main.ts index b64777f1d..e18974e86 100644 --- a/src/tasks/gitversion/main.ts +++ b/src/tasks/gitversion/main.ts @@ -40,8 +40,10 @@ export async function run() { ) const result = await gitVersionTool.run(settings) + const { stdout } = result + const jsonOutput = stdout.substr(stdout.indexOf("{")) - const gitversion = JSON.parse(result.stdout) as GitVersionOutput + const gitversion = JSON.parse(jsonOutput) as GitVersionOutput gitVersionTool.writeGitVersionToAgent(gitversion) if (result.code === 0) { diff --git a/src/tools/gitversion/tool.ts b/src/tools/gitversion/tool.ts index 5878a29f1..a7365e9e4 100644 --- a/src/tools/gitversion/tool.ts +++ b/src/tools/gitversion/tool.ts @@ -60,7 +60,7 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool { workDir: string, options: GitVersionSettings ): string[] { - const args = [workDir, '/output', 'json'] + const args = [workDir, '/output', 'json', '/output', 'buildserver'] const { useConfigFile,