<!--
***********************************************************************************************
Sdk.targets

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
          created a backup copy.  Incorrect changes to this file will make it
          impossible to load or build your projects from the command-line or the IDE.

Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(BeforeMicrosoftNETSdkTargets)" Condition="'$(BeforeMicrosoftNETSdkTargets)' != ''"/>

  <!-- Using the same property as Microsoft.CSharp.targets and presumably Microsoft.VisualBasic.targets here -->
  <PropertyGroup Condition="'$(TargetFrameworks)' != '' and '$(TargetFramework)' == ''">
    <IsCrossTargetingBuild>true</IsCrossTargetingBuild>
  </PropertyGroup>
  
  <Import Project="$(MSBuildThisFileDirectory)\..\..\PVSBuildToolsNETCoreCommon.props" Condition="'$(PVSBuildTools_NETCoreCommonProps)' == ''" />

  <Import Project="$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.Sdk.BeforeCommonCrossTargeting.targets"
          Condition="'$(IsCrossTargetingBuild)' == 'true'"/>
  <Import Project="$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.Sdk.BeforeCommon.targets"
          Condition="'$(IsCrossTargetingBuild)' != 'true'"/>

  <PropertyGroup Condition="'$(LanguageTargets)' == ''">
    <LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.csproj'">$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>
    <LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(MSBuildToolsPath)\Microsoft.VisualBasic.targets</LanguageTargets>
    <LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.fsproj'">$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.Sdk.FSharpTargetsShim.targets</LanguageTargets>

    <!-- If LanguageTargets isn't otherwise set, then just import the common targets.  This should allow the restore target to run,
         which could bring in NuGet packages that set the LanguageTargets to something else.  This means support for different
         languages could either be supplied via an SDK or via a NuGet package. -->
    <LanguageTargets Condition="'$(LanguageTargets)' == ''">$(MSBuildToolsPath)\Microsoft.Common.targets</LanguageTargets>
  </PropertyGroup>

  <!-- REMARK: Dont remove/rename, the LanguageTargets property is used by F# to hook inside the project's sdk
               using Sdk attribute (from .NET Core Sdk 1.0.0-preview4) -->
  <Import Project="$(LanguageTargets)"/>
  
  <Import Project="$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.Sdk.CrossTargeting.targets"
          Condition="'$(IsCrossTargetingBuild)' == 'true'"/>
  <Import Project="$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.Sdk.targets"
          Condition="'$(IsCrossTargetingBuild)' != 'true'"/>
  
  <Import Project="$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.Compatibility.targets"
          Condition="'$(PVSBuildTools_NETCoreSdkMajorVersion)' != '' and '$(PVSBuildTools_NETCoreSdkMajorVersion)' == '6' and Exists('$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.Compatibility.targets')" />
		  
  <Import Project="$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.ApiCompat.targets"
          Condition="'$(PVSBuildTools_NETCoreSdkMajorVersion)' != '' and '$(PVSBuildTools_NETCoreSdkMajorVersion)' &gt;= '7' and Exists('$(PVSBuildTools_NetCoreTargets)\Microsoft.NET.ApiCompat.targets')" />
  
  <!-- Import targets from NuGet.Build.Tasks.Pack package/Sdk -->
  <PropertyGroup Condition="'$(NuGetBuildTasksPackTargets)' == '' AND '$(ImportNuGetBuildTasksPackTargetsFromSdk)' != 'false'">
    <NuGetBuildTasksPackTargets>$(PVSBuildTools_NetCoreTargets)..\..\..\NuGet.Build.Tasks.Pack.targets</NuGetBuildTasksPackTargets>
    <ImportNuGetBuildTasksPackTargetsFromSdk>true</ImportNuGetBuildTasksPackTargetsFromSdk>
  </PropertyGroup>

  <Import Project="$(NuGetBuildTasksPackTargets)"
          Condition="Exists('$(NuGetBuildTasksPackTargets)') AND '$(ImportNuGetBuildTasksPackTargetsFromSdk)' == 'true'"/>

  <!-- Import targets from Microsoft.NET.Build.Container.targets -->
  <PropertyGroup>
    <_IsNotSetContainersTargetsDir>false</_IsNotSetContainersTargetsDir>
    <_IsNotSetContainersTargetsDir Condition=" '$(_ContainersTargetsDir)'=='' ">true</_IsNotSetContainersTargetsDir>
    <_ContainersTargetsDir Condition="$(_IsNotSetContainersTargetsDir)">$(PVSBuildTools_NetCoreTargets)..\..\..\Containers\build\</_ContainersTargetsDir>
  </PropertyGroup>

  <Import Project="$(PVSBuildTools_NetCoreTargets)..\..\..\Containers\build\Microsoft.NET.Build.Containers.props"
          Condition="Exists('$(PVSBuildTools_NetCoreTargets)..\..\..\Containers\build\Microsoft.NET.Build.Containers.props')" />

  <Import Project="$(_ContainersTargetsDir)Microsoft.NET.Build.Containers.targets"
    Condition="$(_IsNotSetContainersTargetsDir) AND Exists('$(_ContainersTargetsDir)Microsoft.NET.Build.Containers.targets')" />
</Project>
