diff options
Diffstat (limited to 'Tools/Build.Common.props')
-rwxr-xr-x | Tools/Build.Common.props | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Tools/Build.Common.props b/Tools/Build.Common.props new file mode 100755 index 0000000000..bcc593b8d7 --- /dev/null +++ b/Tools/Build.Common.props @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + This file will contain all of the common properties from most repos. The intention is to only have + repo specific properties inside the repos, and move to this file everything that is common. + --> + + <!-- + Import the reference assembly props + + Sets Properties: + IsReferenceAssembly - Set if the project is in the ref assm path + --> + <Import Project="$(MSBuildThisFileDirectory)ReferenceAssemblies.props" Condition="'$(ExcludeReferenceAssembliesImport)'!='true'" /> + + <Import Project="$(MSBuildThisFileDirectory)RepoAPI.Mapping.props" /> + + <PropertyGroup> + <ChecksumAlgorithm>SHA256</ChecksumAlgorithm> + </PropertyGroup> + + <PropertyGroup> + <GetNuGetPackageVersionsDependsOn>CreateVersionFileDuringBuild</GetNuGetPackageVersionsDependsOn> + </PropertyGroup> + + <!-- Platform detection --> + <PropertyGroup> + <DefaultOSGroup Condition="'$(OS)'=='Unix' AND Exists('/Applications')">OSX</DefaultOSGroup> + <DefaultOSGroup Condition="'$(DefaultOSGroup)'=='' AND '$(OS)'=='Unix'">Linux</DefaultOSGroup> + <DefaultOSGroup Condition="'$(DefaultOSGroup)'==''">$(OS)</DefaultOSGroup> + <RunningOnUnix Condition="'$(OS)'!='Windows_NT'">true</RunningOnUnix> + + <RunningOnCore Condition="'$(MSBuildRuntimeType)' == 'core'">true</RunningOnCore> + </PropertyGroup> + + <!-- Common BuildTools properties --> + <PropertyGroup> + <ToolsDir Condition="'$(ToolsDir)'==''">$(MSBuildThisFileDirectory)</ToolsDir> + <ToolRuntimePath Condition="'$(ToolRuntimePath)'==''">$(ToolsDir)</ToolRuntimePath> + <DotnetCliPath Condition="'$(DotnetCliPath)'==''">$(ToolRuntimePath)dotnetcli/</DotnetCliPath> + <OverrideToolHost Condition="'$(RunningOnUnix)' == 'true'">$(DotnetCliPath)dotnet</OverrideToolHost> + <OverrideToolHost Condition="'$(RunningOnUnix)' != 'true'">$(DotnetCliPath)dotnet.exe</OverrideToolHost> + <BuildToolsTaskDir Condition="'$(RunningOnCore)'!='true'">$(ToolsDir)net46/</BuildToolsTaskDir> + <BuildToolsTaskDir Condition="'$(RunningOnCore)'=='true'">$(ToolsDir)</BuildToolsTaskDir> + <RoslynIncompatibleMsbuildVersion Condition="'$(MSBuildToolsVersion)' == '2.0' OR + '$(MSBuildToolsVersion)' == '3.5' OR + '$(MSBuildToolsVersion)' == '4.0' OR + '$(MSBuildToolsVersion)' == '12.0' OR + '$(MSBuildToolsVersion)' == '14.0'">true</RoslynIncompatibleMsbuildVersion> + <!-- UseSharedCompilation is not supported in MSBuild 14.0 with the new version of roslyn, so make sure we are not using that for building --> + <UseSharedCompilation Condition="'$(UseSharedCompilation)' == '' and '$(UseRoslynCompilers)' != 'false' and '$(RoslynIncompatibleMsbuildVersion)' != 'true'">true</UseSharedCompilation> + <GenFacadesIgnoreBuildAndRevisionMismatch>true</GenFacadesIgnoreBuildAndRevisionMismatch> + </PropertyGroup> + + <!-- Setting IsTestProject prior to Build.Common.targets --> + <PropertyGroup> + <IsTestProject Condition="'$(IsTestProject)'=='' And ($(MSBuildProjectFullPath.Contains('\tests\')) OR $(MSBuildProjectFullPath.Contains('/tests/')))">true</IsTestProject> + </PropertyGroup> + + <Import Project="$(MSBuildThisFileDirectory)BuildVersion.targets" /> + + <Import Project="$(MSBuildThisFileDirectory)Roslyn.Common.props" Condition="'$(DisableBuildToolsRoslynVersion)' != 'true'" /> + + <!-- Restore commands --> + <PropertyGroup> + <DotnetToolCommand>$(OverrideToolHost)</DotnetToolCommand> + <DotnetRestoreSource>@(DotnetSourceList -> '--source %(Identity)', ' ')</DotnetRestoreSource> + <DotnetRestoreCommand>"$(DotnetToolCommand)"</DotnetRestoreCommand> + <DotnetRestoreCommand>$(DotnetRestoreCommand) restore</DotnetRestoreCommand> + <DotnetRestoreCommand>$(DotnetRestoreCommand) --packages "$(PackagesDir.TrimEnd('/').TrimEnd('\'))" $(DotnetRestoreSource)</DotnetRestoreCommand> + <DotnetRestoreCommand Condition="'$(NuGetConfigPath)'!=''">$(DotnetRestoreCommand) --configfile $(NuGetConfigPath)</DotnetRestoreCommand> + + <!-- Keeping this for legacy reasons for now but should eliminate Dnu* eventually --> + <DnuRestoreCommand>$(DotnetRestoreCommand)</DnuRestoreCommand> + </PropertyGroup> + + <!-- + import the MicroBuild boot-strapper props (only relevant for shipping binaries) + --> + <Import Project="$(MSBuildThisFileDirectory)MicroBuild.Core.props" Condition="'$(IsTestProject)'!='true' AND Exists('$(MSBuildThisFileDirectory)MicroBuild.Core.props')" /> +</Project> |