[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] Always run Code Analysis on build



Code Analysis is quick to run, and there's little reason not to run it.
Unconditionally run the recommended driver ruleset on build.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 msbuild.ps1          | 8 +-------
 vs2019/targets.props | 4 ++++
 vs2022/targets.props | 4 ++++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index d9785db..67f8ae0 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -18,8 +18,7 @@ Function Run-MSBuild {
                [string]$Configuration,
                [string]$Platform,
                [string]$Target = "Build",
-               [string]$Inputs = "",
-               [switch]$CodeAnalysis
+               [string]$Inputs = ""
        )
 
        $c = "msbuild.exe"
@@ -31,10 +30,6 @@ Function Run-MSBuild {
        if ($Inputs) {
                $c += [string]::Format(" /p:Inputs=""{0}"" ", $Inputs)
        }
-       if ($CodeAnalysis) {
-               $c += "/p:RunCodeAnalysis=true "
-               $c += "/p:EnablePREFast=true "
-       }
 
        $c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -62,7 +57,6 @@ Function Run-MSBuildSDV {
        Run-MSBuild $projpath $project $Configuration $Platform "Build"
        Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
        Run-MSBuild $projpath $project $Configuration $Platform "sdv" 
"/check:default.sdv /debug"
-       Run-MSBuild $projpath $project $Configuration $Platform "Build" 
-CodeAnalysis
        Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
        $refine = Join-Path -Path $projpath -ChildPath "refine.sdv"
diff --git a/vs2019/targets.props b/vs2019/targets.props
index 53a8662..b55dc31 100644
--- a/vs2019/targets.props
+++ b/vs2019/targets.props
@@ -16,4 +16,8 @@
                <TargetVersion>Windows10</TargetVersion>
                <UseDebugLibraries>false</UseDebugLibraries>
        </PropertyGroup>
+       <PropertyGroup Condition="'$(ConfigurationType)'=='Driver'">
+               <RunCodeAnalysis>true</RunCodeAnalysis>
+               
<CodeAnalysisRuleSet>$([System.Environment]::GetEnvironmentVariable("WindowsSdkDir"))CodeAnalysis\DriverRecommendedRules.ruleset</CodeAnalysisRuleSet>
+       </PropertyGroup>
 </Project>
diff --git a/vs2022/targets.props b/vs2022/targets.props
index 3c31b6c..292f52a 100644
--- a/vs2022/targets.props
+++ b/vs2022/targets.props
@@ -8,4 +8,8 @@
                <TargetVersion>Windows10</TargetVersion>
                <UseDebugLibraries>false</UseDebugLibraries>
        </PropertyGroup>
+       <PropertyGroup Condition="'$(ConfigurationType)'=='Driver'">
+               <RunCodeAnalysis>true</RunCodeAnalysis>
+               
<CodeAnalysisRuleSet>$([System.Environment]::GetEnvironmentVariable("WindowsSdkDir"))CodeAnalysis\DriverRecommendedRules.ruleset</CodeAnalysisRuleSet>
+       </PropertyGroup>
 </Project>
-- 
2.50.0.windows.1



Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.