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

[win-pv-devel] [PATCH 2/2] Run getfiles.ps1 as part of the MSBuild process



genfiles.ps1 is executed as early as possible as part of xen.vcxproj's
build steps, and fixes an issue where genfiles.ps1 assumed paths were
relative to the current working directory, not the script directory.
Also enforce that xen.vcxproj is the first project to build in the
solution file.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 genfiles.ps1           |  3 +++
 vs2017/xen/xen.vcxproj | 11 +++++++++++
 vs2017/xenbus.sln      |  6 ++++++
 3 files changed, 20 insertions(+)

diff --git a/genfiles.ps1 b/genfiles.ps1
index ddab96e..dd44ade 100644
--- a/genfiles.ps1
+++ b/genfiles.ps1
@@ -53,6 +53,8 @@ Function Copy-FileWithReplacements {
 #
 # Script Body
 #
+$cwd = Get-Location
+Set-Location $PSScriptRoot
 
 $TheDate = Get-Date -UFormat "%m/%d/%Y"
 $TheYear = (Get-Date -date $TheDate).Year
@@ -114,3 +116,4 @@ $src = [string]::Format("./src/{0}.inf", $DriverName)
 $dst = [string]::Format("./{0}/{1}.inf", $SolutionDir, $DriverName)
 Copy-FileWithReplacements $src $dst -Replacements $Replacements
 
+Set-Location $cwd
diff --git a/vs2017/xen/xen.vcxproj b/vs2017/xen/xen.vcxproj
index eebac3a..2f2a077 100644
--- a/vs2017/xen/xen.vcxproj
+++ b/vs2017/xen/xen.vcxproj
@@ -38,6 +38,17 @@
       <ModuleDefinitionFile>../../src/xen/xen.def</ModuleDefinitionFile>
     </Link>
   </ItemDefinitionGroup>
+  <PropertyGroup>
+    <CustomBuildAfterTargets>InitializeBuildStatus</CustomBuildAfterTargets>
+    <CustomBuildBeforeTargets>StampInf</CustomBuildBeforeTargets>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <CustomBuildStep>
+      <Command>powershell.exe -ExecutionPolicy Bypass -NoProfile 
-NonInteractive -File ../../genfiles.ps1</Command>
+      <Outputs>include/version.h</Outputs>
+      <Inputs>include/version._h_</Inputs>
+    </CustomBuildStep>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
     <ClCompile>
       
<PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions);_X86_</PreprocessorDefinitions>
diff --git a/vs2017/xenbus.sln b/vs2017/xenbus.sln
index 6d971b2..2b89058 100644
--- a/vs2017/xenbus.sln
+++ b/vs2017/xenbus.sln
@@ -3,8 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 VisualStudioVersion = 14.0.25420.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_coinst", 
"xenbus_coinst\xenbus_coinst.vcxproj", "{4BF41378-C01B-4002-8581-563C5F703362}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C} = 
{9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C}
+       EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_monitor", 
"xenbus_monitor\xenbus_monitor.vcxproj", 
"{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C} = 
{9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C}
+       EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xen", "xen\xen.vcxproj", 
"{9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C}"
 EndProject
-- 
2.16.2.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel

 


Rackspace

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