Unpack dotnet sdk zipfile and add documentation file to nupkg
[platform/core/dotnet/build-tools.git] / dotnet / sdk / 2.0.0-preview1-005700 / Sdks / Microsoft.NET.Sdk / build / Microsoft.NET.Sdk.BeforeCommon.targets
1 <!--\r
2 ***********************************************************************************************\r
3 Microsoft.NET.Sdk.BeforeCommon.targets\r
4 \r
5 WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\r
6           created a backup copy.  Incorrect changes to this file will make it\r
7           impossible to load or build your projects from the command-line or the IDE.\r
8 \r
9 Copyright (c) .NET Foundation. All rights reserved. \r
10 ***********************************************************************************************\r
11 -->\r
12 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
13 \r
14   <PropertyGroup>\r
15     <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>\r
16   </PropertyGroup>\r
17 \r
18   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DefaultAssemblyInfo.targets" />\r
19 \r
20   <!-- Set default intermediate and output paths -->\r
21   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DefaultOutputPaths.targets" />\r
22   \r
23   <!-- \r
24     Expand TargetFramework to TargetFrameworkIdentifier and TargetFrameworkVersion,\r
25     and adjust intermediate and output paths to include it.\r
26   -->\r
27   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.TargetFrameworkInference.targets" />\r
28 \r
29   <!--\r
30     Use RuntimeIdentifier to determine PlatformTarget.\r
31     Also, enforce that RuntimeIdentifier is always specified for .NETFramework executables.\r
32   -->\r
33   <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.RuntimeIdentifierInference.targets" />\r
34 \r
35   <PropertyGroup Condition="'$(_IsNETCoreOrNETStandard)' == ''">\r
36     <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</_IsNETCoreOrNETStandard>\r
37     <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">true</_IsNETCoreOrNETStandard>\r
38   </PropertyGroup>\r
39 \r
40   <!-- Unification / automatic binding redirect logic -->\r
41   <PropertyGroup>\r
42     <DesignTimeAutoUnify Condition="'$(DesignTimeAutoUnify)' == ''">true</DesignTimeAutoUnify>\r
43     <AutoUnifyAssemblyReferences Condition="'$(AutoUnifyAssemblyReferences)' == '' and $(OutputType) == 'Library'">true</AutoUnifyAssemblyReferences>\r
44     <AutoUnifyAssemblyReferences Condition="'$(AutoUnifyAssemblyReferences)' == '' and '$(_IsNETCoreOrNETStandard)' == 'true'">true</AutoUnifyAssemblyReferences>\r
45   </PropertyGroup>\r
46   <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(OutputType)' == 'Exe'">\r
47     <AutoGenerateBindingRedirects Condition="'$(AutoGenerateBindingRedirects)' == ''">true</AutoGenerateBindingRedirects>\r
48   </PropertyGroup>\r
49 \r
50   <!-- Default settings for .NET Core and .NET Standard build logic -->\r
51   <PropertyGroup Condition="'$(_IsNETCoreOrNETStandard)' == 'true'">\r
52     <GenerateDependencyFile Condition=" '$(GenerateDependencyFile)' == '' ">true</GenerateDependencyFile>\r
53 \r
54     <!-- Force .dll extension for .NETCoreApp and .NETStandard projects even if output type is exe. -->\r
55     <TargetExt Condition="'$(TargetExt)' == ''">.dll</TargetExt>\r
56 \r
57     <!-- dependencies coming from the package manager lock file should not be copied locally for .NET Core and .NETStandard projects -->\r
58     <CopyLocalLockFileAssemblies Condition="'$(CopyLocalLockFileAssemblies)' == ''">false</CopyLocalLockFileAssemblies>\r
59   </PropertyGroup>\r
60   \r
61   <!-- Regardless of platform, enable dependency file generation if PreserveCompilatioContext is set. -->\r
62   <PropertyGroup>\r
63     <GenerateDependencyFile Condition="'$(GenerateDependencyFile)' == ''">$(PreserveCompilationContext)</GenerateDependencyFile>\r
64   </PropertyGroup>\r
65 \r
66   <!-- Set PublishDir here, before Microsoft.Common.targets, to avoid a competing default there. -->\r
67   <PropertyGroup>\r
68     <PublishDirName Condition="'$(PublishDirName)' == ''">publish</PublishDirName>\r
69     <!-- ensure the PublishDir is RID specific-->\r
70     <PublishDir Condition="'$(PublishDir)' == '' and\r
71                            '$(AppendRuntimeIdentifierToOutputPath)' != 'true' and\r
72                            '$(RuntimeIdentifier)' != '' and\r
73                            '$(_UsingDefaultRuntimeIdentifier)' != 'true'">$(OutputPath)$(RuntimeIdentifier)\$(PublishDirName)\</PublishDir>\r
74     <PublishDir Condition="'$(PublishDir)' == ''">$(OutputPath)$(PublishDirName)\</PublishDir>\r
75   </PropertyGroup>\r
76 \r
77   <!-- For .NET Framework, reference core assemblies -->\r
78 \r
79   <PropertyGroup>\r
80     <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion)</_TargetFrameworkVersionWithoutV>\r
81     <_TargetFrameworkVersionWithoutV Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.Substring(1))</_TargetFrameworkVersionWithoutV>\r
82   </PropertyGroup>\r
83   \r
84   <ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'">\r
85 \r
86     <Reference Include="System"/>\r
87     <Reference Include="System.Data"/>\r
88     <Reference Include="System.Drawing"/>\r
89     <Reference Include="System.Xml"/>\r
90 \r
91     <!-- When doing greater than/less than comparisons between strings, MSBuild will try to parse the strings as Version objects and compare them as\r
92          such if the parse succeeds. -->\r
93     \r
94     <!-- Framework assemblies introduced in .NET 3.5 -->\r
95     <Reference Include="System.Core" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/>\r
96     <Reference Include="System.Runtime.Serialization" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/>\r
97     <Reference Include="System.Xml.Linq" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/>\r
98 \r
99     <!-- Framework assemblies introduced in .NET 4.0 -->\r
100     <Reference Include="System.Numerics" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.0' "/>\r
101 \r
102     <!-- Framework assemblies introduced in .NET 4.5 -->\r
103     <Reference Include="System.IO.Compression.FileSystem" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/>\r
104     \r
105     <!-- Don't automatically reference System.IO.Compression or System.Net.Http to help avoid hitting https://github.com/Microsoft/msbuild/issues/1329. -->\r
106     <!--<Reference Include="System.IO.Compression" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/>\r
107     <Reference Include="System.Net.Http" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/>-->\r
108 \r
109   </ItemGroup>\r
110 \r
111   <!-- Add conditional compilation symbols for the target framework (for example NET461, NETSTANDARD2_0, NETCOREAPP1_0) -->\r
112   <PropertyGroup Condition=" '$(DisableImplicitFrameworkDefines)' != 'true' and '$(TargetFrameworkIdentifier)' != '.NETPortable'">\r
113     <_FrameworkIdentifierForImplicitDefine>$(TargetFrameworkIdentifier.Replace('.', '').ToUpperInvariant())</_FrameworkIdentifierForImplicitDefine>\r
114     <_FrameworkIdentifierForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">NET</_FrameworkIdentifierForImplicitDefine>\r
115 \r
116     <_FrameworkVersionForImplicitDefine Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.SubString(1))</_FrameworkVersionForImplicitDefine>\r
117     <_FrameworkVersionForImplicitDefine Condition="!$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion)</_FrameworkVersionForImplicitDefine>\r
118 \r
119     <_FrameworkVersionForImplicitDefine>$(_FrameworkVersionForImplicitDefine.Replace('.', '_'))</_FrameworkVersionForImplicitDefine>\r
120     \r
121     <_FrameworkVersionForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">$(_FrameworkVersionForImplicitDefine.Replace('_', ''))</_FrameworkVersionForImplicitDefine>\r
122 \r
123     <ImplicitFrameworkDefine>$(_FrameworkIdentifierForImplicitDefine)$(_FrameworkVersionForImplicitDefine)</ImplicitFrameworkDefine>\r
124   </PropertyGroup>\r
125 \r
126   <!-- Handle XML documentation file settings -->\r
127   <PropertyGroup Condition="'$(GenerateDocumentationFile)' == ''">\r
128     <GenerateDocumentationFile Condition="'$(DocumentationFile)' == ''">false</GenerateDocumentationFile>\r
129     <GenerateDocumentationFile Condition="'$(DocumentationFile)' != ''">true</GenerateDocumentationFile>\r
130   </PropertyGroup>\r
131 \r
132   <PropertyGroup Condition="'$(GenerateDocumentationFile)' == 'true' and '$(DocumentationFile)' == ''">\r
133     <DocumentationFile>$(IntermediateOutputPath)$(AssemblyName).xml</DocumentationFile>\r
134   </PropertyGroup>\r
135 \r
136   <PropertyGroup Condition="'$(GenerateDocumentationFile)' != 'true'">\r
137     <DocumentationFile />\r
138   </PropertyGroup>\r
139 \r
140   <!-- 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 -->\r
141   <ItemGroup>\r
142     <ProjectCapability Include="GenerateDocumentationFile" />\r
143   </ItemGroup>\r
144 \r
145 </Project>\r