corefx/build.proj

98 строки
4.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<!-- required to build the projects in their specified order -->
<PropertyGroup>
<SerializeProjects>true</SerializeProjects>
</PropertyGroup>
<ItemGroup>
<Project Include="src\dirs.proj">
<!-- For the root traversal default filter the OSGroup to the OSEnvironment which is the OS we are running on -->
<FilterToOSGroup Condition="'$(BuildAllOSGroups)' != 'true'">$(OSEnvironment)</FilterToOSGroup>
</Project>
<Project Include="src\packages.builds">
<!-- When we do a traversal build we build all libraries prior to building packages -->
<AdditionalProperties>BuildPackageLibraryReferences=false</AdditionalProperties>
<!-- For the root traversal default filter the OSGroup to the OSEnvironment which is the OS we are running on -->
<FilterToOSGroup Condition="'$(BuildAllOSGroups)' != 'true'">$(OSEnvironment)</FilterToOSGroup>
</Project>
<Project Include="src\post.builds">
<!-- For the root traversal default filter the OSGroup to the OSEnvironment which is the OS we are running on -->
<FilterToOSGroup Condition="'$(BuildAllOSGroups)' != 'true'">$(OSEnvironment)</FilterToOSGroup>
</Project>
</ItemGroup>
<Import Project="dir.targets" />
<Import Project="dir.traversal.targets" />
<Import Project="$(ToolsDir)clean.targets" />
<PropertyGroup>
<!--
Until we have the full clean\sync\build dev workflow in place we still default to restoring during build.
For those that wish to opt-out they can set RestoreDuringBuild=false or pass /p:RestoreDuringBuild=false.
-->
<RestoreDuringBuild Condition="'$(RestoreDuringBuild)'==''">true</RestoreDuringBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(RestoreDuringBuild)'=='true'">
<TraversalBuildDependsOn>
ValidateAllProjectDependencies;
BatchRestorePackages;
$(TraversalBuildDependsOn);
</TraversalBuildDependsOn>
</PropertyGroup>
<UsingTask TaskName="GatherDirectoriesToRestore" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
<Target Name="BatchRestorePackages">
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages..." />
<Exec Command="$(DnuRestoreCommand) @(DnuRestoreDir->'&quot;%(Identity)&quot;', ' ')"
StandardOutputImportance="Low"
CustomErrorRegularExpression="(^Unable to locate .*)|(^Updating the invalid lock file with .*)"
ContinueOnError="ErrorAndContinue" />
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages...Done." />
</Target>
<!-- Task from buildtools that validates dependencies contained in project.json files. -->
<UsingTask TaskName="ValidateProjectDependencyVersions" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
<Target Name="ValidateAllProjectDependencies"
Condition="'$(ValidatePackageVersions)'=='true' and '@(ProjectJsonFiles)'!=''">
<ValidateProjectDependencyVersions ProjectJsons="@(ProjectJsonFiles)"
ProhibitFloatingDependencies="$(ProhibitFloatingDependencies)"
ValidationPatterns="@(ValidationPattern)" />
</Target>
<Target Name="UpdateInvalidPackageVersions">
<ValidateProjectDependencyVersions ProjectJsons="@(ProjectJsonFiles)"
ProhibitFloatingDependencies="$(ProhibitFloatingDependencies)"
ValidationPatterns="@(ValidationPattern)"
UpdateInvalidDependencies="true" />
</Target>
<!-- Tasks from buildtools for easy project.json dependency updates -->
<UsingTask TaskName="UpdatePackageDependencyVersion" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
<Target Name="UpdatePackageDependencyVersion">
<UpdatePackageDependencyVersion ProjectJsons="@(ProjectJsonFiles)"
PackageId="$(PackageId)"
OldVersion="$(OldVersion)"
NewVersion="$(NewVersion)" />
</Target>
<!-- Override RestorePackages from dir.traversal.targets and do a batch restore -->
<Target Name="RestorePackages" DependsOnTargets="BatchRestorePackages" />
<!-- Override clean from dir.traversal.targets and just remove the full BinDir -->
<Target Name="Clean">
<RemoveDir Directories="$(BinDir)" />
</Target>
</Project>