FS-11288: [Build-System] Refactor WIX project to not miss modules in msi on slow machines. Move Windows build logic from legacy util.vbs to modern props. Fix sound packages improper extraction. Fix multiprocessor build under msbuild.

This commit is contained in:
Andrey Volk
2018-07-27 18:56:46 +03:00
parent a380f125e1
commit e08406d1c4
106 changed files with 1544 additions and 4201 deletions

View File

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="GitVersion;LoadDynamicVariables" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="GetSoundsDirTarget;GitVersion;LoadDynamicVariables" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GitSkipCache>true</GitSkipCache>
</PropertyGroup>
<ImportGroup Label="PropertySheets">
<Import Project="..\sound_tools.props" />
<Import Project="GitInfo\GitInfo.targets" />
</ImportGroup>
<PropertyGroup>
@@ -17,26 +18,26 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\x86\Debug\</OutputPath>
<IntermediateOutputPath>obj\X86\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\Win32\debug\sounds;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);PlatformDir=Win32;</DefineConstants>
<DefineConstants>Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);</DefineConstants>
<WixVariables>
</WixVariables>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\release\</OutputPath>
<IntermediateOutputPath>obj\X86\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\Win32\release\sounds;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);</DefineConstants>
<DefineConstants>FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<OutputPath>bin\x64\Debug\</OutputPath>
<IntermediateOutputPath>obj\X64\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\x64\debug\sounds;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);</DefineConstants>
<DefineConstants>Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);</DefineConstants>
<WixVariables>
</WixVariables>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\x64\Release\</OutputPath>
<IntermediateOutputPath>obj\X64\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\x64\release\sounds;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);</DefineConstants>
<DefineConstants>FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="Fragments\FreeSWITCHConfFiles.wxs" />
@@ -876,16 +877,6 @@
<Content Include="filter.xslt" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PreBuildEvent>"$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"
"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"
"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x64' ">
<PreBuildEvent>"$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"
"$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"
"$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"</PreBuildEvent>
</PropertyGroup>
<Target Name="LoadDynamicVariables">
<Exec Command="$(SolutionDir)w32\Setup\FullVersion.cmd" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="FullVersion" />
@@ -908,12 +899,17 @@
<CreateProperty Condition="$(FullVersion) != ''" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)$(Revision)$(SnapshotName)-$(UserFriendlyPlatform)-$(Configuration).msi">
<Output TaskParameter="Value" PropertyName="DestinationFileName" />
</CreateProperty>
<CreateProperty Value="FreeSWITCHSoundFilesDir=$(SoundsDir);$(DefineConstants)">
<Output TaskParameter="Value" PropertyName="DefineConstants" />
</CreateProperty>
<Message Importance="High" Text="SoundsDir: $(SoundsDir)" />
<Message Importance="High" Text="DefineConstants: $(DefineConstants)" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below.
Other similar extension points exist, see Wix.targets.
-->
<Target Name="BeforeBuild">
<Target Name="AfterResolveReferences">
<Message Importance="High" Text="GitExe: $(GitExe)" />
<Message Importance="High" Text="GitCommits: $(GitCommits)" />
<Message Importance="High" Text="SnapshotName: $(SnapshotName)" />
@@ -921,6 +917,61 @@
<Message Importance="High" Text="Deleting previously created MSI files." />
<Delete Files="$(OutputPath)$(OutputName).msi" />
<Delete Files="$(DestinationFileName)" />
<HeatDirectory
ToolPath="$(WixToolPath)"
OutputFile="$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"
Directory="$(ProjectDir)..\..\conf\vanilla"
DirectoryRefId="CONFLOCATION"
ComponentGroupName="FreeSWITCHConfFiles"
GenerateGuidsNow="true"
SuppressRootDirectory="true"
SuppressRegistry="true"
SuppressCom="true"
SuppressFragments="true"
PreprocessorVariable="var.FreeSWITCHConfFilesDir">
</HeatDirectory>
<HeatDirectory
ToolPath="$(WixToolPath)"
OutputFile="$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"
Directory="$(SoundsDir)"
DirectoryRefId="SOUNDLOCATION"
ComponentGroupName="FreeSWITCHSoundFiles8"
GenerateGuidsNow="true"
SuppressRootDirectory="true"
SuppressRegistry="true"
SuppressCom="true"
SuppressFragments="true"
PreprocessorVariable="var.FreeSWITCHSoundFilesDir">
</HeatDirectory>
<HeatDirectory Condition=" '$(Platform)' == 'x86' "
ToolPath="$(WixToolPath)"
OutputFile="$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"
Directory="$(SolutionDir)Win32\$(Configuration)"
Transforms="$(ProjectDir)filter.xslt"
DirectoryRefId="INSTALLLOCATION"
ComponentGroupName="FreeSWITCHBaseFiles"
GenerateGuidsNow="true"
SuppressRootDirectory="true"
SuppressRegistry="true"
SuppressCom="true"
SuppressFragments="true"
PreprocessorVariable="var.FreeSWITCHBaseDir">
</HeatDirectory>
<HeatDirectory Condition=" '$(Platform)' == 'x64' "
ToolPath="$(WixToolPath)"
OutputFile="$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"
Directory="$(SolutionDir)x64\$(Configuration)"
Transforms="$(ProjectDir)filter.xslt"
DirectoryRefId="INSTALLLOCATION"
ComponentGroupName="FreeSWITCHBaseFiles"
GenerateGuidsNow="true"
SuppressRootDirectory="true"
SuppressRegistry="true"
SuppressCom="true"
SuppressFragments="true"
PreprocessorVariable="var.FreeSWITCHBaseDir">
</HeatDirectory>
</Target>
<Target Name="AfterBuild">
<Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(DestinationFileName)" />