Microsoft.CSharp.targets 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  2. <PropertyGroup>
  3. <DefaultLanguageSourceExtension>.cs</DefaultLanguageSourceExtension>
  4. <Language>C#</Language>
  5. </PropertyGroup>
  6. <PropertyGroup>
  7. <DebugSymbols Condition=" '$(DebugType)' == 'none' ">false</DebugSymbols>
  8. <DebugType Condition=" '$(DebugType)' == 'none' "></DebugType>
  9. </PropertyGroup>
  10. <PropertyGroup>
  11. <CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
  12. <CoreCompileDependsOn></CoreCompileDependsOn>
  13. <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildToolsPath)\Microsoft.CSharp.targets</MSBuildAllProjects>
  14. </PropertyGroup>
  15. <PropertyGroup>
  16. <NoCompilerStandardLib Condition="'$(NoCompilerStandardLib)'==''">true</NoCompilerStandardLib>
  17. </PropertyGroup>
  18. <ItemGroup>
  19. <DocFileItem Include="$(DocumentationFile)" Condition="'$(DocumentationFile)' != ''"/>
  20. </ItemGroup>
  21. <Target Name="_AddCorlibReference" DependsOnTargets="GetReferenceAssemblyPaths">
  22. <!--
  23. HACK: We don't yet support property functions, so can't calculate FrameworkPathOverride
  24. by calling ToolLocationHelper.GetPathToStandardLibraries. Instead, we search the framework
  25. directories for mscorlib.dll by constructing a filtered item set, and assume it only has
  26. one item.
  27. -->
  28. <ItemGroup Condition="'$(MonoUseMicrosoftBuildDll)' != 'True'">
  29. <_ExplicitReference Include="@(_TargetFrameworkDirectories->'%(FullPath)\mscorlib.dll')" Condition="Exists('%(FullPath)\mscorlib.dll')">
  30. <Private>false</Private>
  31. </_ExplicitReference>
  32. </ItemGroup>
  33. <PropertyGroup Condition="'$(MonoUseMicrosoftBuildDll)' == 'True'">
  34. <_ExplicitMSCorlibPath>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries ('$(TargetFrameworkIdentifier)', '$(TargetFrameworkVersion)', '$(TargetFrameworkProfile)'))\mscorlib.dll</_ExplicitMSCorlibPath>
  35. </PropertyGroup>
  36. <ItemGroup Condition="'$(MonoUseMicrosoftBuildDll)' == 'True'">
  37. <_ExplicitReference Include="@(_TargetFrameworkDirectories->'%(FullPath)\mscorlib.dll')" Condition="Exists('%(FullPath)\mscorlib.dll')">
  38. <Private>false</Private>
  39. </_ExplicitReference>
  40. </ItemGroup>
  41. <ItemGroup Condition="'$(MonoUseMicrosoftBuildDll)' == 'True'">
  42. <_ExplicitReference Include="$(_ExplicitMSCorlibPath)" Condition="Exists('$(_ExplicitMSCorlibPath)')">
  43. <Private>false</Private>
  44. </_ExplicitReference>
  45. </ItemGroup>
  46. </Target>
  47. <Target
  48. Name="CoreCompile"
  49. Inputs="$(MSBuildAllProjects);@(Compile);@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile);
  50. $(KeyOriginatorFile);@(ReferencePath);$(ApplicationIcon);$(Win32Resource)"
  51. Outputs="@(DocFileItem);@(IntermediateAssembly)"
  52. DependsOnTargets="$(CoreCompileDependsOn)"
  53. >
  54. <Csc
  55. AdditionalLibPaths="$(AdditionalLibPaths)"
  56. AddModules="@(AddModules)"
  57. AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
  58. BaseAddress="$(BaseAddress)"
  59. CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
  60. CodePage="$(CodePage)"
  61. DebugType="$(DebugType)"
  62. DefineConstants="$(DefineConstants)"
  63. DelaySign="$(DelaySign)"
  64. DisabledWarnings="$(NoWarn)"
  65. DocumentationFile="@(DocFileItem)"
  66. EmitDebugInformation="$(DebugSymbols)"
  67. ErrorReport="$(ErrorReport)"
  68. FileAlignment="$(FileAlignment)"
  69. GenerateFullPaths="$(GenerateFullPaths)"
  70. KeyContainer="$(KeyContainerName)"
  71. KeyFile="$(KeyOriginatorFile)"
  72. LangVersion="$(LangVersion)"
  73. MainEntryPoint="$(StartupObject)"
  74. ModuleAssemblyName="$(ModuleAssemblyName)"
  75. NoConfig="true"
  76. NoLogo="$(NoLogo)"
  77. NoStandardLib="$(NoCompilerStandardLib)"
  78. Optimize="$(Optimize)"
  79. OutputAssembly="@(IntermediateAssembly)"
  80. PdbFile="$(PdbFile)"
  81. Platform="$(PlatformTarget)"
  82. References="@(ReferencePath)"
  83. ResponseFiles="$(CompilerResponseFile)"
  84. Sources="@(Compile)"
  85. TargetType="$(OutputType)"
  86. TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
  87. UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
  88. Utf8Output="$(Utf8Output)"
  89. WarningLevel="$(WarningLevel)"
  90. WarningsAsErrors="$(WarningsAsErrors)"
  91. WarningsNotAsErrors="$(WarningsNotAsErrors)"
  92. Win32Icon="$(ApplicationIcon)"
  93. Win32Resource="$(Win32Resource)"
  94. Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)"
  95. ToolExe="$(CscToolExe)"
  96. ToolPath="$(CscToolPath)" />
  97. </Target>
  98. <Target Name="CreateManifestResourceNames">
  99. <CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)' != ''"
  100. ResourceFiles="@(ResxWithNoCulture)" RootNamespace="$(RootNamespace)">
  101. <Output TaskParameter = "ManifestResourceNames" ItemName = "ManifestResourceWithNoCultureName" />
  102. </CreateCSharpManifestResourceName>
  103. <CreateCSharpManifestResourceName Condition="'@(NonResxWithNoCulture)' != ''"
  104. ResourceFiles="@(NonResxWithNoCulture)" RootNamespace="$(RootNamespace)">
  105. <Output TaskParameter = "ManifestResourceNames" ItemName = "ManifestNonResxWithNoCulture" />
  106. </CreateCSharpManifestResourceName>
  107. <CreateCSharpManifestResourceName Condition="'@(ResxWithCulture)' != ''"
  108. ResourceFiles="@(ResxWithCulture)" RootNamespace="$(RootNamespace)">
  109. <Output TaskParameter = "ManifestResourceNames" ItemName = "ManifestResourceWithCultureName" />
  110. </CreateCSharpManifestResourceName>
  111. <CreateCSharpManifestResourceName Condition="'@(NonResxWithCulture)' != ''"
  112. ResourceFiles="@(NonResxWithCulture)" RootNamespace="$(RootNamespace)">
  113. <Output TaskParameter = "ManifestResourceNames" ItemName = "ManifestNonResxWithCulture" />
  114. </CreateCSharpManifestResourceName>
  115. </Target>
  116. <Import Project="Microsoft.Common.targets" />
  117. <PropertyGroup Condition="'$(NoCompilerStandardLib)'=='true' and '$(NoStdLib)'!='true'">
  118. <ResolveAssemblyReferencesDependsOn>$(ResolveAssemblyReferencesDependsOn);_AddCorlibReference</ResolveAssemblyReferencesDependsOn>
  119. </PropertyGroup>
  120. <PropertyGroup>
  121. <TargetFrameworkMonikerAssemblyAttributeText Condition="'$(TargetFrameworkMoniker)' != '' and '$(TargetingClr2Framework)' != 'true'">
  122. // &lt;autogenerated /&gt;
  123. [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(&quot;$(TargetFrameworkMoniker)&quot;, FrameworkDisplayName = &quot;$(TargetFrameworkMonikerDisplayName)&quot;)]
  124. </TargetFrameworkMonikerAssemblyAttributeText>
  125. </PropertyGroup>
  126. </Project>