279 lines
16 KiB
Plaintext
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition="Exists('..\dir.props')" Project="..\dir.props" />
<!-- We shipped assembly file version 4.6.x up until the end of rc3. Version assembly as
4.6.x to ensure compatability in Visual Studio for an in-place update. -->
<PropertyGroup>
<MajorVersion>4</MajorVersion>
<MinorVersion>6</MinorVersion>
</PropertyGroup>
<Import Condition="Exists('$(MSBuildProjectDirectory)/Configurations.props')" Project="$(MSBuildProjectDirectory)/Configurations.props" />
<!-- Informs build tools to apply .NET Framework metadata if not a test project -->
<PropertyGroup>
<IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
</PropertyGroup>
<!-- Common repo directories -->
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir>
<SourceDir>$(ProjectDir)src\</SourceDir>
<!-- Output directories -->
<BinDir Condition="'$(BinDir)'==''">$(ProjectDir)bin/</BinDir>
<ObjDir Condition="'$(ObjDir)'==''">$(BinDir)obj/</ObjDir>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'==''">$(ObjDir)</BaseIntermediateOutputPath>
<TestWorkingDir Condition="'$(TestWorkingDir)'==''">$(BinDir)tests/</TestWorkingDir>
<PackageOutputRoot Condition="'$(PackageOutputRoot)'=='' and '$(NonShippingPackage)' == 'true'">$(BinDir)packages_noship/</PackageOutputRoot>
<PackageOutputRoot Condition="'$(PackageOutputRoot)'==''">$(BinDir)packages/</PackageOutputRoot>
<!-- Input Directories -->
<PackagesDir Condition="'$(PackagesDir)'==''">$(ProjectDir)packages/</PackagesDir>
<ToolsDir Condition="'$(UseToolRuntimeForToolsDir)'=='true'">$(ToolRuntimePath)</ToolsDir>
<ToolsDir Condition="'$(ToolsDir)'==''">$(ProjectDir)Tools/</ToolsDir>
<ToolRuntimePath Condition="'$(ToolRuntimePath)'==''">$(ToolsDir)</ToolRuntimePath>
<!-- needs to be defined all the time to avoid indexing every file from the root -->
<GeneratedProjectJsonDir>$(ObjDir)generated</GeneratedProjectJsonDir>
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset>
</PropertyGroup>
<!-- Temporarily enable local build of tools -->
<Import Project="$(SourceDir)Tools\corefxTools.props" />
<Import Project="$(ToolRuntimePath)BuildVersion.targets" Condition="Exists('$(ToolRuntimePath)BuildVersion.targets')" />
<PropertyGroup>
<GenFacadesArgs>-ignoreBuildAndRevisionMismatch</GenFacadesArgs>
</PropertyGroup>
<!-- Import Build tools common props file where repo-independent properties are found -->
<Import Project="$(ToolsDir)Build.Common.props" Condition="Exists('$(ToolsDir)Build.Common.props')" />
<PropertyGroup>
<BuildToolsTargets45 Condition="'$(OsEnvironment)'=='Windows_NT'">true</BuildToolsTargets45>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)targetingpacks.props" />
<!-- Enable the analyzers for this repo -->
<PropertyGroup>
<EnableDotnetAnalyzers Condition="'$(EnableDotnetAnalyzers)'==''">true</EnableDotnetAnalyzers>
</PropertyGroup>
<!-- Provides package dependency version properties and verification/auto-upgrade configuration -->
<Import Project="$(MSBuildThisFileDirectory)dependencies.props" />
<!-- Explicitly setting
- SupportsUWP to true when TargetGroup is uap101*. This will enable the correct pinvoke checker to be picked
- BlockReflectionAttribute to true. This will enable injecting BlockReflectionAttribute.cs into the compile target.
TODO: Both of these properties are being set in buildtools targets, however they need to be updated to reflect uap101 changes.
-->
<PropertyGroup Condition="'$(TargetGroup)' == 'uap101' or '$(TargetGroup)' == 'uap101aot'">
<SupportsUWP>true</SupportsUWP>
<BlockReflectionAttribute>true</BlockReflectionAttribute>
</PropertyGroup>
<!-- Import packaging props -->
<Import Project="$(MSBuildThisFileDirectory)Packaging.props"/>
<!-- list of nuget package sources passed to dnu -->
<ItemGroup Condition="'$(ExcludeInternetFeeds)' != 'true'">
<!-- Example to consume local CoreCLR package:
/t:BatchRestorePackages /p:OverridePackageSource=C:\coreclr\bin\Product\Windows_NT.x64.Debug\.nuget\pkg
-->
<DnuSourceList Include="$(OverridePackageSource)" />
<DnuSourceList Condition="'$(BuildTestsAgainstPackages)' == 'true'" Include="$(PackagesDrops)" />
<!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. -->
<!-- Including buildtools to pull in TestSuite packages and repackaged xunit dependencies-->
<DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<DnuSourceList Include="https:%2F%2Fapi.nuget.org/v3/index.json" />
</ItemGroup>
<!-- This is the directory where we dynamically generate project.json's for our test build package dependencies -->
<PropertyGroup Condition="'$(BuildTestsAgainstPackages)' == 'true'">
<BuildTestsAgainstPackagesIdentityRegex>$(CoreFxVersionsIdentityRegex)</BuildTestsAgainstPackagesIdentityRegex>
<SkipVerifyPackageVersions>true</SkipVerifyPackageVersions>
</PropertyGroup>
<!-- list of directories to perform batch restore -->
<ItemGroup>
<DnuRestoreDir Include="$(MSBuildThisFileDirectory)src" />
<DnuRestoreDir Include="$(MSBuildThisFileDirectory)pkg" />
<DnuRestoreDir Include="$(MSBuildThisFileDirectory)layout" />
<DnuRestoreDir Condition="'$(BuildTestsAgainstPackages)' == 'true'" Include="$(GeneratedProjectJsonDir)" />
</ItemGroup>
<PropertyGroup>
<DnxPackageDir Condition="'$(DnxPackageDir)'==''">$(PackagesDir)/$(DnxPackageName)/</DnxPackageDir>
<DnuToolPath Condition="'$(DnuToolPath)'=='' and '$(RunningOnUnix)'!='true'">$(DnxPackageDir)/bin/dnu.cmd</DnuToolPath>
<DnuToolPath Condition="'$(DnuToolPath)'=='' and '$(RunningOnUnix)'=='true'">$(DnxPackageDir)/bin/dnu</DnuToolPath>
<DotnetToolCommand Condition="'$(DotnetToolCommand)' == '' and '$(RunningOnUnix)'!='true'">$(DotnetCliPath)dotnet.exe</DotnetToolCommand>
<DotnetToolCommand Condition="'$(DotnetToolCommand)' == '' and '$(RunningOnUnix)'=='true'">$(DotnetCliPath)dotnet</DotnetToolCommand>
<DnuToolPath>$(DotnetToolCommand)</DnuToolPath>
<DnuRestoreSource>@(DnuSourceList -> '--source %(Identity)', ' ')</DnuRestoreSource>
<DnuRestoreCommand>"$(DnuToolPath)"</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) restore</DnuRestoreCommand>
<DnuRestoreCommand Condition="'$(ParallelRestore)'=='true'">$(DnuRestoreCommand) --parallel</DnuRestoreCommand>
<DnuRestoreCommand Condition="'$(UseNuGetHttpCache)'!='true'">$(DnuRestoreCommand) --no-cache</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) --packages "$(PackagesDir.TrimEnd('/\'.ToCharArray()))" $(DnuRestoreSource)</DnuRestoreCommand>
<DnuRestoreCommand Condition="'$(LockDependencies)' == 'true'">$(DnuRestoreCommand) --lock</DnuRestoreCommand>
<DnuRestoreCommand Condition="'$(NuGetConfigPath)'!=''">$(DnuRestoreCommand) --configfile $(NuGetConfigPath)</DnuRestoreCommand>
</PropertyGroup>
<PropertyGroup>
<!-- By default make all libraries to be AnyCPU but individual projects can override it if they need to -->
<Platform>AnyCPU</Platform>
<OutputType>Library</OutputType>
<RunApiCompat>true</RunApiCompat>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true' and '$(Configuration)' != ''">
<!-- When building in VS setup the ConfigurationGroup based on the given Configuration -->
<ConfigurationGroup Condition="$(Configuration.EndsWith('Debug'))">Debug</ConfigurationGroup>
<ConfigurationGroup Condition="$(Configuration.EndsWith('Release'))">Release</ConfigurationGroup>
</PropertyGroup>
<PropertyGroup>
<!--
These *Group properties are only intended to enable passing them individually at the command line to initialize
BuildConfiguration. They will be overwritten by our configurations/configuration.props file and defaulted
based on Configuration for the individual projects which is selected based on BuildConfiguration.
See Documentation/coding-guidelines/project-guidelines.md for more details on our configurations.
-->
<TargetGroup Condition="'$(TargetGroup)' == ''">netcoreapp</TargetGroup>
<OSGroup Condition="'$(OSGroup)' == ''">$(OSEnvironment)</OSGroup>
<ConfigurationGroup Condition="'$(ConfigurationGroup)' == ''">Debug</ConfigurationGroup>
<ArchGroup Condition="'$(ArchGroup)' == ''">x64</ArchGroup>
<!-- Initialize BuildConfiguration from the individual properties if it wasn't already explicitly set -->
<BuildConfiguration Condition="'$(BuildConfiguration)' == ''">$(TargetGroup)-$(OSGroup)-$(ConfigurationGroup)-$(ArchGroup)</BuildConfiguration>
<BuildConfigurationImportFile>$(ToolsDir)/configuration/configuration.props</BuildConfigurationImportFile>
<!-- Need to try and keep the same logic as the native builds as we need this for packaging -->
<NativeBinDir>$(BinDir)$(OSGroup).$(ArchGroup).$(ConfigurationGroup)/native</NativeBinDir>
</PropertyGroup>
<Import Project="$(BuildConfigurationImportFile)" Condition="Exists('$(BuildConfigurationImportFile)')" />
<!-- Set up Default symbol and optimization for Configuration -->
<Choose>
<When Condition="'$(ConfigurationGroup)'=='Debug'">
<PropertyGroup>
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">false</Optimize>
<DebugType Condition="'$(DebugType)' == ''">full</DebugType>
<DefineConstants>$(DefineConstants),DEBUG,TRACE</DefineConstants>
</PropertyGroup>
</When>
<When Condition="'$(ConfigurationGroup)' == 'Release'">
<PropertyGroup>
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
<DefineConstants>$(DefineConstants),TRACE</DefineConstants>
</PropertyGroup>
</When>
</Choose>
<!-- Default Test platform to deploy the netstandard compiled tests to -->
<PropertyGroup>
<DefaultTestTFM>netcoreapp1.1</DefaultTestTFM>
<TestTFM Condition="'$(TestTFM)'==''">$(DefaultTestTFM)</TestTFM>
<!-- we default FilterToTestTFM to DefaultTestTFM if it is not explicity defined -->
<FilterToTestTFM Condition="'$(FilterToTestTFM)'==''">$(DefaultTestTFM)</FilterToTestTFM>
</PropertyGroup>
<PropertyGroup>
<IsRedistAssembly Condition="'$(IsRedistAssembly)'=='' AND ($(MSBuildProjectFullPath.Contains('\redist\')) OR $(MSBuildProjectFullPath.Contains('/redist/')))">true</IsRedistAssembly>
</PropertyGroup>
<PropertyGroup Condition="'$(IsRedistAssembly)'=='true'">
<NuGetRuntimeIdentifier Condition="'$(TargetGroup)' == 'netcore50'">win8</NuGetRuntimeIdentifier>
<NuGetRuntimeIdentifier Condition="'$(TargetGroup)' == 'netcore50aot'">win8-aot</NuGetRuntimeIdentifier>
<!-- workaround Dev14 issue with nuget targets -->
<RuntimeIndentifier>$(NuGetRuntimeIdentifier)</RuntimeIndentifier>
</PropertyGroup>
<!-- If there is a target group, try to find project.json and lockfile in a subfolder named as that target. -->
<PropertyGroup Condition="'$(TargetGroup)'!=''">
<ProjectJson Condition="Exists('$(MSBuildProjectDirectory)/$(TargetGroup)/project.json')">$(MSBuildProjectDirectory)/$(TargetGroup)/project.json</ProjectJson>
<!-- Check for both project.json and lockfile to avoid using a stale lockfile. -->
<ProjectLockJson Condition="Exists('$(MSBuildProjectDirectory)/$(TargetGroup)/project.json') AND Exists('$(MSBuildProjectDirectory)/$(TargetGroup)/project.lock.json')">$(MSBuildProjectDirectory)/$(TargetGroup)/project.lock.json</ProjectLockJson>
</PropertyGroup>
<!-- Disable some standard properties for building our projects -->
<PropertyGroup>
<NoStdLib>true</NoStdLib>
<NoExplicitReferenceToStdLib>true</NoExplicitReferenceToStdLib>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
</PropertyGroup>
<!-- Set up handling of build warnings -->
<PropertyGroup>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<!-- Set up some common paths -->
<PropertyGroup>
<CommonPath>$(SourceDir)Common\src</CommonPath>
<CommonTestPath>$(SourceDir)Common\tests</CommonTestPath>
</PropertyGroup>
<!-- Set up the default output and intermediate paths -->
<PropertyGroup>
<OSPlatformConfig>$(OSGroup).$(Platform).$(ConfigurationGroup)</OSPlatformConfig>
<TargetOutputRelPath Condition="'$(TargetGroup)'!=''">$(TargetGroup)/</TargetOutputRelPath>
<TestTargetOutputRelPath Condition="'$(TestTargetOutputRelPath)'=='' And '$(TargetGroup)'!='' And '$(TestTFM)'!=''">$(TargetGroup).$(TestTFM)/</TestTargetOutputRelPath>
<TestTargetOutputRelPath Condition="'$(TestTargetOutputRelPath)'=='' And '$(TargetGroup)'=='' And '$(TestTFM)'!=''">default.$(TestTFM)/</TestTargetOutputRelPath>
<BaseOutputPath Condition="'$(BaseOutputPath)'==''">$(BinDir)</BaseOutputPath>
<OutputPathSubfolder Condition="'$(IsCompatAssembly)'=='true'">/Compat</OutputPathSubfolder>
<OutputPath Condition="'$(OutputPath)'==''">$(BaseOutputPath)$(OSPlatformConfig)/$(MSBuildProjectName)/$(TargetOutputRelPath)$(OutputPathSubfolder)</OutputPath>
<IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(BaseIntermediateOutputPath)$(OSPlatformConfig)/</IntermediateOutputRootPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(IntermediateOutputRootPath)$(MSBuildProjectName)/$(TargetOutputRelPath)</IntermediateOutputPath>
<RuntimePath Condition="'$(RuntimePath)' == ''">$(BinDir)runtime/$(BuildConfiguration)/</RuntimePath>
<RefRootPath>$(BinDir)ref/</RefRootPath>
<BuildConfigurationRefPath>$(RefRootPath)$(_bc_TargetGroup)/</BuildConfigurationRefPath>
<RefPath>$(RefRootPath)$(TargetGroup)/</RefPath>
<!-- tests don't yet set appropriate configurations -->
<RefPath Condition="'$(IsTestProject)' == 'true'">$(BuildConfigurationRefPath)</RefPath>
<NetStandardRefPath>$(RefRootPath)netstandard/</NetStandardRefPath>
<NetFxRefPath>$(RefRootPath)netfx/</NetFxRefPath>
<!-- Paths to binplace package content -->
<NETCoreAppPackageRefPath>$(BinDir)netcoreapp\pkg\ref</NETCoreAppPackageRefPath>
<NETCoreAppPackageRuntimePath>$(BinDir)netcoreapp\pkg\lib</NETCoreAppPackageRuntimePath>
<!-- Constructed shared fx path for testing -->
<TestSharedFxDir>$(ToolsDir)testdotnetcli</TestSharedFxDir>
<PackagesBasePath Condition="'$(PackagesBasePath)'==''">$(BinDir)$(OSPlatformConfig)</PackagesBasePath>
<PackageOutputPath Condition="'$(PackageOutputPath)'==''">$(PackageOutputRoot)$(ConfigurationGroup)/</PackageOutputPath>
<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(PackageOutputPath)symbols/</SymbolPackageOutputPath>
</PropertyGroup>
<PropertyGroup>
<!-- Don't run tests if we're building another platform's binaries on Windows -->
<SkipTests Condition="'$(SkipTests)'=='' and ('$(OsEnvironment)'=='Windows_NT' and '$(TargetsWindows)'!='true' and '$(OSGroup)'!='AnyOS')">true</SkipTests>
</PropertyGroup>
<!-- Use Roslyn Compilers to build -->
<Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'!='true' and Exists('$(RoslynPropsFile)') and '$(UseRoslynCompilers)'!='false'" />
<Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'=='true' and Exists('$(RoslynPropsFile)')" />
</Project>