6bdd276d05
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
47 lines
3.0 KiB
XML
47 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="12.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<Target Name="CheckForBuildTools">
|
|
<Error Condition="!Exists('$(ToolsDir)') and '$(OverrideToolsDir)'=='true'"
|
|
Text="The tools directory [$(ToolsDir)] does not exist. Please run sync in your enlistment to ensure the tools are installed before attempting to build an individual project." />
|
|
<Error Condition="!Exists('$(ToolsDir)') and '$(OverrideToolsDir)'!='true'"
|
|
Text="The tools directory [$(ToolsDir)] does not exist. Please run init-tools.cmd in your enlistment to ensure the tools are installed before attempting to build an individual project." />
|
|
</Target>
|
|
|
|
<!-- Provide default targets which can be hooked onto or overridden as necessary -->
|
|
<Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
|
|
<Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" />
|
|
<Target Name="Test" />
|
|
|
|
<Import Project="$(ToolsDir)/Build.Common.targets" />
|
|
|
|
<!-- Override corefx multi targeting support -->
|
|
<Target Name="ConvertCommonMetadataToAdditionalProperties" BeforeTargets="AssignProjectConfiguration" />
|
|
|
|
<!-- Remove once we pick up buildtools with the fix - https://github.com/dotnet/buildtools/pull/1082 -->
|
|
<!-- Override GetLatestCommitHash with redirected error output to avoid bogus messages
|
|
about missing git tool when building inside VS -->
|
|
<Target Name="GetLatestCommitHash" Condition="'$(LatestCommit)'==''">
|
|
<Exec Command="git rev-parse HEAD 2>&1" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
|
|
<Output TaskParameter="ExitCode" PropertyName="LatestCommitExitCode" />
|
|
</Exec>
|
|
<!-- We shouldn't fail the build if we can't retreive the commit hash, so in this case just set it to N/A -->
|
|
<PropertyGroup Condition="'$(LatestCommitExitCode)'!='0'">
|
|
<LatestCommit>N/A</LatestCommit>
|
|
</PropertyGroup>
|
|
</Target>
|
|
|
|
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
|
|
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
|
|
the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
|
|
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
|
|
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
|
|
<!-- We do not want to target a portable profile.
|
|
TODO: Make this the default in buildtools so this is not necessary. -->
|
|
<TargetFrameworkProfile></TargetFrameworkProfile>
|
|
<!-- We set this property to avoid MSBuild errors regarding not setting TargetFrameworkProfile (see above line) -->
|
|
<PortableNuGetMode>true</PortableNuGetMode>
|
|
</PropertyGroup>
|
|
</Project>
|