1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4 This file will contain all of the common properties from most repos. The intention is to only have
5 repo specific properties inside the repos, and move to this file everything that is common.
9 Import the reference assembly props
12 IsReferenceAssembly - Set if the project is in the ref assm path
14 <Import Project="$(MSBuildThisFileDirectory)ReferenceAssemblies.props" Condition="'$(ExcludeReferenceAssembliesImport)'!='true'" />
16 <Import Project="$(MSBuildThisFileDirectory)RepoAPI.Mapping.props" />
19 <ChecksumAlgorithm>SHA256</ChecksumAlgorithm>
23 <GetNuGetPackageVersionsDependsOn>CreateVersionFileDuringBuild</GetNuGetPackageVersionsDependsOn>
26 <!-- Platform detection -->
28 <DefaultOSGroup Condition="'$(OS)'=='Unix' AND Exists('/Applications')">OSX</DefaultOSGroup>
29 <DefaultOSGroup Condition="'$(DefaultOSGroup)'=='' AND '$(OS)'=='Unix'">Linux</DefaultOSGroup>
30 <DefaultOSGroup Condition="'$(DefaultOSGroup)'==''">$(OS)</DefaultOSGroup>
31 <RunningOnUnix Condition="'$(OS)'!='Windows_NT'">true</RunningOnUnix>
33 <RunningOnCore Condition="'$(MSBuildRuntimeType)' == 'core'">true</RunningOnCore>
36 <!-- Common BuildTools properties -->
38 <ToolsDir Condition="'$(ToolsDir)'==''">$(MSBuildThisFileDirectory)</ToolsDir>
39 <ToolRuntimePath Condition="'$(ToolRuntimePath)'==''">$(ToolsDir)</ToolRuntimePath>
40 <DotnetCliPath Condition="'$(DotnetCliPath)'==''">$(ToolRuntimePath)dotnetcli/</DotnetCliPath>
41 <OverrideToolHost Condition="'$(RunningOnUnix)' == 'true'">$(DotnetCliPath)dotnet</OverrideToolHost>
42 <OverrideToolHost Condition="'$(RunningOnUnix)' != 'true'">$(DotnetCliPath)dotnet.exe</OverrideToolHost>
43 <BuildToolsTaskDir Condition="'$(RunningOnCore)'!='true'">$(ToolsDir)net46/</BuildToolsTaskDir>
44 <BuildToolsTaskDir Condition="'$(RunningOnCore)'=='true'">$(ToolsDir)</BuildToolsTaskDir>
45 <RoslynIncompatibleMsbuildVersion Condition="'$(MSBuildToolsVersion)' == '2.0' OR
46 '$(MSBuildToolsVersion)' == '3.5' OR
47 '$(MSBuildToolsVersion)' == '4.0' OR
48 '$(MSBuildToolsVersion)' == '12.0' OR
49 '$(MSBuildToolsVersion)' == '14.0'">true</RoslynIncompatibleMsbuildVersion>
50 <!-- UseSharedCompilation is not supported in MSBuild 14.0 with the new version of roslyn, so make sure we are not using that for building -->
51 <UseSharedCompilation Condition="'$(UseSharedCompilation)' == '' and '$(UseRoslynCompilers)' != 'false' and '$(RoslynIncompatibleMsbuildVersion)' != 'true'">true</UseSharedCompilation>
52 <GenFacadesIgnoreBuildAndRevisionMismatch>true</GenFacadesIgnoreBuildAndRevisionMismatch>
55 <!-- Setting IsTestProject prior to Build.Common.targets -->
57 <IsTestProject Condition="'$(IsTestProject)'=='' And ($(MSBuildProjectFullPath.Contains('\tests\')) OR $(MSBuildProjectFullPath.Contains('/tests/')))">true</IsTestProject>
60 <Import Project="$(MSBuildThisFileDirectory)BuildVersion.targets" />
62 <Import Project="$(MSBuildThisFileDirectory)Roslyn.Common.props" Condition="'$(DisableBuildToolsRoslynVersion)' != 'true'" />
64 <!-- Restore commands -->
66 <DotnetToolCommand>$(OverrideToolHost)</DotnetToolCommand>
67 <DotnetRestoreSource>@(DotnetSourceList -> '--source %(Identity)', ' ')</DotnetRestoreSource>
68 <DotnetRestoreCommand>"$(DotnetToolCommand)"</DotnetRestoreCommand>
69 <DotnetRestoreCommand>$(DotnetRestoreCommand) restore</DotnetRestoreCommand>
70 <DotnetRestoreCommand>$(DotnetRestoreCommand) --packages "$(PackagesDir.TrimEnd('/').TrimEnd('\'))" $(DotnetRestoreSource)</DotnetRestoreCommand>
71 <DotnetRestoreCommand Condition="'$(NuGetConfigPath)'!=''">$(DotnetRestoreCommand) --configfile $(NuGetConfigPath)</DotnetRestoreCommand>
73 <!-- Keeping this for legacy reasons for now but should eliminate Dnu* eventually -->
74 <DnuRestoreCommand>$(DotnetRestoreCommand)</DnuRestoreCommand>
78 import the MicroBuild boot-strapper props (only relevant for shipping binaries)
80 <Import Project="$(MSBuildThisFileDirectory)MicroBuild.Core.props" Condition="'$(IsTestProject)'!='true' AND Exists('$(MSBuildThisFileDirectory)MicroBuild.Core.props')" />