From 8580f996fe968764a0d0775c41fcd4ba9673c03e Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Thu, 10 Mar 2016 08:57:24 +0300 Subject: [PATCH] Cleanup refactored; dotnetbuildwithoutcleanup task implemented --- BuildServer/lib/tasks/dotnetbuild.js | 49 +++++-------------- BuildServer/lib/tasks/dotnetbuildandtest.js | 6 ++- .../lib/tasks/dotnetbuildwithoutcleanup.js | 42 ++++++++++++++++ 3 files changed, 58 insertions(+), 39 deletions(-) create mode 100644 BuildServer/lib/tasks/dotnetbuildwithoutcleanup.js diff --git a/BuildServer/lib/tasks/dotnetbuild.js b/BuildServer/lib/tasks/dotnetbuild.js index 76ef782..11fa086 100644 --- a/BuildServer/lib/tasks/dotnetbuild.js +++ b/BuildServer/lib/tasks/dotnetbuild.js @@ -3,44 +3,17 @@ var sequential = require('./sequential'); module.exports = function (params, processor) { - var tasks = []; - - if (!params.skipMbsCheckStyle) { - tasks.push({ - type: "dotnetcheckstyle", - params: params - }); - } - - tasks.push({ - type: "dotnetrewrite", - params: params - }); - - if (!params.skipNugetRestore) { - tasks.push({ - type: "dotnetnugetrestore", - params: params - }); - } - - tasks.push({ - type: "dotnetcompile", - params: { - solution: params.solution, - skipCodeSigning: params.skipCodeSigning, - forceCodeAnalysis: params.forceCodeAnalysis, - ignoreCodeAnalysis: params.ignoreCodeAnalysis, - configuration: params.configuration, - target: "Rebuild" - } - }); - - tasks.push({ - type: "cleanupafterdotnetbuild" - }); - return sequential({ - tasks: tasks + tasks: [ + { + type: "dotnetbuildwithoutcleanup", + name: "build", + params: params + }, + { + type: "cleanupafterdotnetbuild", + name: "cleanup" + } + ] }, processor); }; diff --git a/BuildServer/lib/tasks/dotnetbuildandtest.js b/BuildServer/lib/tasks/dotnetbuildandtest.js index 0729a0d..687ef74 100644 --- a/BuildServer/lib/tasks/dotnetbuildandtest.js +++ b/BuildServer/lib/tasks/dotnetbuildandtest.js @@ -7,7 +7,7 @@ module.exports = function (params, processor) { return sequential({ tasks: [ { - type: "dotnetbuild", + type: "dotnetbuildwithoutcleanup", name: "build", params: params }, @@ -15,6 +15,10 @@ module.exports = function (params, processor) { type: "dotnetnunitall", name: "test", params: params + }, + { + type: "cleanupafterdotnetbuild", + name: "cleanup" } ] }, processor); diff --git a/BuildServer/lib/tasks/dotnetbuildwithoutcleanup.js b/BuildServer/lib/tasks/dotnetbuildwithoutcleanup.js new file mode 100644 index 0000000..26065f6 --- /dev/null +++ b/BuildServer/lib/tasks/dotnetbuildwithoutcleanup.js @@ -0,0 +1,42 @@ +"use strict"; + +var sequential = require('./sequential'); + +module.exports = function (params, processor) { + var tasks = []; + + if (!params.skipMbsCheckStyle) { + tasks.push({ + type: "dotnetcheckstyle", + params: params + }); + } + + tasks.push({ + type: "dotnetrewrite", + params: params + }); + + if (!params.skipNugetRestore) { + tasks.push({ + type: "dotnetnugetrestore", + params: params + }); + } + + tasks.push({ + type: "dotnetcompile", + params: { + solution: params.solution, + skipCodeSigning: params.skipCodeSigning, + forceCodeAnalysis: params.forceCodeAnalysis, + ignoreCodeAnalysis: params.ignoreCodeAnalysis, + configuration: params.configuration, + target: "Rebuild" + } + }); + + return sequential({ + tasks: tasks + }, processor); +};