[Tizen] Add BuildTools 2.1.0-rc1-02804-05
[platform/upstream/coreclr.git] / Tools / dotnetcli / sdk / 2.1.2 / Sdks / Microsoft.NET.Sdk / build / Microsoft.NET.Sdk.BeforeCommon.targets
1 <!--
2 ***********************************************************************************************
3 Microsoft.NET.Sdk.BeforeCommon.targets
4
5 WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6           created a backup copy.  Incorrect changes to this file will make it
7           impossible to load or build your projects from the command-line or the IDE.
8
9 Copyright (c) .NET Foundation. All rights reserved. 
10 ***********************************************************************************************
11 -->
12 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
13
14   <PropertyGroup>
15     <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
16     <_IsExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)'=='WinExe'">true</_IsExecutable>
17   </PropertyGroup>
18
19   <PropertyGroup Condition="'$(HasRuntimeOutput)' == ''">
20     <HasRuntimeOutput>$(_IsExecutable)</HasRuntimeOutput>
21     <_UsingDefaultForHasRuntimeOutput>true</_UsingDefaultForHasRuntimeOutput>
22   </PropertyGroup>
23
24   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DefaultAssemblyInfo.targets" />
25
26   <!-- Set default intermediate and output paths -->
27   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DefaultOutputPaths.targets" />
28   
29   <!-- 
30     Expand TargetFramework to TargetFrameworkIdentifier and TargetFrameworkVersion,
31     and adjust intermediate and output paths to include it.
32   -->
33   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.TargetFrameworkInference.targets" />
34
35   <!--
36     Use RuntimeIdentifier to determine PlatformTarget.
37     Also, enforce that RuntimeIdentifier is always specified for .NETFramework executables.
38   -->
39   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.RuntimeIdentifierInference.targets" />
40
41   <PropertyGroup Condition="'$(_IsNETCoreOrNETStandard)' == ''">
42     <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</_IsNETCoreOrNETStandard>
43     <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">true</_IsNETCoreOrNETStandard>
44   </PropertyGroup>
45
46   <!-- Unification / automatic binding redirect logic -->
47   <PropertyGroup>
48     <DesignTimeAutoUnify Condition="'$(DesignTimeAutoUnify)' == ''">true</DesignTimeAutoUnify>
49     <AutoUnifyAssemblyReferences Condition="'$(AutoUnifyAssemblyReferences)' == '' and $(OutputType) == 'Library'">true</AutoUnifyAssemblyReferences>
50     <AutoUnifyAssemblyReferences Condition="'$(AutoUnifyAssemblyReferences)' == '' and '$(_IsNETCoreOrNETStandard)' == 'true'">true</AutoUnifyAssemblyReferences>
51   </PropertyGroup>
52   <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(HasRuntimeOutput)' == 'true'">
53     <AutoGenerateBindingRedirects Condition="'$(AutoGenerateBindingRedirects)' == ''">true</AutoGenerateBindingRedirects>
54   </PropertyGroup>
55
56   <!-- Default settings for .NET Core and .NET Standard build logic -->
57   <PropertyGroup Condition="'$(_IsNETCoreOrNETStandard)' == 'true'">
58     <GenerateDependencyFile Condition=" '$(GenerateDependencyFile)' == '' ">true</GenerateDependencyFile>
59
60     <!-- Force .dll extension for .NETCoreApp and .NETStandard projects even if output type is exe. -->
61     <TargetExt Condition="'$(TargetExt)' == ''">.dll</TargetExt>
62
63     <!-- dependencies coming from the package manager lock file should not be copied locally for .NET Core and .NETStandard projects -->
64     <CopyLocalLockFileAssemblies Condition="'$(CopyLocalLockFileAssemblies)' == ''">false</CopyLocalLockFileAssemblies>
65
66     <!-- Disable the use of FrameworkPathOverride in Microsoft.Common.CurrentVersion.targets which can slow down evaluation.  FrameworkPathOverride
67     is not needed for NETStandard or NETCore since references come from NuGet packages-->
68     <EnableFrameworkPathOverride Condition="'$(EnableFrameworkPathOverride)' == ''">false</EnableFrameworkPathOverride>
69   </PropertyGroup>
70   
71   <!-- Regardless of platform, enable dependency file generation if PreserveCompilatioContext is set. -->
72   <PropertyGroup>
73     <GenerateDependencyFile Condition="'$(GenerateDependencyFile)' == ''">$(PreserveCompilationContext)</GenerateDependencyFile>
74   </PropertyGroup>
75
76   <!-- Set PublishDir here, before Microsoft.Common.targets, to avoid a competing default there. -->
77   <PropertyGroup>
78     <PublishDirName Condition="'$(PublishDirName)' == ''">publish</PublishDirName>
79     <!-- ensure the PublishDir is RID specific-->
80     <PublishDir Condition="'$(PublishDir)' == '' and
81                            '$(AppendRuntimeIdentifierToOutputPath)' != 'true' and
82                            '$(RuntimeIdentifier)' != '' and
83                            '$(_UsingDefaultRuntimeIdentifier)' != 'true'">$(OutputPath)$(RuntimeIdentifier)\$(PublishDirName)\</PublishDir>
84     <PublishDir Condition="'$(PublishDir)' == ''">$(OutputPath)$(PublishDirName)\</PublishDir>
85   </PropertyGroup>
86
87   <!-- For .NET Framework, reference core assemblies -->
88
89   <PropertyGroup>
90     <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion)</_TargetFrameworkVersionWithoutV>
91     <_TargetFrameworkVersionWithoutV Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.Substring(1))</_TargetFrameworkVersionWithoutV>
92   </PropertyGroup>
93
94   <!--
95     Sets RestoreAdditionalProjectSources or RestoreAdditionalProjectFallbackFolders to the SDK Offline Cache based
96     on the TargetFramework.
97   -->
98   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.NuGetOfflineCache.targets" />
99   
100   <ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'">
101
102     <_SDKImplicitReference Include="System"/>
103     <_SDKImplicitReference Include="System.Data"/>
104     <_SDKImplicitReference Include="System.Drawing"/>
105     <_SDKImplicitReference Include="System.Xml"/>
106
107     <!-- When doing greater than/less than comparisons between strings, MSBuild will try to parse the strings as Version objects and compare them as
108          such if the parse succeeds. -->
109     
110     <!-- Framework assemblies introduced in .NET 3.5 -->
111     <_SDKImplicitReference Include="System.Core" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/>
112     <_SDKImplicitReference Include="System.Runtime.Serialization" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/>
113     <_SDKImplicitReference Include="System.Xml.Linq" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/>
114
115     <!-- Framework assemblies introduced in .NET 4.0 -->
116     <_SDKImplicitReference Include="System.Numerics" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.0' "/>
117
118     <!-- Framework assemblies introduced in .NET 4.5 -->
119     <_SDKImplicitReference Include="System.IO.Compression.FileSystem" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/>
120     
121     <!-- Don't automatically reference System.IO.Compression or System.Net.Http to help avoid hitting https://github.com/Microsoft/msbuild/issues/1329. -->
122     <!--<Reference Include="System.IO.Compression" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/>
123     <_SDKImplicitReference Include="System.Net.Http" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/>-->
124
125     <!-- Set Pack=false on implicit references so they don't get added to NuGet packages as framework assemblies -->
126     <_SDKImplicitReference Update="@(_SDKImplicitReference)"
127                            Pack="false" />
128
129     <!-- Don't duplicate any references that are explicit in the project file.  This means that if you do want to include a framework assembly in your
130          NuGet package, you can just add the Reference to your project file. -->
131     <_SDKImplicitReference Remove="@(Reference)" />
132
133     <!-- Add the implicit references to @(Reference) -->
134     <Reference Include="@(_SDKImplicitReference)" />
135   </ItemGroup>
136
137   <PropertyGroup>
138     <!-- Prevent System.Core reference from being added separately (see Microsoft.NETFramework.CurrentVersion.props) -->
139     <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
140   </PropertyGroup>
141
142   <PropertyGroup Condition="'$(DisableImplicitAssetTargetFallback)' != 'true' and '$(_IsNETCoreOrNETStandard)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '2.0'">
143     <AssetTargetFallback>$(AssetTargetFallback);net461</AssetTargetFallback>
144   </PropertyGroup>
145
146   <!-- Add conditional compilation symbols for the target framework (for example NET461, NETSTANDARD2_0, NETCOREAPP1_0) -->
147   <PropertyGroup Condition=" '$(DisableImplicitFrameworkDefines)' != 'true' and '$(TargetFrameworkIdentifier)' != '.NETPortable' and '$(TargetFrameworkIdentifier)' != ''">
148     <_FrameworkIdentifierForImplicitDefine>$(TargetFrameworkIdentifier.Replace('.', '').ToUpperInvariant())</_FrameworkIdentifierForImplicitDefine>
149     <_FrameworkIdentifierForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">NET</_FrameworkIdentifierForImplicitDefine>
150
151     <_FrameworkVersionForImplicitDefine Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.SubString(1))</_FrameworkVersionForImplicitDefine>
152     <_FrameworkVersionForImplicitDefine Condition="!$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion)</_FrameworkVersionForImplicitDefine>
153
154     <_FrameworkVersionForImplicitDefine>$(_FrameworkVersionForImplicitDefine.Replace('.', '_'))</_FrameworkVersionForImplicitDefine>
155     
156     <_FrameworkVersionForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">$(_FrameworkVersionForImplicitDefine.Replace('_', ''))</_FrameworkVersionForImplicitDefine>
157
158     <ImplicitFrameworkDefine>$(_FrameworkIdentifierForImplicitDefine)$(_FrameworkVersionForImplicitDefine)</ImplicitFrameworkDefine>
159   </PropertyGroup>
160
161   <!-- Handle XML documentation file settings -->
162   <PropertyGroup Condition="'$(GenerateDocumentationFile)' == ''">
163     <GenerateDocumentationFile Condition="'$(DocumentationFile)' == ''">false</GenerateDocumentationFile>
164     <GenerateDocumentationFile Condition="'$(DocumentationFile)' != ''">true</GenerateDocumentationFile>
165   </PropertyGroup>
166
167   <PropertyGroup Condition="'$(GenerateDocumentationFile)' == 'true' and '$(DocumentationFile)' == ''">
168     <DocumentationFile>$(IntermediateOutputPath)$(AssemblyName).xml</DocumentationFile>
169   </PropertyGroup>
170
171   <PropertyGroup Condition="'$(GenerateDocumentationFile)' != 'true'">
172     <DocumentationFile />
173   </PropertyGroup>
174
175   <PropertyGroup>
176     <PublishDocumentationFiles Condition="'$(PublishDocumentationFiles)' == ''">true</PublishDocumentationFiles>
177     <PublishDocumentationFile Condition="'$(PublishDocumentationFile)' == '' and '$(PublishDocumentationFiles)' == 'true'">true</PublishDocumentationFile>
178     <PublishReferencesDocumentationFiles Condition="'$(PublishReferencesDocumentationFiles)' == '' and '$(PublishDocumentationFiles)' == 'true'">true</PublishReferencesDocumentationFiles>
179   </PropertyGroup>
180
181   <!-- Add a project capability so that the project properties in the IDE can show the option to generate an XML documentation file without specifying the filename -->
182   <ItemGroup>
183     <ProjectCapability Include="GenerateDocumentationFile" />
184   </ItemGroup>
185
186 </Project>