blob: 86be35badb7be0f954cfb7eabcbd37d474a64df5 [file] [log] [blame]
Steve Dowerbb240872015-02-05 22:08:48 -08001<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
4 <Target Name="ProcessInstallFiles" AfterTargets="PrepareForBuild" Condition="@(InstallFiles) != ''">
5 <PropertyGroup>
6 <_FileListTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.csv</_FileListTarget>
7 <_InstallFilesTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.wxs</_InstallFilesTarget>
8 </PropertyGroup>
9
10 <ItemGroup>
11 <InstallFiles>
12 <_Source>%(Source)$([msbuild]::MakeRelative(%(SourceBase), %(FullPath)))</_Source>
13 <_Target>%(Target_)$([msbuild]::MakeRelative(%(TargetBase), %(FullPath)))</_Target>
14 </InstallFiles>
15 </ItemGroup>
16
17 <WriteLinesToFile File="$(_FileListTarget)" Lines="@(InstallFiles->'&quot;%(_Source)&quot;,&quot;%(_Target)&quot;,&quot;%(Group)&quot;,&quot;%(DiskId)&quot;,&quot;%(Condition)&quot;')" Overwrite="true" />
18 <Exec Command='"$(PythonExe)" csv_to_wxs.py "$(_FileListTarget)" "$(_InstallFilesTarget)"'
19 WorkingDirectory="$(MSBuildThisFileDirectory)" />
20
21 <ItemGroup>
22 <FileWrites Include="$(_FileListTarget);$(_InstallFilesTarget)" />
23 <Compile Include="$(_InstallFilesTarget)" />
24 </ItemGroup>
25 </Target>
26
Steve Dowerd4233962015-07-05 07:24:17 -070027 <Target Name="_TransformWxlTemplates" AfterTargets="PrepareForBuild" Inputs="@(WxlTemplate);$(PySourcePath)include\patchlevel.h" Outputs="$(IntermediateOutputPath)%(Filename).wxl">
Steve Dower49621412016-05-18 15:54:05 -070028 <PropertyGroup Condition="'@(WxlTemplate)' != ''">
Steve Dower940f6a82015-10-31 12:17:11 -070029 <_Content>$([System.IO.File]::ReadAllText(%(WxlTemplate.FullPath)).Replace(`{{ShortVersion}}`, `$(MajorVersionNumber).$(MinorVersionNumber)$(PyTestExt)`).Replace(`{{LongVersion}}`, `$(PythonVersion)$(PyTestExt)`).Replace(`{{Bitness}}`, `$(Bitness)`))</_Content>
Steve Dowerbb240872015-02-05 22:08:48 -080030 <_ExistingContent Condition="Exists('$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl')">$([System.IO.File]::ReadAllText($(IntermediateOutputPath)%(WxlTemplate.Filename).wxl))</_ExistingContent>
31 </PropertyGroup>
32
33 <WriteLinesToFile File="$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl"
34 Lines="$(_Content)"
35 Overwrite="true"
36 Condition="$(_Content) != $(_ExistingContent)" />
37
Steve Dower49621412016-05-18 15:54:05 -070038 <ItemGroup Condition="'@(WxlTemplate)' != ''">
Steve Dowerbb240872015-02-05 22:08:48 -080039 <EmbeddedResource Include="$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl" />
40 <FileWrites Include="$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl" />
41 </ItemGroup>
42 </Target>
43
44 <Import Project="$(WixTargetsPath)" />
45
46 <Target Name="SignCabs">
47 <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
48 <Exec Command="$(_SignCommand) @(SignCabs->'&quot;%(FullPath)&quot;',' ')" ContinueOnError="false" />
49 </Target>
50 <Target Name="SignMsi">
51 <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
52 <Exec Command="$(_SignCommand) @(SignMsi->'&quot;%(FullPath)&quot;',' ')" ContinueOnError="false" />
53 </Target>
54 <Target Name="SignBundleEngine">
55 <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
56 <Exec Command="$(_SignCommand) @(SignBundleEngine->'&quot;%(FullPath)&quot;',' ')" ContinueOnError="false" />
57 </Target>
58 <Target Name="SignBundle">
59 <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
60 <Exec Command="$(_SignCommand) @(SignBundle->'&quot;%(FullPath)&quot;',' ')" ContinueOnError="false" />
61 </Target>
62</Project>