]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Fix the build:
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 24 Apr 2019 14:27:13 +0000 (15:27 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 24 Apr 2019 14:27:13 +0000 (15:27 +0100)
- Build number handling was broken
- Archiving was broken

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
build.ps1
scripts/genfiles.ps1
vs2015/package/package.vcxproj
vs2017/package/package.vcxproj

index 194d2397892ca0991a4ef69a7050a1bebc6bbc00..89119088e6c6e7ba5f88e1607249e03e8f26f255 100644 (file)
--- a/build.ps1
+++ b/build.ps1
@@ -57,15 +57,26 @@ if ($Type -ne "free" -and $Type -ne "checked") {
 }
 
 if ([string]::IsNullOrEmpty($Env:VENDOR_NAME)) {
-   Set-Item -Path Env:VENDOR_NAME -Value 'Xen Project'
+       Set-Item -Path Env:VENDOR_NAME -Value 'Xen Project'
 }
 
 if ([string]::IsNullOrEmpty($Env:VENDOR_PREFIX)) {
-   Set-Item -Path Env:VENDOR_PREFIX -Value 'XP'
+       Set-Item -Path Env:VENDOR_PREFIX -Value 'XP'
 }
 
 if ([string]::IsNullOrEmpty($Env:PRODUCT_NAME)) {
-   Set-Item -Path Env:PRODUCT_NAME -Value 'Xen'
+       Set-Item -Path Env:PRODUCT_NAME -Value 'Xen'
+}
+
+if ([string]::IsNullOrEmpty($Env:BUILD_NUMBER)) {
+       if (Test-Path ".build_number") {
+               $BuildNum = Get-Content -Path ".build_number"
+               Set-Content -Path ".build_number" -Value ([int]$BuildNum + 1)
+       } else {
+               $BuildNum = '0'
+               Set-Content -Path ".build_number" -Value '1'
+       }
+       Set-Item -Path Env:BUILD_NUMBER -Value $BuildNum
 }
 
 Set-Item -Path Env:MAJOR_VERSION -Value '9'
@@ -78,10 +89,3 @@ Build "x64" $Type
 if ($Sdv) {
        SdvBuild
 }
-
-if (Test-Path ".build_number") {
-       $TheBuildNum = Get-Content -Path ".build_number"
-       Set-Content -Path ".build_number" -Value ([int]$TheBuildNum + 1)
-} else {
-       Set-Content -Path ".build_number" -Value "1"
-}
index d3a7d34ad84b7b6a64f92a88b93dba1e689051db..6adc7f97019abcb4c8325045d514f065b77ac945 100644 (file)
@@ -54,18 +54,6 @@ if ($GitRevision) {
        Set-Content -Path ".revision" -Value $GitRevision
 }
 
-# if ".build_number" doesnt exist, BUILD_NUMBER = 0
-# since this can called by the vcxproj, do not autoincrement the build number
-# as this will mean x64 and Win32 builds have different numbers!
-if (Test-Path ".build_number") {
-       $TheBuildNum = Get-Content -Path ".build_number"
-} else {
-       Set-Content -Path ".build_number" -Value "0"
-}
-if (-not $TheBuildNum) {
-       $TheBuildNum = '0'
-}
-
 # [ordered] makes output easier to parse by humans
 $Replacements = [ordered]@{
        # values determined from the build environment
@@ -77,9 +65,9 @@ $Replacements = [ordered]@{
        'MAJOR_VERSION' = $Env:MAJOR_VERSION;
        'MINOR_VERSION' = $Env:MINOR_VERSION;
        'MICRO_VERSION' = $Env:MICRO_VERSION;
+       'BUILD_NUMBER' = $Env:BUILD_NUMBER;
 
        # generated values
-       'BUILD_NUMBER' = $TheBuildNum;
        'GIT_REVISION' = $GitRevision;
 
        'INF_DATE' = $InfDate;
index 68b07745527e9faf504fc2123093e368be1c5d50..2518c3f78bfa73977e0f5fbe9baaadad0788ca57 100644 (file)
@@ -66,7 +66,6 @@
     <PackageFiles Include="$(OutDir)\$(ProjectName)\*" />
   </ItemGroup>
   <Target Name="Archive" AfterTargets="TestSign">
-    <Exec Command="del /f /q $(ArchiveDir)" />
     <Copy
        SourceFiles="@(PackageFiles)"
        DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"
index f5094b5889624ea7ddd5e22accd8edc37d7ff325..2a83c90335f8454af1a5912b8bb3542969ec34e2 100644 (file)
@@ -66,7 +66,6 @@
     <PackageFiles Include="$(OutDir)\$(ProjectName)\*" />
   </ItemGroup>
   <Target Name="Archive" AfterTargets="TestSign">
-    <Exec Command="del /f /q $(ArchiveDir)" />
     <Copy
        SourceFiles="@(PackageFiles)"
        DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')"