WIP: wix.targets cleanup
Rob Mensching committed
Jul 27, 2018 at 11:41 UTC
63ebed98f610c9f6ae722d6a12678593c262ba3e
1 file changed
+19
-229
src/WixToolset.BuildTasks/wix.targets
+19
-229
@@ -1,7 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
-
4
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="_CheckRequiredProperties" DefaultTargets="Build">
5
<PropertyGroup>
6
<WixTargetsImported>true</WixTargetsImported>
@@ -120,11 +119,6 @@
119
<UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" />
120
<UsingTask TaskName="GenerateCompileWithObjectPath" AssemblyFile="$(WixTasksPath)"/>
121
123
- <!-- WiX tools are 32bit EXEs, so run them out-of-proc when MSBuild is not 32bit. -->
124
- <PropertyGroup>
125
- <RunWixToolsOutOfProc Condition=" '$(PROCESSOR_ARCHITECTURE)'!='x86' ">true</RunWixToolsOutOfProc>
126
- </PropertyGroup>
127
-
122
<PropertyGroup>
123
<BindContentsFile Condition=" '$(BindContentsFile)' == '' ">$(MSBuildProjectFile).BindContentsFileList.txt</BindContentsFile>
124
<BindOutputsFile Condition=" '$(BindOutputsFile)' == '' ">$(MSBuildProjectFile).BindOutputsFileList.txt</BindOutputsFile>
@@ -284,8 +278,7 @@
278
PreBuildEvent;
279
ResolveReferences;
280
287
- <!--CompileAndLink;-->
288
- DoIt;
281
+ WixBuild;
282
Signing;
283
284
GetTargetPath;
@@ -598,43 +591,43 @@
591
<!--
592
//////////////////////////////////////////////////////////////////////////////////////////////////
593
//////////////////////////////////////////////////////////////////////////////////////////////////
601
- DoIt Targets
594
+ WixBuild Targets
595
//////////////////////////////////////////////////////////////////////////////////////////////////
596
//////////////////////////////////////////////////////////////////////////////////////////////////
597
-->
598
599
<!--
600
==================================================================================================
608
- DoIt
601
+ WixBuild
602
==================================================================================================
603
-->
604
<PropertyGroup>
612
- <DoItDependsOn>
613
- PrepareForBuild;
605
+ <WixBuildDependsOn>
606
ResolveReferences;
615
- BeforeCompile;
616
- _TimeStampBeforeCompile;
617
- Harvest;
607
+ BeforeWixBuild;
608
+ _TimeStampBeforeWixBuild;
609
610
CalculateDefineConstants;
611
+ Harvest;
612
+
613
GenerateCompileWithObjectPath;
614
615
AssignCultures;
616
ReadPreviousBindInputsAndBuiltOutputs;
617
625
- ActuallyDoIt;
618
+ CoreWixBuild;
619
620
UpdateLinkFileWrites;
628
- _TimeStampAfterCompile;
629
- AfterCompile
630
- </DoItDependsOn>
621
+ _TimeStampAfterWixBuild;
622
+ AfterWixBuild
623
+ </WixBuildDependsOn>
624
</PropertyGroup>
625
<Target
633
- Name="DoIt"
634
- DependsOnTargets="$(DoItDependsOn)" />
626
+ Name="WixBuild"
627
+ DependsOnTargets="$(WixBuildDependsOn)" />
628
629
<Target
637
- Name="ActuallyDoIt"
630
+ Name="CoreWixBuild"
631
632
Inputs="@(Compile);
633
@(Content);
@@ -703,40 +696,8 @@
696
TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors);$(LinkerTreatWarningsAsErrors)"
697
VerboseOutput="$(CompilerVerboseOutput);$(LinkerVerboseOutput)"
698
-->
699
+ </Target>
700
707
-</Target>
708
-
709
-
710
- <!--
711
- //////////////////////////////////////////////////////////////////////////////////////////////////
712
- //////////////////////////////////////////////////////////////////////////////////////////////////
713
- CompileAndLink Targets
714
- //////////////////////////////////////////////////////////////////////////////////////////////////
715
- //////////////////////////////////////////////////////////////////////////////////////////////////
716
- -->
717
-
718
- <!--
719
- ==================================================================================================
720
- CompileAndLink
721
- ==================================================================================================
722
- -->
723
- <PropertyGroup>
724
- <CompileAndLinkDependsOn>
725
- ResolveReferences;
726
- BeforeCompile;
727
- _TimeStampBeforeCompile;
728
- Harvest;
729
- Compile;
730
- Lib;
731
- Link;
732
- UpdateLinkFileWrites;
733
- _TimeStampAfterCompile;
734
- AfterCompile
735
- </CompileAndLinkDependsOn>
736
- </PropertyGroup>
737
- <Target
738
- Name="CompileAndLink"
739
- DependsOnTargets="$(CompileAndLinkDependsOn)" />
701
702
<!--
703
==================================================================================================
@@ -819,72 +780,6 @@
780
IntermediateOutputPath="$(IntermediateOutputPath)">
781
<Output TaskParameter="CompileWithObjectPath" ItemName="_CompileWithObjectPath" />
782
</GenerateCompileWithObjectPath>
822
-
823
- </Target>
824
-
825
- <!--
826
- ================================================================================================
827
- Compile
828
-
829
- Compiles the wxs files into wixobj files using candle.exe.
830
-
831
- [IN]
832
- @(Compile) - The list of wxs files to compile.
833
- @(Content) - Files that the project uses in the installer.
834
- @(WixExtension) - The list of wixlib or wix dll extensions.
835
-
836
- [OUT]
837
- @(CompileObjOutput) - The compiled .wixobj files.
838
- ================================================================================================
839
- -->
840
- <PropertyGroup>
841
- <CompileDependsOn>
842
- PrepareForBuild;
843
- ResolveReferences;
844
- CalculateDefineConstants;
845
- GenerateCompileWithObjectPath
846
- </CompileDependsOn>
847
- </PropertyGroup>
848
- <Target
849
- Name="Compile"
850
- Inputs="@(Compile);
851
- @(Content);
852
- @(_ResolvedWixExtensionPaths);
853
- @(_ResolvedProjectReferencePaths);
854
- $(MSBuildAllProjects)"
855
- Outputs="@(_CompileWithObjectPath -> '%(ObjectPath)%(Filename).wixobj')"
856
- DependsOnTargets="$(CompileDependsOn)"
857
- Condition=" '@(Compile)' != '' ">
858
-
859
- <Candle
860
- SourceFiles="@(_CompileWithObjectPath)"
861
- AdditionalOptions="$(CompilerAdditionalOptions)"
862
- DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)"
863
- ExtensionDirectory="$(WixExtDir)"
864
- Extensions="@(_ResolvedWixExtensionPaths)"
865
- PreprocessToStdOut="$(PreprocessToStdOut)"
866
- PreprocessToFile="$(PreprocessToFile)"
867
- IncludeSearchPaths="$(IncludeSearchPaths)"
868
- InstallerPlatform="$(InstallerPlatform)"
869
- IntermediateDirectory="$(IntermediateOutputPath)"
870
- NoLogo="$(CompilerNoLogo)"
871
- OutputFile="%(_CompileWithObjectPath.ObjectPath)"
872
- Pedantic="$(Pedantic)"
873
- ReferencePaths="$(ReferencePaths)"
874
- RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
875
- SuppressAllWarnings="$(CompilerSuppressAllWarnings)"
876
- SuppressSpecificWarnings="$(CompilerSuppressSpecificWarnings)"
877
- ToolPath="$(WixToolDir)"
878
- TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors)"
879
- TreatSpecificWarningsAsErrors="$(CompilerTreatSpecificWarningsAsErrors)"
880
- VerboseOutput="$(CompilerVerboseOutput)">
881
- </Candle>
882
-
883
- <!-- These will be still be set even if the Compile target is up to date. -->
884
- <ItemGroup>
885
- <CompileObjOutput Include="@(_CompileWithObjectPath -> '%(ObjectPath)%(Filename).wixobj')" />
886
- <FileWrites Include="@(CompileObjOutput)" />
887
- </ItemGroup>
783
</Target>
784
785
<!--
@@ -1048,122 +943,17 @@
943
<Message Importance="low" Text="Previous bind outputs: @(_BindBuiltOutputs)" />
944
</Target>
945
1051
- <!--
1052
- ================================================================================================
1053
- Link
1054
-
1055
- Links the .wixobj, .wxl, .wixlib, wix extensions into an .msi or .msm file using light.exe,
1056
- once per culture group. All WXL files are passed into light and the culture switch determines
1057
- which are used
1058
-
1059
- [IN]
1060
- @(CompileObjOutput) - The compiled .wixobj file.
1061
- @(CultureGroup) - The cultures to build
1062
- @(EmbeddedResource) - The list of wxl files to use for localization.
1063
- @(WixObject) - The list of .wixobj files.
1064
- @(WixLibrary) - The list of .wixlib files.
1065
- @(WixExtension) - The list of wix dll extension files.
1066
-
1067
- [OUT]
1068
- $(TargetDir)\%(Culture)\$(TargetName)$(TargetExt) - The compiled .msi, .msm, or .exe files.
1069
- ================================================================================================
1070
- -->
1071
- <PropertyGroup>
1072
- <LinkDependsOn>
1073
- PrepareForBuild;
1074
- ResolveReferences;
1075
- AssignCultures;
1076
- ReadPreviousBindInputsAndBuiltOutputs;
1077
- </LinkDependsOn>
1078
- </PropertyGroup>
1079
- <Target
1080
- Name="Link"
1081
- Inputs="@(CompileObjOutput);
1082
- @(EmbeddedResource);
1083
- @(WixObject);
1084
- @(_ResolvedProjectReferencePaths);
1085
- @(_ResolvedWixLibraryPaths);
1086
- @(_ResolvedWixExtensionPaths);
1087
- $(MSBuildAllProjects);
1088
- @(_BindInputs)"
1089
- Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)"
1090
- DependsOnTargets="$(LinkDependsOn)"
1091
- Condition=" '$(OutputType)' == 'Bundle' or '$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' ">
1092
-
1093
- <PropertyGroup>
1094
- <PdbOutputFile>$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)</PdbOutputFile>
1095
- </PropertyGroup>
1096
-
1097
- <!-- Call light using the culture subdirectory for output -->
1098
- <Light
1099
- ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(_ResolvedWixLibraryPaths)"
1100
- AdditionalOptions="$(LinkerAdditionalOptions)"
1101
- AllowIdenticalRows="$(AllowIdenticalRows)"
1102
- AllowUnresolvedReferences="$(AllowUnresolvedReferences)"
1103
- AdditionalCub="$(AdditionalCub)"
1104
- BackwardsCompatibleGuidGeneration="$(BackwardsCompatibleGuidGeneration)"
1105
- BindInputPaths="@(LinkerBindInputPaths)"
1106
- BindFiles="$(LinkerBindFiles)"
1107
- BindContentsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)"
1108
- BindOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"
1109
- BindBuiltOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)"
1110
- CabinetCachePath="$(CabinetCachePath)"
1111
- CabinetCreationThreadCount="$(CabinetCreationThreadCount)"
1112
- Cultures="%(CultureGroup.Identity)"
1113
- CustomBinder="$(CustomBinder)"
1114
- DefaultCompressionLevel="$(DefaultCompressionLevel)"
1115
- DropUnrealTables="$(DropUnrealTables)"
1116
- ExactAssemblyVersions="$(ExactAssemblyVersions)"
1117
- ExtensionDirectory="$(WixExtDir)"
1118
- Extensions="@(_ResolvedWixExtensionPaths)"
1119
- Ices="$(Ices)"
1120
- LeaveTemporaryFiles="$(LeaveTemporaryFiles)"
1121
- LocalizationFiles="@(EmbeddedResource)"
1122
- NoLogo="$(LinkerNoLogo)"
1123
- OutputAsXml="$(OutputAsXml)"
1124
- OutputFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)"
1125
- PdbOutputFile="$(PdbOutputFile)"
1126
- Pedantic="$(LinkerPedantic)"
1127
- ReferencePaths="$(ReferencePaths)"
1128
- ReuseCabinetCache="$(ReuseCabinetCache)"
1129
- RunAsSeparateProcess="$(RunWixToolsOutOfProc)"
1130
- SuppressAclReset="$(SuppressAclReset)"
1131
- SuppressAllWarnings="$(LinkerSuppressAllWarnings)"
1132
- SuppressAssemblies="$(SuppressAssemblies)"
1133
- SuppressDefaultAdminSequenceActions="$(SuppressDefaultAdminSequenceActions)"
1134
- SuppressDefaultAdvSequenceActions="$(SuppressDefaultAdvSequenceActions)"
1135
- SuppressDefaultUISequenceActions="$(SuppressDefaultUISequenceActions)"
1136
- SuppressFileHashAndInfo="$(SuppressFileHashAndInfo)"
1137
- SuppressFiles="$(SuppressFiles)"
1138
- SuppressIntermediateFileVersionMatching="$(LinkerSuppressIntermediateFileVersionMatching)"
1139
- SuppressIces="$(SuppressIces)"
1140
- SuppressLayout="$(SuppressLayout)"
1141
- SuppressLocalization="$(SuppressLocalization)"
1142
- SuppressMsiAssemblyTableProcessing="$(SuppressMsiAssemblyTableProcessing)"
1143
- SuppressPdbOutput="$(SuppressPdbOutput)"
1144
- SuppressSchemaValidation="$(LinkerSuppressSchemaValidation)"
1145
- SuppressValidation="$(SuppressValidation)"
1146
- SuppressSpecificWarnings="$(LinkerSuppressSpecificWarnings)"
1147
- SuppressTagSectionIdAttributeOnTuples="$(SuppressTagSectionIdAttributeOnTuples)"
1148
- ToolPath="$(WixToolDir)"
1149
- TreatWarningsAsErrors="$(LinkerTreatWarningsAsErrors)"
1150
- UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)"
1151
- VerboseOutput="$(LinkerVerboseOutput)"
1152
- WixProjectFile="$(ProjectPath)"
1153
- WixVariables="$(WixVariables)" />
1154
- </Target>
1155
-
946
<!--
947
================================================================================================
948
UpdateLinkFileWrites
949
1160
- Reads the bind outputs file(s) output generated during Link to correctly set the @(FileWrites)
950
+ Reads the bind outputs file(s) output generated during WixBuild to correctly set the @(FileWrites)
951
item. Most targets have it easy because they can do a static mapping from inputs to the outputs.
1162
- However, the Link target outputs are determined after a rather complex calculation we call
952
+ However, the WixBuild target outputs are determined after a rather complex calculation we call
953
linking and binding!
954
955
This target runs independently after Link to ensure that @(FileWrites) is updated even if the
1166
- "Light" task fails.
956
+ "WixBuild" task fails.
957
958
[IN]
959
Path to bind outputs file(s).