From f10a5132e9a1353123d528a2b398935c9ea6fae9 Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Mon, 21 Sep 2015 13:59:31 +0300 Subject: [PATCH] Improved NuGet packages versioning --- BuildServer/lib/tasks/dotnetbuild.js | 1 + BuildServer/lib/tasks/dotnetnugetpack.js | 2 +- BuildServer/lib/tasks/dotnetnugetprocess.js | 6 ++++-- BuildServer/lib/tasks/dotnetnugetpush.js | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/BuildServer/lib/tasks/dotnetbuild.js b/BuildServer/lib/tasks/dotnetbuild.js index 139f477..f91efa9 100644 --- a/BuildServer/lib/tasks/dotnetbuild.js +++ b/BuildServer/lib/tasks/dotnetbuild.js @@ -22,6 +22,7 @@ module.exports = function (params, processor) { params: { solution: params.solution, skipCodeSigning: params.skipCodeSigning, + ignoreCodeAnalysis: params.ignoreCodeAnalysis, target: "Build" } } diff --git a/BuildServer/lib/tasks/dotnetnugetpack.js b/BuildServer/lib/tasks/dotnetnugetpack.js index cca1b53..55327dc 100644 --- a/BuildServer/lib/tasks/dotnetnugetpack.js +++ b/BuildServer/lib/tasks/dotnetnugetpack.js @@ -4,7 +4,7 @@ var sequential = require('./sequential'); module.exports = function (params, processor) { var date = new Date(), - version = params.version || ((params.major || "0") + "." + date.getFullYear() + "." + ((date.getMonth() + 1) * 100 + date.getDate()) + "." + ((date.getHours() * 100 + date.getMinutes()) * 100 + date.getSeconds())), + version = (params.version || ((params.major || "0") + "." + (date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate()) + "." + ((date.getHours() * 100 + date.getMinutes()) * 100 + date.getSeconds()))) + "-r" + processor.context.rev.substr(0, 16), nupkg = processor.context.exported + "/" + params.name + "." + version + ".nupkg"; return sequential({ diff --git a/BuildServer/lib/tasks/dotnetnugetprocess.js b/BuildServer/lib/tasks/dotnetnugetprocess.js index e499c96..2e7a722 100644 --- a/BuildServer/lib/tasks/dotnetnugetprocess.js +++ b/BuildServer/lib/tasks/dotnetnugetprocess.js @@ -12,7 +12,8 @@ module.exports = function (params, processor) { "params": { "nuspec": params.nuspecName + ".nuspec", "name": params.nuspecName, - "version": params.version + "version": params.version, + "major": params.major } }, "otherwise": { @@ -20,7 +21,8 @@ module.exports = function (params, processor) { "type": "dotnetnugetpack", "params": { "nuspec": params.nuspecName + ".nuspec", - "version": params.version + "version": params.version, + "major": params.major } } }, processor); diff --git a/BuildServer/lib/tasks/dotnetnugetpush.js b/BuildServer/lib/tasks/dotnetnugetpush.js index 8d67571..4f429be 100644 --- a/BuildServer/lib/tasks/dotnetnugetpush.js +++ b/BuildServer/lib/tasks/dotnetnugetpush.js @@ -5,7 +5,7 @@ var settings = require("../../settings"); module.exports = function (params, processor) { var date = new Date(), - version = params.version || ((params.major || "0") + "." + date.getFullYear() + "." + ((date.getMonth() + 1) * 100 + date.getDate()) + "." + ((date.getHours() * 100 + date.getMinutes()) * 100 + date.getSeconds())), + version = (params.version || ((params.major || "0") + "." + (date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate()) + "." + ((date.getHours() * 100 + date.getMinutes()) * 100 + date.getSeconds()))) + "-r" + processor.context.rev.substr(0, 16), nupkg = processor.context.exported + "/" + params.name + "." + version + ".nupkg"; return sequential({