Update to .NETCore SDK 2.0.0
[platform/core/dotnet/build-tools.git] / dotnet / sdk / 2.0.0 / Roslyn / Microsoft.CSharp.Core.targets
1 <?xml version="1.0" encoding="utf-8"?>\r
2 <!-- Copyright (c)  Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information. -->\r
3 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
4   <Target Name="ShimReferencePathsWhenCommonTargetsDoesNotUnderstandReferenceAssemblies"\r
5           BeforeTargets="CoreCompile"\r
6           Condition="'@(ReferencePathWithRefAssemblies)' == ''">\r
7     <!-- Common targets should populate this item from dev15.3, but this file\r
8          may be used (via NuGet package) on earlier MSBuilds. If the\r
9          adjusted-for-reference-assemblies item is not populated, just use\r
10          the older item's contents. -->\r
11     <ItemGroup>\r
12       <ReferencePathWithRefAssemblies Include="@(ReferencePath)" />\r
13     </ItemGroup>\r
14   </Target>\r
15 \r
16   <Target Name="CoreCompile"\r
17           Inputs="$(MSBuildAllProjects);\r
18                   @(Compile);\r
19                   @(_CoreCompileResourceInputs);\r
20                   $(ApplicationIcon);\r
21                   $(AssemblyOriginatorKeyFile);\r
22                   @(ReferencePathWithRefAssemblies);\r
23                   @(CompiledLicenseFile);\r
24                   @(LinkResource);\r
25                   @(EmbeddedDocumentation);\r
26                   $(Win32Resource);\r
27                   $(Win32Manifest);\r
28                   @(CustomAdditionalCompileInputs);\r
29                   $(ResolvedCodeAnalysisRuleSet);\r
30                   @(AdditionalFiles);\r
31                   @(EmbeddedFiles)"\r
32           Outputs="@(DocFileItem);\r
33                    @(IntermediateAssembly);\r
34                    @(IntermediateRefAssembly);\r
35                    @(_DebugSymbolsIntermediatePath);\r
36                    $(NonExistentFile);\r
37                    @(CustomAdditionalCompileOutputs)"\r
38           Returns="@(CscCommandLineArgs)"\r
39           DependsOnTargets="$(CoreCompileDependsOn)">\r
40     <!-- These two compiler warnings are raised when a reference is bound to a different version\r
41              than specified in the assembly reference version number.  MSBuild raises the same warning in this case,\r
42              so the compiler warning would be redundant. -->\r
43     <PropertyGroup Condition="('$(TargetFrameworkVersion)' != 'v1.0') and ('$(TargetFrameworkVersion)' != 'v1.1')">\r
44       <NoWarn>$(NoWarn);1701;1702</NoWarn>\r
45     </PropertyGroup>\r
46 \r
47     <PropertyGroup>\r
48       <!-- To match historical behavior, when inside VS11+ disable the warning from csc.exe indicating that no sources were passed in-->\r
49       <NoWarn Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(VisualStudioVersion)' != '' AND '$(VisualStudioVersion)' &gt; '10.0'">$(NoWarn);2008</NoWarn>\r
50     </PropertyGroup>\r
51 \r
52     <ItemGroup Condition="'$(TargetingClr2Framework)' == 'true'">\r
53       <ReferencePathWithRefAssemblies>\r
54         <EmbedInteropTypes />\r
55       </ReferencePathWithRefAssemblies>\r
56     </ItemGroup>\r
57 \r
58     <PropertyGroup>\r
59       <!-- If the user has specified AppConfigForCompiler, we'll use it. If they have not, but they set UseAppConfigForCompiler,\r
60                  then we'll use AppConfig -->\r
61       <AppConfigForCompiler Condition="'$(AppConfigForCompiler)' == '' AND '$(UseAppConfigForCompiler)' == 'true'">$(AppConfig)</AppConfigForCompiler>\r
62 \r
63       <!-- If we are targeting winmdobj we want to specifically the pdbFile property since we do not want it to collide with the output of winmdexp-->\r
64       <PdbFile Condition="'$(PdbFile)' == '' AND '$(OutputType)' == 'winmdobj' AND '$(_DebugSymbolsProduced)' == 'true'">$(IntermediateOutputPath)$(TargetName).compile.pdb</PdbFile>\r
65     </PropertyGroup>\r
66 \r
67     <!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 -->\r
68     <PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')">\r
69       <Prefer32Bit>false</Prefer32Bit>\r
70     </PropertyGroup>\r
71 \r
72     <!-- TODO: Remove this ItemGroup once it has been moved to "_GenerateCompileInputs" target in Microsoft.Common.CurrentVersion.targets.\r
73          https://github.com/dotnet/roslyn/issues/12223 -->\r
74     <ItemGroup Condition="('$(AdditionalFileItemNames)' != '')">\r
75       <AdditionalFileItems Include="$(AdditionalFileItemNames)" />\r
76       <AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" />\r
77     </ItemGroup>\r
78 \r
79     <PropertyGroup Condition="'$(UseSharedCompilation)' == ''">\r
80       <UseSharedCompilation>true</UseSharedCompilation>\r
81     </PropertyGroup>\r
82 \r
83     <!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->\r
84     <Csc Condition="'%(_CoreCompileResourceInputs.WithCulture)' != 'true'"\r
85          AdditionalLibPaths="$(AdditionalLibPaths)"\r
86          AddModules="@(AddModules)"\r
87          AdditionalFiles="@(AdditionalFiles)"\r
88          AllowUnsafeBlocks="$(AllowUnsafeBlocks)"\r
89          Analyzers="@(Analyzer)"\r
90          ApplicationConfiguration="$(AppConfigForCompiler)"\r
91          BaseAddress="$(BaseAddress)"\r
92          CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"\r
93          ChecksumAlgorithm="$(ChecksumAlgorithm)"\r
94          CodeAnalysisRuleSet="$(ResolvedCodeAnalysisRuleSet)"\r
95          CodePage="$(CodePage)"\r
96          DebugType="$(DebugType)"\r
97          DefineConstants="$(DefineConstants)"\r
98          DelaySign="$(DelaySign)"\r
99          DisabledWarnings="$(NoWarn)"\r
100          DocumentationFile="@(DocFileItem)"\r
101          EmbeddedFiles="@(EmbeddedFiles)"\r
102          EmitDebugInformation="$(DebugSymbols)"\r
103          EnvironmentVariables="$(CscEnvironment)"\r
104          ErrorEndLocation="$(ErrorEndLocation)"\r
105          ErrorLog="$(ErrorLog)"\r
106          ErrorReport="$(ErrorReport)"\r
107          Features="$(Features)"\r
108          FileAlignment="$(FileAlignment)"\r
109          GenerateFullPaths="$(GenerateFullPaths)"\r
110          HighEntropyVA="$(HighEntropyVA)"\r
111          Instrument="$(Instrument)"\r
112          KeyContainer="$(KeyContainerName)"\r
113          KeyFile="$(KeyOriginatorFile)"\r
114          LangVersion="$(LangVersion)"\r
115          LinkResources="@(LinkResource)"\r
116          MainEntryPoint="$(StartupObject)"\r
117          ModuleAssemblyName="$(ModuleAssemblyName)"\r
118          NoConfig="true"\r
119          NoLogo="$(NoLogo)"\r
120          NoStandardLib="$(NoCompilerStandardLib)"\r
121          NoWin32Manifest="$(NoWin32Manifest)"\r
122          Optimize="$(Optimize)"\r
123          Deterministic="$(Deterministic)"\r
124          PublicSign="$(PublicSign)"\r
125          OutputAssembly="@(IntermediateAssembly)"\r
126          OutputRefAssembly="@(IntermediateRefAssembly)"\r
127          PdbFile="$(PdbFile)"\r
128          Platform="$(PlatformTarget)"\r
129          Prefer32Bit="$(Prefer32Bit)"\r
130          PreferredUILang="$(PreferredUILang)"\r
131          ProvideCommandLineArgs="$(ProvideCommandLineArgs)"\r
132          References="@(ReferencePathWithRefAssemblies)"\r
133          ReportAnalyzer="$(ReportAnalyzer)"\r
134          Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"\r
135          ResponseFiles="$(CompilerResponseFile)"\r
136          RuntimeMetadataVersion="$(RuntimeMetadataVersion)"\r
137          SkipCompilerExecution="$(SkipCompilerExecution)"\r
138          Sources="@(Compile)"\r
139          SubsystemVersion="$(SubsystemVersion)"\r
140          TargetType="$(OutputType)"\r
141          ToolExe="$(CscToolExe)"\r
142          ToolPath="$(CscToolPath)"\r
143          TreatWarningsAsErrors="$(TreatWarningsAsErrors)"\r
144          UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"\r
145          UseSharedCompilation="$(UseSharedCompilation)"\r
146          Utf8Output="$(Utf8Output)"\r
147          VsSessionGuid="$(VsSessionGuid)"\r
148          WarningLevel="$(WarningLevel)"\r
149          WarningsAsErrors="$(WarningsAsErrors)"\r
150          WarningsNotAsErrors="$(WarningsNotAsErrors)"\r
151          Win32Icon="$(ApplicationIcon)"\r
152          Win32Manifest="$(Win32Manifest)"\r
153          Win32Resource="$(Win32Resource)"\r
154          PathMap="$(PathMap)"\r
155          SourceLink="$(SourceLink)">\r
156       <Output TaskParameter="CommandLineArgs" ItemName="CscCommandLineArgs" />\r
157     </Csc>\r
158 \r
159     <ItemGroup>\r
160       <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />\r
161     </ItemGroup>\r
162 \r
163     <CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''" />\r
164   </Target>\r
165 </Project>