]> xenbits.xensource.com Git - pvdrivers/win/xenvif.git/commitdiff
Pass SignMode to MSBuild
authorOwen Smith <owen.smith@citrix.com>
Fri, 18 Nov 2022 10:06:10 +0000 (10:06 +0000)
committerPaul Durrant <pdurrant@amazon.com>
Fri, 2 Dec 2022 13:53:48 +0000 (13:53 +0000)
Allows overriding of SignMode to "Off" to prevent signing binaries with the PFX
file. This is useful if wrapper builds sign binaries with alternative signatures
or when signing is not required.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Small whitespace fix.

Signed-off-by: Paul Durrant <paul@xen.org>
build.ps1
msbuild.ps1
vs2019/package/package.vcxproj
vs2022/package/package.vcxproj

index 88d57a67489d84dcf00e94928d343be7f73305fa..08b9715ce95f9109ae1ea3a9dec32f730a7fc0c0 100644 (file)
--- a/build.ps1
+++ b/build.ps1
@@ -6,6 +6,7 @@ param(
        [Parameter(Mandatory = $true)]
        [string]$Type,
        [string]$Arch,
+       [string]$SignMode = "TestSign",
        [switch]$CodeQL,
        [switch]$Sdv
 )
@@ -28,7 +29,8 @@ Function Build {
                SolutionDir = $solutiondir[$visualstudioversion];
                ConfigurationBase = $configurationbase[$visualstudioversion];
                Arch = $Arch;
-               Type = $Type
+               Type = $Type;
+               SignMode = $SignMode
                }
        & ".\msbuild.ps1" @params
        if ($LASTEXITCODE -ne 0) {
@@ -47,7 +49,8 @@ Function SdvBuild {
                SolutionDir = $solutiondir[$visualstudioversion];
                ConfigurationBase = $configurationbase[$visualstudioversion];
                Arch = $arch;
-               Type = "sdv"
+               Type = "sdv";
+               SignMode = $SignMode
                }
        & ".\msbuild.ps1" @params
 }
@@ -62,7 +65,8 @@ function CodeQLBuild {
                SolutionDir = $solutiondir[$visualstudioversion];
                ConfigurationBase = $configurationbase[$visualstudioversion];
                Arch = $arch;
-               Type = "codeql"
+               Type = "codeql";
+               SignMode = $SignMode
                }
        & ".\msbuild.ps1" @params
 }
index b2ede2f2cfb186ffd4b901a34a7c70ea8a33094d..867cbe393b989a39fc565503f1d2a5cece134c76 100644 (file)
@@ -7,7 +7,8 @@ param(
        [Parameter(Mandatory = $true)]
        [string]$Arch,
        [Parameter(Mandatory = $true)]
-       [string]$Type
+       [string]$Type,
+       [string]$SignMode = "TestSign"
 )
 
 Function Run-MSBuild {
@@ -25,6 +26,7 @@ Function Run-MSBuild {
        $c += " /m:4"
        $c += [string]::Format(" /p:Configuration=""{0}""", $Configuration)
        $c += [string]::Format(" /p:Platform=""{0}""", $Platform)
+       $c += [string]::Format(" /p:SignMode=""{0}""", $SignMode)
        $c += [string]::Format(" /t:""{0}"" ", $Target)
        if ($Inputs) {
                $c += [string]::Format(" /p:Inputs=""{0}"" ", $Inputs)
@@ -99,6 +101,7 @@ Function Run-CodeQL {
        $a += " /t:Build"
        $a += [string]::Format(" /p:Configuration=""{0}""", $Configuration)
        $a += [string]::Format(" /p:Platform=""{0}""", $Platform)
+       $a += [string]::Format(" /p:SignMode=""{0}""", $SignMode)
        $a += " "
        $a += Join-Path $projpath $project
        $a | Set-Content $bat
index 709fb6e65407200e876cc28de1e01793eaa02318..8987c1da95fcf21e72af8806a8138875e13c555b 100644 (file)
   <ItemGroup>
     <PackageFiles Include="$(OutDir)\$(ProjectName)\*" />
   </ItemGroup>
-  <Target Name="Archive" AfterTargets="TestSign">
+  <Target Name="ArchiveUnsigned" AfterTargets="Inf2Cat" Condition="('$(SignMode)' != 'TestSign') AND ('$(SignMode)' != 'ProductionSign')">
     <Copy
-      SourceFiles="@(PackageFiles)"
-      DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"
-    />
+       SourceFiles="@(PackageFiles)"
+       DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"
+       />
+  </Target>
+  <Target Name="ArchiveSigned" AfterTargets="TestSign;ProductionSign" Condition="('$(SignMode)' == 'TestSign' or '$(SignMode)' == 'ProductionSign')">
+    <Copy
+       SourceFiles="@(PackageFiles)"
+       DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"
+       />
   </Target>
 </Project>
index 709fb6e65407200e876cc28de1e01793eaa02318..016a1c05e69a110311fad0c11f2ec3abc5228d11 100644 (file)
   <ItemGroup>
     <PackageFiles Include="$(OutDir)\$(ProjectName)\*" />
   </ItemGroup>
-  <Target Name="Archive" AfterTargets="TestSign">
+  <Target Name="ArchiveUnsigned" AfterTargets="Inf2Cat" Condition="('$(SignMode)' != 'TestSign') AND ('$(SignMode)' != 'ProductionSign')">
     <Copy
-      SourceFiles="@(PackageFiles)"
-      DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"
-    />
+        SourceFiles="@(PackageFiles)"
+        DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"
+       />
+  </Target>
+  <Target Name="ArchiveSigned" AfterTargets="TestSign;ProductionSign" Condition="('$(SignMode)' == 'TestSign' or '$(SignMode)' == 'ProductionSign')">
+    <Copy
+        SourceFiles="@(PackageFiles)"
+        DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"
+       />
   </Target>
 </Project>