Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

Microsoft.CSharp.Core.targets 7.9KB

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