185 lines
10 KiB
XML
185 lines
10 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="14.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
<IsRuntimeAssembly Condition="'$(IsRuntimeAssembly)'=='' AND '$(IsReferenceAssembly)' != 'true' AND '$(BinPlaceRef)' != 'true' AND '$(IsTestProject)' != 'true'">true</IsRuntimeAssembly>
|
|
<!-- Try to determine if this is a simple library without a ref project.
|
|
https://github.com/dotnet/corefx/issues/14291 is tracking cleaning this up -->
|
|
<IsRuntimeAndReferenceAssembly Condition="'$(IsRuntimeAndReferenceAssembly)' == '' and '$(IsRuntimeAssembly)' == 'true' and Exists('$(SourceDir)/$(AssemblyName)') and !Exists('$(SourceDir)/$(AssemblyName)/ref') and !$(AssemblyName.StartsWith('System.Private'))">true</IsRuntimeAndReferenceAssembly>
|
|
<IsNETCoreAppRef Condition="'$(IsNETCoreAppRef)' == ''">$(IsNETCoreApp)</IsNETCoreAppRef>
|
|
<IsUAPRef Condition="'$(IsUAPRef)' == ''">$(IsUAP)</IsUAPRef>
|
|
|
|
<BuildingDesktopFacade Condition="'$(IsDesktopFacade)' == 'true' And ('$(TargetGroup)' == 'netfx' Or $(TargetGroup.StartsWith('net4')))" >true</BuildingDesktopFacade>
|
|
|
|
<!-- if building desktop facade, we don't bin place the refs -->
|
|
<BinPlaceRef Condition="'$(BinPlaceRef)' == '' And '$(BuildingDesktopFacade)' != 'true' And ('$(IsReferenceAssembly)' == 'true' OR '$(IsRuntimeAndReferenceAssembly)' == 'true')">true</BinPlaceRef>
|
|
<BinPlaceRuntime Condition="'$(BinPlaceRuntime)' == '' And ('$(IsRuntimeAssembly)' == 'true' OR '$(IsRuntimeAndReferenceAssembly)' == 'true')">true</BinPlaceRuntime>
|
|
|
|
<!-- if building desktop facade and bin placing the runtime, then we need to bin place the refs too -->
|
|
<BinPlaceRef Condition="'$(BuildingDesktopFacade)' == 'true' And '$(BinPlaceRuntime)' == 'true'">true</BinPlaceRef>
|
|
|
|
<BinPlaceUseHardlinksIfPossible Condition="'$(BinPlaceUseHardlinksIfPossible)' == ''">true</BinPlaceUseHardlinksIfPossible>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup Condition="'@(BinPlaceConfiguration)' == ''">
|
|
<!-- binplace to directories for the target vertical -->
|
|
<BinPlaceConfiguration Include="$(BuildConfiguration)">
|
|
<RefPath>$(BuildConfigurationRefPath)</RefPath>
|
|
<RuntimePath>$(RuntimePath)</RuntimePath>
|
|
</BinPlaceConfiguration>
|
|
|
|
<!-- binplace to directories for packages -->
|
|
<BinPlaceConfiguration Condition="'$(IsNETCoreApp)' == 'true' AND '$(BuildingNETCoreAppVertical)' == 'true'" Include="netcoreapp-$(_bc_OSGroup)">
|
|
<PackageFileRefPath Condition="'$(IsNETCoreAppRef)' == 'true'">$(NETCoreAppPackageRefPath)</PackageFileRefPath>
|
|
<PackageFileRuntimePath>$(NETCoreAppPackageRuntimePath)</PackageFileRuntimePath>
|
|
<RuntimePath Condition="'$(BinPlaceNETCoreAppPackage)' == 'true'">$(NETCoreAppPackageRuntimePath)\..\runtime</RuntimePath>
|
|
</BinPlaceConfiguration>
|
|
<BinPlaceConfiguration Condition="'$(IsUAP)' == 'true' AND '$(BuildingUAPVertical)' == 'true'" Include="uap-$(_bc_OSGroup)">
|
|
<PackageFileRefPath Condition="'$(IsUAPRef)'=='true'">$(UAPPackageRefPath)</PackageFileRefPath>
|
|
<PackageFileRuntimePath>$(UAPPackageRuntimePath)</PackageFileRuntimePath>
|
|
</BinPlaceConfiguration>
|
|
<BinPlaceConfiguration Condition="'$(IsUAP)' == 'true' AND '$(BuildingUAPAOTVertical)' == 'true'" Include="uapaot-$(_bc_OSGroup)">
|
|
<PackageFileRefPath Condition="'$(IsUAPRef)'=='true'">$(UAPPackageRefPath)</PackageFileRefPath>
|
|
<PackageFileRuntimePath>$(UAPAOTPackageRuntimePath)</PackageFileRuntimePath>
|
|
</BinPlaceConfiguration>
|
|
|
|
<!-- Setup the shared framework directory for testing -->
|
|
<BinPlaceConfiguration Condition="'$(BinPlaceTestSharedFramework)' == 'true'" Include="netcoreapp-$(_bc_OSGroup)">
|
|
<RuntimePath>$(NETCoreAppTestSharedFrameworkPath)</RuntimePath>
|
|
</BinPlaceConfiguration>
|
|
<!-- Setup the ILCInputFolder directory for testing uapaot -->
|
|
<BinPlaceConfiguration Condition="'$(BinPlaceILCInputFolder)' == 'true'" Include="uapaot-$(_bc_OSGroup)">
|
|
<RuntimePath>$(ILCFXInputFolder)</RuntimePath>
|
|
</BinPlaceConfiguration>
|
|
<!-- And the UAP folder for the F5 (CoreCLR UAP-debugging) scenario -->
|
|
<BinPlaceConfiguration Condition="'$(BinPlaceUAPFramework)' == 'true'" Include="uap-$(_bc_OSGroup)">
|
|
<RuntimePath>$(UAPTestSharedFrameworkPath)</RuntimePath>
|
|
</BinPlaceConfiguration>
|
|
<!-- binplace targeting packs which may be different from BuildConfiguration -->
|
|
<BinPlaceConfiguration Include="netstandard">
|
|
<RefPath>$(RefRootPath)netstandard/</RefPath>
|
|
</BinPlaceConfiguration>
|
|
<BinPlaceConfiguration Condition="'$(BuildAllConfigurations)' == 'true'"
|
|
Include="netcoreapp">
|
|
<RefPath>$(RefRootPath)netcoreapp/</RefPath>
|
|
</BinPlaceConfiguration>
|
|
<BinPlaceConfiguration Condition="'$(BuildAllConfigurations)' == 'true'"
|
|
Include="uap">
|
|
<RefPath>$(RefRootPath)uap/</RefPath>
|
|
</BinPlaceConfiguration>
|
|
<BinPlaceConfiguration Condition="'$(BuildAllConfigurations)' == 'true'"
|
|
Include="netfx">
|
|
<RefPath>$(RefRootPath)netfx/</RefPath>
|
|
</BinPlaceConfiguration>
|
|
</ItemGroup>
|
|
|
|
<Target Name="BinPlace"
|
|
DependsOnTargets="GetBinPlaceDirs;BinPlaceFiles;BinPlaceProps"
|
|
AfterTargets="CopyFilesToOutputDirectory"
|
|
Condition="'$(BinPlaceRef)' == 'true' OR '$(BinPlaceRuntime)' == 'true'" />
|
|
|
|
<Target Name="BinPlaceFiles"
|
|
Condition="'@(BinPlaceDir)' != ''"
|
|
DependsOnTargets="GetBinPlaceItems" >
|
|
|
|
<Message Importance="low" Text="BinPlaceDir: @(BinPlaceDir)" />
|
|
|
|
<Copy SourceFiles="@(BinPlaceItem)"
|
|
DestinationFolder="%(BinPlaceDir.Identity)"
|
|
SkipUnchangedFiles="true"
|
|
OverwriteReadOnlyFiles="true"
|
|
Retries="$(CopyRetryCount)"
|
|
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
|
|
UseHardlinksIfPossible="$(BinPlaceUseHardlinksIfPossible)">
|
|
<Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
|
|
</Copy>
|
|
</Target>
|
|
|
|
<UsingTask TaskName="SaveItems" AssemblyFile="$(CoreFxToolsTaskDir)CoreFx.Tools.dll"/>
|
|
<Target Name="BinPlaceProps"
|
|
Condition="'@(PackageFileDir)' != ''"
|
|
DependsOnTargets="GetBinPlaceItems" >
|
|
<PropertyGroup>
|
|
<_propsFilename>$(TargetName)</_propsFilename>
|
|
<_propsFilename Condition="'$(_propsFilename)' == ''">$(MSBuildProjectName)</_propsFilename>
|
|
<_projectDirLength>$(ProjectDir.Length)</_projectDirLength>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<_itemsToSave Include="@(BinPlaceItem)">
|
|
<!-- intentionally empty: to be set by pkgproj -->
|
|
<TargetPath></TargetPath>
|
|
</_itemsToSave>
|
|
|
|
<!-- Include source files. -->
|
|
<_itemsToSave Condition="'@(Compile)' != ''" Include="@(Compile->'%(FullPath)')">
|
|
<TargetPath>src</TargetPath>
|
|
<TargetPath Condition="$([System.String]::Copy('%(FullPath)').StartsWith('$(ProjectDir)'))">src/$([System.String]::Copy('%(FullPath)').Substring($(_projectDirLength)).Replace('\', '/'))</TargetPath>
|
|
<IsSourceCodeFile>true</IsSourceCodeFile>
|
|
</_itemsToSave>
|
|
</ItemGroup>
|
|
|
|
<Message Importance="low" Text="PackageFileDir: @(PackageFileDir)" />
|
|
|
|
<SaveItems ItemName="FileToPackage"
|
|
Items="@(_itemsToSave)"
|
|
Files="@(PackageFileDir->'%(Identity)\$(_propsFilename).props')" />
|
|
</Target>
|
|
|
|
<Target Name="GetBinPlaceItems" DependsOnTargets="GetCopyToOutputDirectoryItems">
|
|
<ItemGroup>
|
|
<BinPlaceItem Condition="Exists('$(TargetPath)')" Include="$(TargetPath)" />
|
|
<BinPlaceItem Condition="Exists('$(TargetDir)$(TargetName).pdb')" Include="$(TargetDir)$(TargetName).pdb" />
|
|
<BinPlaceItem Condition="'$(BinPlaceReferenceCopyLocalPaths)' != 'false'" Include="@(ReferenceCopyLocalPaths)" />
|
|
<BinPlaceItem Condition="'$(BinPlaceCopyToOutputDirectoryItems)' != 'false'" Include="@(AllItemsFullPathWithTargetPath)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="GetBinPlaceDirs" DependsOnTargets="GetBuildConfigurations">
|
|
<!-- find which, if any, build configuration of this project is best
|
|
for each binplace configuration -->
|
|
<FindBestConfigurations Properties="@(Property)"
|
|
PropertyValues="@(PropertyValue)"
|
|
SupportedConfigurations="$(_AllBuildConfigurations)"
|
|
Configurations="@(BinPlaceConfiguration)">
|
|
<Output TaskParameter="BestConfigurations" ItemName="_bestBinlaceConfigurations" />
|
|
</FindBestConfigurations>
|
|
|
|
<ItemGroup>
|
|
<_currentBinPlaceConfigurations Include="@(_bestBinlaceConfigurations)" Condition="'%(Identity)' == '$(Configuration)' OR '%(Identity)-$(ConfigurationGroup)' == '$(Configuration)'" />
|
|
|
|
<BinPlaceDir Condition="'$(BinPlaceRuntime)' == 'true'" Include="%(_currentBinPlaceConfigurations.RuntimePath)" />
|
|
<BinPlaceDir Condition="'$(BinPlaceRef)' == 'true'" Include="%(_currentBinPlaceConfigurations.RefPath)" />
|
|
|
|
<PackageFileDir Condition="'$(BinPlaceRuntime)' == 'true'" Include="%(_currentBinPlaceConfigurations.PackageFileRuntimePath)" />
|
|
<PackageFileDir Condition="'$(BinPlaceRef)' == 'true'" Include="%(_currentBinPlaceConfigurations.PackageFileRefPath)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<ItemGroup>
|
|
<AdditionalCleanDirectories Include="$(BinDir)netcoreapp" />
|
|
</ItemGroup>
|
|
|
|
<!-- Incremental clean only cleans paths under Intermediate or OutDir, handle additional paths -->
|
|
<Target Name="_CleanGetCurrentAdditionalFileWrites" BeforeTargets="_CleanGetCurrentAndPriorFileWrites">
|
|
<!-- find files under paths we care about and add them to _CleanCurrentFileWrites to ensure they are written to the file list -->
|
|
<FindUnderPath Path="%(AdditionalCleanDirectories.Identity)" Files="@(FileWrites)" UpdateToAbsolutePaths="true">
|
|
<Output TaskParameter="InPath" ItemName="_CleanCurrentFileWrites" />
|
|
</FindUnderPath>
|
|
</Target>
|
|
|
|
<Target Name="IncrementalCleanAdditionalDirectories" BeforeTargets="IncrementalClean">
|
|
<ItemGroup>
|
|
<_CleanOrphanAdditionalFileWrites Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanCurrentFileWrites)" />
|
|
</ItemGroup>
|
|
<FindUnderPath Path="%(AdditionalCleanDirectories.Identity)" Files="@(_CleanOrphanAdditionalFileWrites)">
|
|
<Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInAdditionalDirectories" />
|
|
</FindUnderPath>
|
|
|
|
<!-- Delete the orphaned files. IncrementalClean will remove these from the file list -->
|
|
<Delete Files="@(_CleanOrphanFileWritesInAdditionalDirectories)" TreatErrorsAsWarnings="true">
|
|
<Output TaskParameter="DeletedFiles" ItemName="_CleanOrphanFilesDeleted" />
|
|
</Delete>
|
|
</Target>
|
|
</Project>
|