summaryrefslogtreecommitdiff
path: root/Tools/Microsoft.NETFramework.targets
blob: 83a068608386e58c117cdeb828a660e01ea3b16c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!--
***********************************************************************************************
Microsoft.NetFramework.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.

This file contains .net framework specific properties, items and targets. They are factored into a Microsoft.NETFramework.targets and Microsoft.NetFramework.props
these two files are used to encapsulate the multi-targeting and framework specific build process.

Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
-->

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <!-- 
        In VS 2010 SP1 and VS 2012, both supported for asset compatibility, the MSBuild installed 
        as part of them did not enforce using the local ToolsVersion (4.0) in all cases, but instead 
        just used whatever ToolsVersion was in the project file if it existed on the machine, and 
        only forced 4.0 if that ToolsVersion did not exist.  

        Moving forward, we do want to enforce a single acting ToolsVersion per version of Visual Studio, 
        but in order to approximate this behavior on VS 2010 SP1 and VS 2012 as well, we've redirected 
        the targets:  If we're building using 4.X MSBuild (which doesn't define the new reserved 
        property, MSBuildAssemblyVersion), we'll point right back at the 4.0 targets, which still exist 
        as part of the .NET Framework.  Only if we're using the new MSBuild will we point to the current
        targets. 
   -->

   <Choose>
      <When Condition="'$(MSBuildAssemblyVersion)' == ''">
         <PropertyGroup>
            <NetFrameworkTargetsPath>$(MSBuildFrameworkToolsPath)\Microsoft.NETFramework.targets</NetFrameworkTargetsPath>
         </PropertyGroup>
      </When>
      <Otherwise>
         <PropertyGroup>
            <NetFrameworkTargetsPath>$(MSBuildToolsPath)\Microsoft.NETFramework.CurrentVersion.targets</NetFrameworkTargetsPath>
         </PropertyGroup>
      </Otherwise>
   </Choose>

   <PropertyGroup Condition="'$(MSBuildAssemblyVersion)' == ''">
      <!--
           Overrides for the Microsoft.NETFramework.targets extension targets.  Used to make sure that only the imports we specify 
           (hard-coded to 4.0 locations) are used, not the 12.0 locations that would be used by default. 
       -->
      <ImportByWildcardBefore40MicrosoftNetFrameworkTargets Condition="'$(ImportByWildcardBefore40MicrosoftNetFrameworkTargets)' == ''">$(ImportByWildcardBeforeMicrosoftNetFrameworkTargets)</ImportByWildcardBefore40MicrosoftNetFrameworkTargets>
      <ImportByWildcardBefore40MicrosoftNetFrameworkTargets Condition="'$(ImportByWildcardBefore40MicrosoftNetFrameworkTargets)' == ''">true</ImportByWildcardBefore40MicrosoftNetFrameworkTargets>

      <ImportByWildcardAfter40MicrosoftNetFrameworkTargets Condition="'$(ImportByWildcardAfter40MicrosoftNetFrameworkTargets)' == ''">$(ImportByWildcardAfterMicrosoftNetFrameworkTargets)</ImportByWildcardAfter40MicrosoftNetFrameworkTargets>
      <ImportByWildcardAfter40MicrosoftNetFrameworkTargets Condition="'$(ImportByWildcardAfter40MicrosoftNetFrameworkTargets)' == ''">true</ImportByWildcardAfter40MicrosoftNetFrameworkTargets>

      <ImportUserLocationsByWildcardBefore40MicrosoftNetFrameworkTargets Condition="'$(ImportUserLocationsByWildcardBefore40MicrosoftNetFrameworkTargets)' == ''">$(ImportUserLocationsByWildcardBeforeMicrosoftNetFrameworkTargets)</ImportUserLocationsByWildcardBefore40MicrosoftNetFrameworkTargets>
      <ImportUserLocationsByWildcardBefore40MicrosoftNetFrameworkTargets Condition="'$(ImportUserLocationsByWildcardBefore40MicrosoftNetFrameworkTargets)' == ''">true</ImportUserLocationsByWildcardBefore40MicrosoftNetFrameworkTargets>

      <ImportUserLocationsByWildcardAfter40MicrosoftNetFrameworkTargets Condition="'$(ImportUserLocationsByWildcardAfter40MicrosoftNetFrameworkTargets)' == ''">$(ImportUserLocationsByWildcardAfterMicrosoftNetFrameworkTargets)</ImportUserLocationsByWildcardAfter40MicrosoftNetFrameworkTargets>
      <ImportUserLocationsByWildcardAfter40MicrosoftNetFrameworkTargets Condition="'$(ImportUserLocationsByWildcardAfter40MicrosoftNetFrameworkTargets)' == ''">true</ImportUserLocationsByWildcardAfter40MicrosoftNetFrameworkTargets>

      <ImportByWildcardBeforeMicrosoftNetFrameworkTargets>false</ImportByWildcardBeforeMicrosoftNetFrameworkTargets>
      <ImportByWildcardAfterMicrosoftNetFrameworkTargets>false</ImportByWildcardAfterMicrosoftNetFrameworkTargets>
      <ImportUserLocationsByWildcardBeforeMicrosoftNetFrameworkTargets>false</ImportUserLocationsByWildcardBeforeMicrosoftNetFrameworkTargets>
      <ImportUserLocationsByWildcardAfterMicrosoftNetFrameworkTargets>false</ImportUserLocationsByWildcardAfterMicrosoftNetFrameworkTargets>
   </PropertyGroup>

   <ImportGroup Condition="'$(MSBuildAssemblyVersion)' == ''">
      <Import Project="$(MSBuildUserExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportBefore\*" Condition="'$(ImportUserLocationsByWildcardBefore40MicrosoftNetFrameworkTargets)' == 'true' and exists('$(MSBuildUserExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportBefore')"/>
      <Import Project="$(MSBuildExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportBefore\*" Condition="'$(ImportByWildcardBefore40MicrosoftNetFrameworkTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportBefore')"/>
   </ImportGroup> 

   <Import Project="$(NetFrameworkTargetsPath)" />

   <ImportGroup Condition="'$(MSBuildAssemblyVersion)' == ''">
      <Import Project="$(MSBuildExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportAfter\*" Condition="'$(ImportByWildcardAfter40MicrosoftNetFrameworkTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportAfter')"/>
      <Import Project="$(MSBuildUserExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportAfter\*" Condition="'$(ImportUserLocationsByWildcardAfter40MicrosoftNetFrameworkTargets)' == 'true' and exists('$(MSBuildUserExtensionsPath)\4.0\Microsoft.NETFramework.targets\ImportAfter')"/>
   </ImportGroup> 

</Project>