]> xenbits.xensource.com Git - pvdrivers/win/xencons.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 14:00:36 +0000 (14:00 +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 56891078b8a605f96627285f80a8a89dc90d4991..27efa389247b3f3025d15446e253735111b950aa 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 0088f56b6d0d7ea2aa4104c143a5fa8e3bc034fc..e3b87a0bd85e1f7ac3d07feee6dcfd4cb8e26e19 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 533e574851ed6840930c9dc2e1941bbef601726b..4012108dc90dfc80c90418320a3f5b23dbe81f62 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 533e574851ed6840930c9dc2e1941bbef601726b..c302d6d55bf4f663651566da8762ee8f336e5d9e 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>