From 2fb6280ba9937439ba2b5f2a08ca46b9a62f1f19 Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Wed, 30 Sep 2015 12:32:57 +0300 Subject: [PATCH] ignoreCodeAnalysisByDefault setting implemented --- BuildServer/lib/tasks/dotnetcompile.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/BuildServer/lib/tasks/dotnetcompile.js b/BuildServer/lib/tasks/dotnetcompile.js index 638fb79..e4d9c06 100644 --- a/BuildServer/lib/tasks/dotnetcompile.js +++ b/BuildServer/lib/tasks/dotnetcompile.js @@ -13,8 +13,16 @@ module.exports = function (params, processor) { if (!settings.skipCodeSigning && !params.skipCodeSigning) { compileParams.SigningKey = settings.codeSigningKeyFile; } - if (!settings.isCodeAnalysisUnsupported && !params.ignoreCodeAnalysis) { - compileParams.CodeAnalysisRuleSet = settings.codeAnalysisRuleSet; + if (settings.isCodeAnalysisUnsupported) { + if (params.forceCodeAnalysis) { + processor.onError("Code analysis is not supported"); + processor.done(); + return; + } + } else { + if (!settings.ignoreCodeAnalysisByDefault || params.forceCodeAnalysis) { + compileParams.CodeAnalysisRuleSet = settings.codeAnalysisRuleSet; + } } return dotnetbuilderwrapper(compileParams, processor); }