<!-- *********************************************************************************************** Microsoft.Xaml.targets WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have created a backup copy. Incorrect changes to this file will make it impossible to load or build your projects from the command-line or the IDE. Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <LoadTimeSensitiveTargets> $(LoadTimeSensitiveTargets); XamlMarkupCompilePass1; </LoadTimeSensitiveTargets> <LoadTimeSensitiveProperties> $(LoadTimeSensitiveProperties); </LoadTimeSensitiveProperties> <TaskVersion>4.0.0.0</TaskVersion> <TaskKeyToken>31bf3856ad364e35</TaskKeyToken> <XamlBuildTaskAssemblyName Condition="'$(XamlBuildTaskAssemblyName)'==''">XamlBuildTask, Version=$(TaskVersion), Culture=neutral, PublicKeyToken=$(TaskKeyToken)</XamlBuildTaskAssemblyName> <XamlRequiresCompilationPass2 Condition="'$(XamlRequiresCompilationPass2)'==''">false</XamlRequiresCompilationPass2> <XamlTemporaryAssemblyName Condition="'$(XamlTemporaryAssemblyName)'==''">$(AssemblyName)</XamlTemporaryAssemblyName> <CompileTargetNameForTemporaryAssembly Condition="'$(CompileTargetNameForTemporaryAssembly)' == ''">CompileTemporaryAssembly</CompileTargetNameForTemporaryAssembly> <!-- Microsoft.Xaml.targets needs to be included after Microsoft.Fx.targets and Microsoft.DevDiv.targets to have a chance to add these tasks to the PrepareResources target's dependencies. Unfortunately, Microsoft.DevDiv.targets completely overwrites the PrepareResourcesDependsOnProperty (as a bug workaround-see comment there). --> <PrepareResourcesDependsOn> XamlMarkupCompilePass1; XamlMarkupCompilePass2; $(PrepareResourcesDependsOn) </PrepareResourcesDependsOn> </PropertyGroup> <PropertyGroup> <XamlBuildTaskLocation Condition="'$(XamlBuildTaskPath)'==''">$(MSBuildBinPath)</XamlBuildTaskLocation> <XamlBuildTaskLocation Condition="'$(XamlBuildTaskPath)'!=''">$(XamlBuildTaskPath)</XamlBuildTaskLocation> </PropertyGroup> <PropertyGroup> <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildToolsPath)\Microsoft.Xaml.targets</MSBuildAllProjects> </PropertyGroup> <PropertyGroup> <XamlGenCodeFileNames Condition="'$(XamlGenCodeFileNames)'==''">$(MSBuildProjectFile).XamlGeneratedCodeFileListAbsolute.txt</XamlGenCodeFileNames> <XamlGenMarkupFileNames Condition="'$(XamlGenMarkupFileNames)'==''">$(MSBuildProjectFile).XamlGeneratedXamlFileListAbsolute.txt</XamlGenMarkupFileNames> <XamlPass2FlagFile Condition="'$(XamlPass2FlagFile)'==''">$(MSBuildProjectFile).XamlPass2Flag.txt</XamlPass2FlagFile> </PropertyGroup> <ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'"> <AvailableItemName Include="XamlAppDef" /> </ItemGroup> <UsingTask Condition="'$(XamlBuildTaskPath)'==''" TaskName="Microsoft.Build.Tasks.Xaml.PartialClassGenerationTask" AssemblyName="$(XamlBuildTaskAssemblyName)" /> <UsingTask Condition="'$(XamlBuildTaskPath)'!=''" TaskName="Microsoft.Build.Tasks.Xaml.PartialClassGenerationTask" AssemblyFile="$(XamlBuildTaskPath)\XamlBuildTask.dll" /> <UsingTask Condition="'$(XamlBuildTaskPath)'==''" TaskName="Microsoft.Build.Tasks.Xaml.GenerateTemporaryAssemblyTask" AssemblyName="$(XamlBuildTaskAssemblyName)" /> <UsingTask Condition="'$(XamlBuildTaskPath)'!=''" TaskName="Microsoft.Build.Tasks.Xaml.GenerateTemporaryAssemblyTask" AssemblyFile="$(XamlBuildTaskPath)\XamlBuildTask.dll" /> <UsingTask Condition="'$(XamlBuildTaskPath)'==''" TaskName="Microsoft.Build.Tasks.Xaml.CompilationPass2Task" AssemblyName="$(XamlBuildTaskAssemblyName)" /> <UsingTask Condition="'$(XamlBuildTaskPath)'!=''" TaskName="Microsoft.Build.Tasks.Xaml.CompilationPass2Task" AssemblyFile="$(XamlBuildTaskPath)\XamlBuildTask.dll" /> <!-- ================================================================ DesignTimeXamlMarkupCompilation ================================================================ --> <PropertyGroup> <CoreCompileDependsOn Condition="'$(BuildingInsideVisualStudio)' == 'true'"> DesignTimeXamlMarkupCompilation; $(CoreCompileDependsOn) </CoreCompileDependsOn> </PropertyGroup> <PropertyGroup> <DesignTimeIntermediateOutputPath Condition="'$(DesignTimeIntermediateOutputPath)' == ''">$(IntermediateOutputPath)InProcessTempFiles\</DesignTimeIntermediateOutputPath> </PropertyGroup> <Target Name="DesignTimeXamlMarkupCompilation"> <!-- Make sure the directory exists. --> <MakeDir Directories="$(DesignTimeIntermediateOutputPath)" Condition="'@(XamlAppDef)' != ''"/> <CallTarget Condition="'$(BuildingProject)' != 'true' and '@(XamlAppDef)' != ''" Targets="InProcessXamlMarkupCompilePass1" /> </Target> <!-- ================================================================ InProcessXamlMarkupCompilePass1 ================================================================ --> <Target Name="InProcessXamlMarkupCompilePass1" Condition="'@(XamlAppDef)' != '' and '$(BuildingProject)' != 'true'"> <PartialClassGenerationTask BuildTaskPath="$(XamlBuildTaskLocation)" OutputPath="$(DesignTimeIntermediateOutputPath)" Language="$(Language)" ApplicationMarkup="@(XamlAppDef)" References="@(ReferencePath)" RootNamespace="$(RootNamespace)" SourceCodeFiles="@(Compile)" AssemblyName="$(AssemblyName)" IsInProcessXamlMarkupCompile="true" MSBuildProjectDirectory="$(MSBuildProjectDirectory)" XamlBuildTypeInspectionExtensionNames="@(XamlBuildTaskTypeInspectionExtensionName)" XamlBuildTypeGenerationExtensionNames="@(XamlBuildTaskTypeGenerationExtensionName)"> <Output ItemName="XamlInProcessGeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" /> <Output ItemName="XamlInProcessGeneratedResources" TaskParameter="GeneratedResources" /> <!-- This property is not required. However we need to populate it as the output of the task. --> <Output PropertyName="XamlInProcessRequiresCompilationPass2" TaskParameter="RequiresCompilationPass2" /> </PartialClassGenerationTask> <ItemGroup> <Compile Include="@(XamlInProcessGeneratedCodeFiles)" /> </ItemGroup> </Target> <!-- ================================================================ CleanInProcessXamlGeneratedFiles ================================================================ --> <Target Name="CleanInProcessXamlGeneratedFiles" Condition="'@(XamlAppDef)' != '' And '$(BuildingInsideVisualStudio)'!='true'" AfterTargets="DesignTimeXamlMarkupCompilation"> <ItemGroup> <FileWrites Include="$(DesignTimeIntermediateOutputPath)\*" /> </ItemGroup> </Target> <!-- ================================================================ XamlMarkupCompileReadGeneratedFileList ================================================================ --> <Target Name="XamlMarkupCompileReadGeneratedFileList" Condition="'@(XamlPage)' != '' or '@(XamlAppDef)' != ''" BeforeTargets="XamlMarkupCompilePass1"> <ReadLinesFromFile File="$(IntermediateOutputPath)$(XamlGenCodeFileNames)"> <Output TaskParameter="Lines" ItemName="XamlOutputCodeFilesList"/> </ReadLinesFromFile> <ReadLinesFromFile File="$(IntermediateOutputPath)$(XamlGenMarkupFileNames)"> <Output TaskParameter="Lines" ItemName="XamlOutputMarkupFilesList"/> </ReadLinesFromFile> </Target> <!-- ================================================================ XamlMarkupCompilePass1 ================================================================ --> <Target Name="XamlMarkupCompilePass1" Condition="'@(XamlPage)' != '' or '@(XamlAppDef)' != ''" Inputs="@(XamlAppDef);@(Compile);$(MSBuildAllProjects);@(ReferencePath)" Outputs="@(XamlOutputMarkupFilesList); @(XamlOutputCodeFilesList); $(IntermediateOutputPath)$(XamlGenCodeFileNames); $(IntermediateOutputPath)$(XamlGenMarkupFileNames); $(IntermediateOutputPath)$(XamlPass2FlagFile);"> <Message Text="(in) XamlPage: '@(XamlPage)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <Message Text="(in) XamlAppDef: '@(XamlAppDef)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <Message Text="(in) SourceCodeFiles: '@(Compile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <ItemGroup> <XamlGeneratedResources Remove="@(XamlGeneratedResources)" /> <XamlGeneratedCodeFiles Remove="@(XamlGeneratedCodeFiles)" /> </ItemGroup> <PartialClassGenerationTask BuildTaskPath="$(XamlBuildTaskLocation)" OutputPath="$(IntermediateOutputPath)" Language="$(Language)" ApplicationMarkup="@(XamlAppDef)" References="@(ReferencePath)" RootNamespace="$(RootNamespace)" SourceCodeFiles="@(Compile)" AssemblyName="$(AssemblyName)" IsInProcessXamlMarkupCompile="false" MSBuildProjectDirectory="$(MSBuildProjectDirectory)" XamlBuildTypeGenerationExtensionNames="@(XamlBuildTaskTypeGenerationExtensionName)" XamlBuildTypeInspectionExtensionNames="@(XamlBuildTaskTypeInspectionExtensionName)"> <Output ItemName="XamlGeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" /> <Output ItemName="XamlGeneratedResources" TaskParameter="GeneratedResources" /> <Output ItemName="XamlFileNames" TaskParameter="ApplicationMarkup" /> <Output PropertyName="XamlRequiresCompilationPass2" TaskParameter="RequiresCompilationPass2" /> </PartialClassGenerationTask> <WriteLinesToFile File="$(IntermediateOutputPath)$(XamlGenCodeFileNames)" Lines="@(XamlGeneratedCodeFiles)" Overwrite="true"/> <WriteLinesToFile File="$(IntermediateOutputPath)$(XamlGenMarkupFileNames)" Lines="@(XamlGeneratedResources)" Overwrite="true"/> <WriteLinesToFile File="$(IntermediateOutputPath)$(XamlPass2FlagFile)" Lines="@(XamlRequiresCompilationPass2)" Overwrite="true"/> <Message Text="(out) XamlGeneratedCodeFiles: '@(XamlGeneratedCodeFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <Message Text="(out) XamlGeneratedResources: '@(XamlGeneratedResources)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <Message Text="(out) XamlRequiresCompilationPass2 : '$(XamlRequiresCompilationPass2)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> </Target> <!-- ================================================================ XamlMarkupCompileAddFilesGenerated ================================================================ --> <Target Name="XamlMarkupCompileAddFilesGenerated" Condition="'@(XamlPage)' != '' or '@(XamlAppDef)' != ''" AfterTargets="XamlMarkupCompilePass1"> <ItemGroup> <XamlGeneratedCodeFiles Condition="'@(XamlGeneratedCodeFiles)' == ''" Include="@(XamlOutputCodeFilesList)" /> </ItemGroup> <ItemGroup> <XamlGeneratedResources Condition="'@(XamlGeneratedResources)' == ''" Include="@(XamlOutputMarkupFilesList)" /> </ItemGroup> <ItemGroup> <FileWrites Include="@(XamlGeneratedResources); @(XamlGeneratedCodeFiles); $(IntermediateOutputPath)$(XamlGenCodeFileNames); $(IntermediateOutputPath)$(XamlGenMarkupFileNames)" /> </ItemGroup> <ItemGroup> <Compile Include="@(XamlGeneratedCodeFiles)" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="@(XamlGeneratedResources)"> <GenerateResource>false</GenerateResource> <Type>Non-Resx</Type> <WithCulture>false</WithCulture> </EmbeddedResource> </ItemGroup> </Target> <!-- ================================================================ XamlMarkupCompileReadPass2Flag ================================================================ --> <Target Name="XamlMarkupCompileReadPass2Flag" Condition="'@(XamlPage)' != '' or '@(XamlAppDef)' != ''" BeforeTargets="XamlMarkupCompilePass2;XamlTemporaryAssemblyGeneration"> <ReadLinesFromFile File="$(IntermediateOutputPath)$(XamlPass2FlagFile)"> <Output TaskParameter="Lines" ItemName="XamlRequiresCompilationPass2"/> </ReadLinesFromFile> </Target> <!-- ================================================================ XamlTemporaryAssemblyGeneration ================================================================ --> <Target Name="XamlTemporaryAssemblyGeneration" Condition="'$(XamlRequiresCompilationPass2)' == 'true' " Inputs="@(XamlAppDef);@(Compile);$(MSBuildAllProjects);@(XamlGeneratedCodeFiles);@(ReferencePath)" Outputs="$(IntermediateOutputPath)$(XamlTemporaryAssemblyName).dll; $(IntermediateOutputPath)$(XamlTemporaryAssemblyName).pdb" DependsOnTargets="XamlMarkupCompilePass1;MarkupCompilePass1"> <Message Text="(in) MSBuildProjectFile: '$(MSBuildProjectFile)'" Condition="'$(MSBuildTargetsVerbose)' == 'true'" /> <Message Text="(in) CompileTargetName: '$(CompileTargetName)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <Message Text="(in) SourceCodeFiles: '@(XamlGeneratedCodeFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <GenerateTemporaryAssemblyTask OutputPath="$(IntermediateOutputPath)" CurrentProject="$(MSBuildProjectFullPath)" SourceCodeFiles="@(XamlGeneratedCodeFiles);@(_GeneratedCodeFiles)" AssemblyName="$(XamlTemporaryAssemblyName)" ApplicationMarkupTypeName="XamlAppDef" CompileTargetName="$(CompileTargetNameForTemporaryAssembly)" ReferencePaths="@(ReferencePath)" GeneratedResourcesFiles="@(XamlGeneratedResources)"> </GenerateTemporaryAssemblyTask> <PropertyGroup> <_XamlTemporaryAssemblyPath_>$(IntermediateOutputPath)$(XamlTemporaryAssemblyName).dll</_XamlTemporaryAssemblyPath_> <NonExistentFile>__NonExistentSubDir__\__NonExistentFile__</NonExistentFile> </PropertyGroup> <ItemGroup> <FileWrites Include="$(IntermediateOutputPath)$(XamlTemporaryAssemblyName).*" /> </ItemGroup> </Target> <Target Name="CompileTemporaryAssembly" DependsOnTargets="BuildOnlySettings;ResolveKeySource;_GenerateCompileInputs;CoreCompile" /> <!-- ================================================================ XamlMarkupCompilePass2 ================================================================ --> <Target Name="XamlMarkupCompilePass2" Condition="'$(XamlRequiresCompilationPass2)' == 'true' " Outputs="@(ExtensionGeneratedCodeFiles)" DependsOnTargets="XamlTemporaryAssemblyGeneration"> <Message Text="(in) XamlPage: '@(XamlPage)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <Message Text="(in) XamlAppDef: '@(XamlAppDef)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <Message Text="(in) References: '@(ReferencePath);$(_XamlTemporaryAssemblyPath_)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/> <CompilationPass2Task BuildTaskPath="$(XamlBuildTaskLocation)" ApplicationMarkup="@(XamlAppDef)" References="@(ReferencePath)" LocalAssemblyReference="$(_XamlTemporaryAssemblyPath_)" AssemblyName="$(AssemblyName)" RootNamespace="$(RootNamespace)" OutputPath="$(IntermediateOutputPath)" Language="$(Language)" SourceCodeFiles="@(Compile)" IsInProcessXamlMarkupCompile="false" MSBuildProjectDirectory="$(MSBuildProjectDirectory)" MSBuildArchitecture="$(PlatformTargetAsMSBuildArchitecture)" XamlBuildTypeInspectionExtensionNames="@(XamlBuildTaskTypeInspectionExtensionName)" ApplicationMarkupWithTypeName="@(XamlFileNames)"> <Output ItemName="ExtensionGeneratedCodeFiles" TaskParameter="ExtensionGeneratedCodeFiles" /> </CompilationPass2Task> <WriteLinesToFile File="$(IntermediateOutputPath)$(XamlPass2FlagFile)" Lines="false" Overwrite="true"/> <Message Text="(out) ExtensionGeneratedCodeFiles: '@(ExtensionGeneratedCodeFiles)'" /> <!-- Add extension files to the list of generated files so that they can be monitored and cleaned up --> <WriteLinesToFile File="$(IntermediateOutputPath)$(XamlGenCodeFileNames)" Lines="@(ExtensionGeneratedCodeFiles)" Overwrite="false"/> </Target> <!-- ================================================================ XamlMarkupCompileAddFilesGenerated ================================================================ --> <Target Name="XamlMarkupCompileAddExtensionFilesGenerated" Condition="'@(XamlPage)' != '' or '@(XamlAppDef)' != ''" AfterTargets="XamlMarkupCompilePass2"> <ItemGroup> <FileWrites Include="@(ExtensionGeneratedCodeFiles)" /> </ItemGroup> <ItemGroup> <Compile Include="@(ExtensionGeneratedCodeFiles)" /> </ItemGroup> </Target> <!-- ================================================================ GetCopyToOutputDirectoryXamlAppDefs Get all XamlAppDefs that may need to be transferred to the output directory. Compare GetCopyToOutputDirectoryItems in Microsoft.Common.targets ================================================================ --> <Target Name="GetCopyToOutputDirectoryXamlAppDefs" BeforeTargets="GetCopyToOutputDirectoryItems"> <ItemGroup> <_XamlAppDefItemsToCopy Include="@(XamlAppDef->'%(FullPath)')" Condition="'%(XamlAppDef.CopyToOutputDirectory)'=='Always' or '%(XamlAppDef.CopyToOutputDirectory)'=='PreserveNewest'"/> </ItemGroup> <AssignTargetPath Files="@(_XamlAppDefItemsToCopy)" RootFolder="$(MSBuildProjectDirectory)"> <Output TaskParameter="AssignedFiles" ItemName="_XamlAppDefItemsToCopyWithTargetPath" /> </AssignTargetPath> <!-- The _SourceItems properties are internal to Microsoft.Common.targets, but necessary to use here because there is no public equivalent --> <ItemGroup> <AllItemsFullPathWithTargetPath Include="@(_XamlAppDefItemsToCopyWithTargetPath)"/> <_SourceItemsToCopyToOutputDirectoryAlways Include="@(_XamlAppDefItemsToCopyWithTargetPath)" Condition="'%(_XamlAppDefItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='Always'"/> <_SourceItemsToCopyToOutputDirectory Include="@(_XamlAppDefItemsToCopyWithTargetPath)" Condition="'%(_XamlAppDefItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/> </ItemGroup> </Target> </Project> |