]> xenbits.xensource.com Git - pvdrivers/win/xeniface.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:08 +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 a7da9ba4c8dbcbbe6d401a976046994390cff506..0d0f6064112fca56a06d92742a9f4fa637137c8b 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 3d48dc840c61a9fcef870061da7ae3c0c44ec53c..5d479cb14c5d1b83d47d39e70940c889ca3200a1 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 a0676937c314fc25d9f4d392eeb62c1aed85fc0c..357caaf2e3b23ee8ce0180a8c71125ee3d639126 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 a0676937c314fc25d9f4d392eeb62c1aed85fc0c..2b8fc2605816a680b1a3a77115d410b433f0b68e 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>