Converge common msbuild properties and targets (#338)
authorViktor Hofer <viktor.hofer@microsoft.com>
Sun, 1 Dec 2019 10:01:39 +0000 (11:01 +0100)
committerGitHub <noreply@github.com>
Sun, 1 Dec 2019 10:01:39 +0000 (11:01 +0100)
* Converge common msbuild properties and targets

Moving common msbuild properties and targets into the repo root.

* Consolidate analyzers logic into the repo root

Consolidating msbuild analyzers logic centrally in the repo root and
adding a property switch `EnableAnalyzers` to enable analyzers. We
still need to import the Analyzers.props file unconditionally as
libraries currently doesn't use the PackageReference logic in ref and
src projects and instead uses a depproj to create a props file
dynamically.

* More cleanup to fix CoreLib build

19 files changed:
Directory.Build.props
Directory.Build.targets
eng/Analyzers.props [moved from eng/analyzers.props with 68% similarity]
eng/Build.props
eng/CodeAnalysis.ruleset [moved from src/libraries/CodeAnalysis.ruleset with 100% similarity]
eng/Subsets.props
eng/Tools.props
eng/Versions.props
eng/illink.targets
eng/restore/illink.targets [deleted file]
src/coreclr/src/Directory.Build.targets
src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets
src/coreclr/src/System.Private.CoreLib/ILLink.targets [deleted file]
src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
src/installer/Directory.Build.props
src/installer/Directory.Build.targets
src/libraries/Directory.Build.props
src/libraries/Directory.Build.targets
src/libraries/restore/analyzers/analyzers.depproj

index 42b9df1..867d863 100644 (file)
@@ -1,5 +1,13 @@
 <Project>
 
+  <PropertyGroup>
+    <!--
+      For non-SDK projects that import this file and then import Microsoft.Common.props,
+      tell Microsoft.Common.props not to import Directory.Build.props again
+    -->
+    <ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
+  </PropertyGroup>
+
   <!--
     Import the arcade sdk with these requirements.
     After:
     <ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
   </PropertyGroup>
 
-  <PropertyGroup>
-    <RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
-    <RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
+  <!--
+    Get ProjectToBuild and '<subset>ProjectToBuild' items. Using the items lets projects handle
+    $(Subset) automatically when creating project-to-project dependencies.
+  -->
+  <Import Project="$(RepositoryEngineeringDir)Subsets.props" />
 
+  <PropertyGroup>
     <!-- Installer specific, required during restore. -->
     <InstallerTasksOutputPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'installer.tasks'))</InstallerTasksOutputPath>
     <InstallerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'netstandard2.0', 'installer.tasks.dll'))</InstallerTasksAssemblyPath>
     <InstallerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'net46', 'installer.tasks.dll'))</InstallerTasksAssemblyPath>
     <HostMachineInfoProps>$(ArtifactsObjDir)HostMachineInfo.props</HostMachineInfoProps>
 
-    <LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
-    <CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
-    <InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
-
     <DocsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'docs'))</DocsDir>
     <ManPagesDir>$([MSBuild]::NormalizeDirectory('$(DocsDir)', 'manpages'))</ManPagesDir>
     <CoreLibSharedDir>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'System.Private.CoreLib', 'src'))</CoreLibSharedDir>
     <RepositoryUrl>git://github.com/dotnet/runtime</RepositoryUrl>
     <ProjectUrl>https://github.com/dotnet/runtime</ProjectUrl>
     <LicenseUrl>https://github.com/dotnet/runtime/blob/master/LICENSE.TXT</LicenseUrl>
+    <LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile>
+
+    <!-- Indicates this is not an officially supported release. Release branches should set this to false. -->
+    <IsPrerelease>true</IsPrerelease>
+
+    <!-- Experimental packages should not be stable -->
+    <SuppressFinalPackageVersion Condition="'$(SuppressFinalPackageVersion)' == '' and $(MSBuildProjectName.Contains('Experimental'))">true</SuppressFinalPackageVersion>
+    <IsShippingAssembly Condition="$(MSBuildProjectName.Contains('Experimental'))">false</IsShippingAssembly>
+
+    <!-- We don't want Private packages to be shipped to NuGet.org -->
+    <IsShippingPackage Condition="$(MSBuildProjectName.Contains('Private')) and '$(MSBuildProjectExtension)' == '.pkgproj'">false</IsShippingPackage>
+  </PropertyGroup>
+
+  <!-- Language configuration -->
+  <PropertyGroup>
+    <!-- default to allowing all language features -->
+    <LangVersion>latest</LangVersion>
+    <LangVersion Condition="'$(Language)' == 'C#'">preview</LangVersion>
+    <Deterministic>true</Deterministic>
+
+    <!-- Resource naming bug: https://github.com/microsoft/msbuild/issues/4740 -->
+    <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
   </PropertyGroup>
 
+  <PropertyGroup>
+    <!-- Default to portable build if not explicitly set -->
+    <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
+    <!-- Used for launchSettings.json and runtime config files. -->
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+  </PropertyGroup>
+
+  <Import Project="$(RepositoryEngineeringDir)Analyzers.props" />
+
 </Project>
index 5180c31..7d40eb9 100644 (file)
@@ -1,5 +1,21 @@
 <Project>
 
+  <PropertyGroup>
+    <!--
+    For non-SDK projects that import this file and then import Microsoft.Common.targets,
+    tell Microsoft.Common.targets not to import Directory.Build.targets again
+    -->
+    <ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
+  </PropertyGroup>
+
   <Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" Condition="'$(SkipImportArcadeSdkFromRoot)' != 'true'" />
 
+  <PropertyGroup>
+    <!--
+      Define this here (not just in Versions.props) because the SDK resets it
+      unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
+    -->
+    <NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
+  </PropertyGroup>
+
 </Project>
\ No newline at end of file
similarity index 68%
rename from eng/analyzers.props
rename to eng/Analyzers.props
index 4aa6b32..24d83dc 100644 (file)
@@ -1,5 +1,8 @@
 <Project>
-  <ItemGroup>
+  <PropertyGroup>
+    <CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset>
+  </PropertyGroup>
+  <ItemGroup Condition="'$(EnableAnalyzers)' == 'true'">
     <PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisVersion)" />
     <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.4.0-beta2-final" />
     <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
index 20dbe66..5e060ad 100644 (file)
       https://github.com/dotnet/arcade/issues/388
   -->
 
-  <PropertyGroup>
-    <SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
-  </PropertyGroup>
-
   <Import Project="$(MSBuildThisFileDirectory)Subsets.props" />
 
   <Target Name="CheckSpecifiedSubsetValidity"
index d858467..a1ca197 100644 (file)
       artifacts to the test layout, then running the test subset.
   -->
 
-  <!-- Import only when imported by Arcade's Build.proj as we import Directory.Build.props ourselves. -->
-  <Import Project="$(RepoRoot)Directory.Build.props" Condition="'$(SkipImportArcadeSdkFromRoot)' == 'true'" />
+  <PropertyGroup>
+    <LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
+    <CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
+    <InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
+    <RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
+    <RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
+  </PropertyGroup>
 
   <PropertyGroup>
     <DefaultSubsetCategories>libraries-installer-coreclr</DefaultSubsetCategories>
index a763640..fa98043 100644 (file)
@@ -1,11 +1,12 @@
 <Project>
   <PropertyGroup>
     <MSBuildTreatWarningsAsErrors>false</MSBuildTreatWarningsAsErrors>
+    <EnableAnalyzers>true</EnableAnalyzers>
   </PropertyGroup>
 
   <!-- We need to import this props file which contains PackageReferences to analyzers so that
        analyzer build assets are imported via the Tools generated props and targets -->
-  <Import Project="$(RepositoryEngineeringDir)analyzers.props" Condition="Exists('$(RepositoryEngineeringDir)analyzers.props') and '$(DotNetBuildFromSource)' != 'true'" />
+  <Import Project="$(RepositoryEngineeringDir)Analyzers.props" Condition="Exists('$(RepositoryEngineeringDir)Analyzers.props') and '$(DotNetBuildFromSource)' != 'true'" />
 
   <!-- source-built packages -->
   <ItemGroup>
@@ -22,6 +23,9 @@
 
     <!-- roslyn -->
     <PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+
+    <!-- mono -->
+    <PackageReference Include="illink.tasks" Version="$(ILLinkTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" ExcludeAssets="build" GeneratePathProperty="true" />
   </ItemGroup>
 
   <!-- excluded from offline portion of source build -->
@@ -41,7 +45,6 @@
     <PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(MicrosoftSourceLinkVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
   </ItemGroup>
 
-  <Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="Exists('$(RepositoryEngineeringDir)restore\docs.targets') and '$(DotNetBuildFromSource)' != 'true'" />
-  <Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="Exists('$(RepositoryEngineeringDir)restore\optimizationData.targets') and '$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
-  <Import Project="$(RepositoryEngineeringDir)restore\illink.targets" Condition="Exists('$(RepositoryEngineeringDir)restore\illink.targets') and '$(ILLinkTrimAssembly)' != 'false'" />
+  <Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="'$(DotNetBuildFromSource)' != 'true'" />
+  <Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
 </Project>
index b310637..dd076d4 100644 (file)
@@ -19,7 +19,6 @@
     <UsingToolXliff>false</UsingToolXliff>
     <!-- Paths used during restore -->
     <EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(ConfigurationGroup)' == 'Release'">true</EnableNgenOptimization>
-    <ILLinkDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsToolsetDir)', 'ILLink'))</ILLinkDir>
     <IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
     <XmlDocDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs'))</XmlDocDir>
     <!-- Blob storage container that has the "Latest" channel to publish to. -->
index 44c6adb..924122b 100644 (file)
@@ -9,8 +9,9 @@
 
   <!-- Inputs and outputs of ILLinkTrimAssembly -->
   <PropertyGroup>
-    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' == 'core'">$(ILLinkDir)netcoreapp2.0/ILLink.Tasks.dll</ILLinkTasksPath>
-    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' != 'core'">$(ILLinkDir)net472/ILLink.Tasks.dll</ILLinkTasksPath>
+    <ILLinkTasksDir>$([MSBuild]::NormalizeDirectory('$(PkgILLink_Tasks)', 'tools'))</ILLinkTasksDir>
+    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' == 'core'">$(ILLinkTasksDir)netcoreapp2.0/ILLink.Tasks.dll</ILLinkTasksPath>
+    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' != 'core'">$(ILLinkTasksDir)net472/ILLink.Tasks.dll</ILLinkTasksPath>
     <ILLinkTrimAssemblyPath>$(IntermediateOutputPath)$(TargetName)$(TargetExt)</ILLinkTrimAssemblyPath>
     <ILLinkTrimAssemblySymbols>$(IntermediateOutputPath)$(TargetName).pdb</ILLinkTrimAssemblySymbols>
     <ILLinkTrimInputPath>$(IntermediateOutputPath)PreTrim/</ILLinkTrimInputPath>
diff --git a/eng/restore/illink.targets b/eng/restore/illink.targets
deleted file mode 100644 (file)
index aa40e2a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<Project>
-
-  <ItemGroup>
-    <PackageReference Include="illink.tasks" Version="$(ILLinkTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" ExcludeAssets="build" />
-  </ItemGroup>
-
-  <Target Name="IncludeToolsFiles"
-          AfterTargets="Restore">
-
-    <ItemGroup>
-      <_illinkSrcFiles Include="$(NuGetPackageRoot)illink.tasks\$(ILLinkTasksVersion)\tools\**\*" />
-    </ItemGroup>
-
-    <Copy SourceFiles="@(_illinkSrcFiles)"
-          DestinationFolder="$(ILLinkDir)%(_illinkSrcFiles.RecursiveDir)"
-          SkipUnchangedFiles="true"
-          UseHardlinksIfPossible="true" />
-
-  </Target>
-</Project>
index 9758453..99a2375 100644 (file)
@@ -17,4 +17,7 @@
 
   </Target>
 
+  <!-- Import targets here to have TargetPath and other macros defined. Limit to CoreLib. -->
+  <Import Condition="'$(MSBuildProjectName)' == 'System.Private.CoreLib'" Project="$(RepositoryEngineeringDir)illink.targets" />
+
 </Project>
\ No newline at end of file
index d5e49b3..9d362c9 100644 (file)
@@ -5,8 +5,7 @@
   </PropertyGroup>
 
   <PropertyGroup>
-    <_ILLinkRuntimeRootDescriptorFileName Condition=" '$(_ILLinkRuntimeRootDescriptorFileName)' == '' ">System.Private.CoreLib.xml</_ILLinkRuntimeRootDescriptorFileName>
-    <_ILLinkRuntimeRootDescriptorFilePath Condition=" '$(_ILLinkRuntimeRootDescriptorFilePath)' == '' ">$(IntermediateOutputPath)$(_ILLinkRuntimeRootDescriptorFileName)</_ILLinkRuntimeRootDescriptorFilePath>
+    <_ILLinkRuntimeRootDescriptorFilePath>$(ILLinkTrimXml)</_ILLinkRuntimeRootDescriptorFilePath>
     <_NamespaceFilePath Condition=" '$(_NamespaceFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\namespace.h</_NamespaceFilePath>
     <_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\mscorlib.h</_MscorlibFilePath>
     <_CortypeFilePath Condition=" '$(_CortypeFilePath)' == '' ">$(MSBuildThisFileDirectory)..\inc\cortypeinfo.h</_CortypeFilePath>
diff --git a/src/coreclr/src/System.Private.CoreLib/ILLink.targets b/src/coreclr/src/System.Private.CoreLib/ILLink.targets
deleted file mode 100644 (file)
index ccf2cbf..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <TargetsTriggeredByCompilation>
-      $(TargetsTriggeredByCompilation);
-      ILLinkTrimAssembly
-    </TargetsTriggeredByCompilation>
-  </PropertyGroup>
-
-  <!-- Inputs and outputs of ILLinkTrimAssembly -->
-  <PropertyGroup>
-    <ILLinkTasksToolsDir>$(PkgILLink_Tasks)/tools</ILLinkTasksToolsDir>
-    <ILLinkTasksDir>$(ILLinkTasksToolsDir)/net472/</ILLinkTasksDir>
-    <ILLinkTasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(ILLinkTasksToolsDir)/netcoreapp2.0/</ILLinkTasksDir>
-    <ILLinkTasksPath>$(ILLinkTasksDir)ILLink.Tasks.dll</ILLinkTasksPath>
-    <ILLinkTrimAssembly Condition="'$(ILLinkTrimAssembly)' == ''">true</ILLinkTrimAssembly>
-    <ILLinkTrimAssemblyPath>$(IntermediateOutputPath)$(TargetName)$(TargetExt)</ILLinkTrimAssemblyPath>
-    <ILLinkTrimAssemblySymbols>$(IntermediateOutputPath)$(TargetName).pdb</ILLinkTrimAssemblySymbols>
-    <ILLinkTrimInputPath>$(IntermediateOutputPath)PreTrim/</ILLinkTrimInputPath>
-    <ILLinkTrimInputAssembly>$(ILLinkTrimInputPath)$(TargetName)$(TargetExt)</ILLinkTrimInputAssembly>
-    <ILLinkTrimInputSymbols>$(ILLinkTrimInputPath)$(TargetName).pdb</ILLinkTrimInputSymbols>
-    <ILLinkTrimOutputPath>$(IntermediateOutputPath)</ILLinkTrimOutputPath>
-
-    <!-- if building a PDB, tell illink to rewrite the symbols file -->
-    <ILLinkRewritePDBs Condition="'$(ILLinkRewritePDBs)' == '' AND '$(DebugSymbols)' != 'false'">true</ILLinkRewritePDBs>
-  </PropertyGroup>
-
-  <!-- Custom binplacing for pre/post-trimming and reports that is useful for analysis
-       Must be enabled by setting BinPlaceILLinkTrimAssembly=true
-  -->
-  <ItemGroup Condition="'$(BinPlaceILLinkTrimAssembly)' == 'true'">
-    <BinPlaceConfiguration Include="$(BuildConfiguration)">
-      <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/trimmed</RuntimePath>
-      <ItemName>TrimmedItem</ItemName>
-    </BinPlaceConfiguration>
-    <BinPlaceConfiguration Include="$(BuildConfiguration)">
-      <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/reports</RuntimePath>
-      <ItemName>TrimmingReport</ItemName>
-    </BinPlaceConfiguration>
-    <BinPlaceConfiguration Include="$(BuildConfiguration)">
-      <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/pretrimmed</RuntimePath>
-      <ItemName>PreTrimmedItem</ItemName>
-    </BinPlaceConfiguration>
-  </ItemGroup>
-
-  <!-- ILLinkTrimAssembly
-       Examines the "input assembly" for IL that is unreachable from public API and trims that,
-       rewriting the assembly to an "output assembly"
-  -->
-  <UsingTask TaskName="ILLink" AssemblyFile="$(ILLinkTasksPath)" />
-  <Target Name="ILLinkTrimAssembly" Condition="'$(ILLinkTrimAssembly)' == 'true'">
-    <PropertyGroup>
-      <ILLinkArgs>$(ILLinkArgs)-r $(TargetName)</ILLinkArgs>
-      <!-- default action for core assemblies -->
-      <ILLinkArgs>$(ILLinkArgs) -c skip</ILLinkArgs>
-      <!-- default action for non-core assemblies -->
-      <ILLinkArgs>$(ILLinkArgs) -u skip</ILLinkArgs>
-      <!-- trim the target assembly -->
-      <ILLinkArgs>$(ILLinkArgs) -p link $(TargetName)</ILLinkArgs>
-      <ILLinkArgs Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')">$(ILLinkArgs) -b true</ILLinkArgs>
-      <!-- keep types and members required by Debugger-related attributes -->
-      <ILLinkArgs>$(ILLinkArgs) -v true</ILLinkArgs>
-      <!-- don't remove the embedded root xml resource since ILLink may run again on the assembly -->
-      <ILLinkArgs>$(ILLinkArgs) --strip-resources false</ILLinkArgs>
-      <!-- keep interface implementations -->
-      <ILLinkArgs>$(ILLinkArgs) --disable-opt unusedinterfaces</ILLinkArgs>
-    </PropertyGroup>
-
-    <MakeDir Directories="$(ILLinkTrimInputPath)" />
-
-    <!-- Move the assembly into a subdirectory for ILLink -->
-    <Move SourceFiles="$(ILLinkTrimAssemblyPath)"
-          DestinationFolder="$(ILLinkTrimInputPath)"
-    />
-
-    <!-- Move the PDB into a subdirectory for ILLink if we are rewriting PDBs -->
-    <Move SourceFiles="$(ILLinkTrimAssemblySymbols)"
-          DestinationFolder="$(ILLinkTrimInputPath)"
-          Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')"
-    />
-
-    <!-- When running from Desktop MSBuild, DOTNET_HOST_PATH is not set.
-         In this case, explicitly specify the path to the dotnet host. -->
-    <PropertyGroup Condition=" '$(DOTNET_HOST_PATH)' == '' ">
-      <_DotNetHostDirectory>$(NetCoreRoot)</_DotNetHostDirectory>
-      <_DotNetHostFileName>dotnet</_DotNetHostFileName>
-      <_DotNetHostFileName Condition=" '$(OS)' == 'Windows_NT' ">dotnet.exe</_DotNetHostFileName>
-    </PropertyGroup>
-
-    <ILLink AssemblyPaths="$(ILLinkTrimInputAssembly)"
-            RootAssemblyNames=""
-            OutputDirectory="$(ILLinkTrimOutputPath)"
-            ClearInitLocals="true"
-            ClearInitLocalsAssemblies="$(TargetName)"
-            ExtraArgs="$(ILLinkArgs)"
-            ToolExe="$(_DotNetHostFileName)"
-            ToolPath="$(_DotNetHostDirectory)" />
-
-  </Target>
-
-  <!-- ILLink reporting.
-       Only enabled when developer specifies a path to the AsmDiff tool with property AsmDiffCmd.
-       EG: AsmDiffCmd=d:\tools\asmdiff\asmdiff.exe
-       This is necessary until the AsmDiff tool is ported to .NET Core. -->
-  <Target Name="_CreateILLinkTrimAssemblyReports"
-          AfterTargets="ILLinkTrimAssembly"
-          Condition="'$(AsmDiffCmd)' != ''">
-    <PropertyGroup>
-      <AsmDiffArgs>$(AsmDiffArgs) $(ILLinkTrimInputAssembly)</AsmDiffArgs>
-      <AsmDiffArgs>$(AsmDiffArgs) $(ILLinkTrimAssemblyPath)</AsmDiffArgs>
-      <AsmDiffArgs>$(AsmDiffArgs) -includePrivateApis -includeInternalApis -alwaysDiffMembers -diffAttributes</AsmDiffArgs>
-
-      <AsmDiffReport>$(IntermediateOutputPath)$(TargetName).diff.html</AsmDiffReport>
-      <AsmDiffReportArgs>$(AsmDiffArgs) -out:$(AsmDiffReport)</AsmDiffReportArgs>
-      <AsmDiffReportArgs>$(AsmDiffReportArgs) -unchanged -changed -added -removed</AsmDiffReportArgs>
-
-      <AsmDiffList>$(IntermediateOutputPath)$(TargetName).diff.csv</AsmDiffList>
-      <AsmDiffListArgs>$(AsmDiffArgs) -out:$(AsmDiffList)</AsmDiffListArgs>
-      <AsmDiffListArgs>$(AsmDiffListArgs) -unchanged -changed -added -removed </AsmDiffListArgs>
-      <AsmDiffListArgs>$(AsmDiffListArgs) -diffWriter:CSV</AsmDiffListArgs>
-    </PropertyGroup>
-
-    <Exec Command="$(AsmDiffCmd) $(AsmDiffReportArgs)" />
-    <Message Text="Assembly trimming diff: $(AsmDiffReport)" />
-    <Exec Command="$(AsmDiffCmd) $(AsmDiffListArgs)" />
-    <Message Text="Assembly trimming report: $(AsmDiffList)" />
-  </Target>
-
-  <!-- Similar to _CheckForCompileOutputs and runs in the same places,
-       always set these even if compile didn't run. -->
-  <Target Name="_CheckForILLinkTrimAssemblyOutputs"
-          BeforeTargets="CopyFilesToOutputDirectory;_CleanGetCurrentAndPriorFileWrites"
-          Condition="'$(ILLinkTrimAssembly)' == 'true'">
-    <ItemGroup>
-      <PreTrimmedItem Condition="Exists('$(ILLinkTrimInputAssembly)')" Include="$(ILLinkTrimInputAssembly)" />
-      <PreTrimmedItem Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimInputSymbols)')" Include="$(ILLinkTrimInputSymbols)" />
-      <FileWrites Include="@(PreTrimmedItem)" />
-
-      <TrimmedItem Condition="Exists('$(ILLinkTrimAssemblyPath)')" Include="$(ILLinkTrimAssemblyPath)" />
-      <TrimmedItem Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')" Include="$(ILLinkTrimAssemblySymbols)" />
-
-      <TrimmingReport Condition="Exists('$(AsmDiffReport)')" Include="$(AsmDiffReport)" />
-      <TrimmingReport Condition="Exists('$(AsmDiffList)')" Include="$(AsmDiffList)" />
-    </ItemGroup>
-  </Target>
-</Project>
index 2915897..307f884 100644 (file)
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
     <EnableDefaultItems>false</EnableDefaultItems>
@@ -6,8 +6,6 @@
     <GenerateResxSourceOmitGetResourceString>true</GenerateResxSourceOmitGetResourceString>
     <GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
     <EnsureRuntimePackageDependencies>false</EnsureRuntimePackageDependencies>
-
-    <OutputType>Library</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
 
     <!-- Ensure a portable PDB is emitted for the project. A PDB is needed for crossgen. -->
     <OutputPath>$(BinDir)IL/</OutputPath>
     <Configurations>Debug;Release;Checked</Configurations>
     <Platforms>x64;x86;arm;arm64</Platforms>
+
+    <ILLinkClearInitLocals>true</ILLinkClearInitLocals>
+    <ILLinkTrimAssembly>true</ILLinkTrimAssembly>
+    <ILLinkTrimXml>$(IntermediateOutputPath)System.Private.CoreLib.xml</ILLinkTrimXml>
   </PropertyGroup>
 
   <!-- Note that various places in SPCL depend on this resource name i.e. TplEventSource -->
@@ -34,7 +36,6 @@
     <Configuration Condition=" '$(Configuration)' == '' ">$(BuildType)</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">$(BuildArch)</Platform>
     <Platform Condition=" '$(Platform)' == 'armel' ">arm</Platform>
-    <ProjectGuid>{3DA06C3A-2E7B-4CB7-80ED-9B12916013F9}</ProjectGuid>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
     <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
@@ -62,6 +63,7 @@
     <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
     <SkipCommonResourcesIncludes>true</SkipCommonResourcesIncludes>
     <DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
+    <EnableAnalyzers>false</EnableAnalyzers>
   </PropertyGroup>
 
   <!-- Platform specific properties -->
 
   <!-- Assembly attributes -->
   <PropertyGroup>
-    <AssemblyName>System.Private.CoreLib</AssemblyName>
-    <AssemblyVersion>5.0.0.0</AssemblyVersion>
-    <ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile>
-    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
     <Description>$(AssemblyName)</Description>
   </PropertyGroup>
 
     <Exec Command="&quot;$(PYTHON)&quot; $(MSBuildThisFileDirectory)..\scripts\check-definitions.py &quot;$(ProjectDir.TrimEnd('\'))&quot; &quot;$(CMakeDefinitionSaveFile)&quot; &quot;$(DefineConstants)&quot; &quot;$(IgnoreDefineConstants)&quot; " />
   </Target>
   <PropertyGroup Condition="'$(BuildOS)' == 'Windows_NT'">
-    <EnableDotnetAnalyzers Condition="'$(EnableDotnetAnalyzers)'==''">true</EnableDotnetAnalyzers>
-    <UseWin32Apis>true</UseWin32Apis>
     <OSGroup>Windows_NT</OSGroup>
   </PropertyGroup>
   <PropertyGroup>
     <FeatureAsyncCausalityTracer Condition="'$(FeatureCominterop)' == 'true'">true</FeatureAsyncCausalityTracer>
   </PropertyGroup>
 
-  <!-- Globals used by ILLink.targets -->
-  <PropertyGroup>
-    <TargetName>$(MSBuildProjectName)</TargetName>
-    <TargetExt>.dll</TargetExt>
-  </PropertyGroup>
-
   <!-- Setup ILLink.targets -->
   <ItemGroup>
     <PackageReference Include="ILLink.Tasks" Version="$(ILLinkTasksVersion)" ExcludeAssets="build" GeneratePathProperty="True" />
   </ItemGroup>
 
-  <!-- Analyzers -->
-  <PropertyGroup>
-    <CodeAnalysisRuleset>$(LibrariesProjectRoot)CodeAnalysis.ruleset</CodeAnalysisRuleset>
-  </PropertyGroup>
-  <ItemGroup>
-    <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4" PrivateAssets="all" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" PrivateAssets="all" />
-  </ItemGroup>
-
   <Import Project="CreateRuntimeRootILLinkDescriptorFile.targets" />
 
   <Target Name="CreateRuntimeRootIlLinkDescFile" BeforeTargets="CoreCompile" DependsOnTargets="_CreateILLinkRuntimeRootDescriptorFile">
   </Target>
 
   <!-- This is working around dotnet/coreclr#26371 until dotnet/sourcelink#392 gets solved -->
-  <Target Condition="'$(BuildingInsideVisualStudio)' != 'true'" Name="AddUntrackedResourcesForSourceLink"
-    BeforeTargets="CoreCompile"
-    DependsOnTargets="SetEmbeddedFilesFromSourceControlManagerUntrackedFiles;
-                      _GenerateResxSource" >
+  <Target Name="AddUntrackedResourcesForSourceLink"
+          Condition="'$(BuildingInsideVisualStudio)' != 'true'"
+          BeforeTargets="CoreCompile"
+          DependsOnTargets="SetEmbeddedFilesFromSourceControlManagerUntrackedFiles;_GenerateResxSource" >
     <ItemGroup>
       <EmbeddedFiles Include="@(GeneratedResxSource)" />
     </ItemGroup>
-  </Target>
-
-  <ItemGroup>
-    <EmbeddedResource Include="$(_ILLinkRuntimeRootDescriptorFilePath)">
-      <LogicalName>$(MSBuildProjectName).xml</LogicalName>
-    </EmbeddedResource>
-  </ItemGroup>
-
-  <Import Project="ILLink.targets" />
+  </Target>  
 </Project>
index c26b179..d6cda92 100644 (file)
@@ -3,12 +3,6 @@
   <Import Project="..\..\Directory.Build.props" />
 
   <!--
-    Get ProjectToBuild and '<subset>ProjectToBuild' items. Using the items lets projects handle
-    $(Subset) automatically when creating project-to-project dependencies.
-  -->
-  <Import Project="$(RepositoryEngineeringDir)Subsets.props" />
-
-  <!--
     Before Microsoft.Common.targets, set the extensions path to match the restore dir as Arcade
     sets it, so MSBuild packages with targets files will be found and imported.
   -->
@@ -29,9 +23,7 @@
   </PropertyGroup>
 
   <PropertyGroup>
-    <InstallerProjectRoot>$(MSBuildThisFileDirectory)</InstallerProjectRoot>
     <SigningToolsDir>$(InstallerProjectRoot)signing\</SigningToolsDir>
-    <LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile>
   </PropertyGroup>
 
   <PropertyGroup>
   </PropertyGroup>
 
   <PropertyGroup>
-    <!--
-      This name is used to create a GIT repository URL https://github.com/dotnet/$(GitHubRepositoryName) used to find source code for debugging
-      It is also used to name the build output manifest for orchestrated builds.
-    -->
-    <GitHubRepositoryName Condition="'$(GitHubRepositoryName)' == ''">core-setup</GitHubRepositoryName>
-  </PropertyGroup>
-
-  <!-- Build as portable by default -->
-  <PropertyGroup>
-    <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
-  </PropertyGroup>
-
-  <PropertyGroup>
     <SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
     <NETCoreAppFrameworkIdentifier>.NETCoreApp</NETCoreAppFrameworkIdentifier>
     <NETCoreAppFrameworkMoniker>$(NETCoreAppFrameworkIdentifier),Version=v$(NETCoreAppFrameworkVersion)</NETCoreAppFrameworkMoniker>
     <EnableSourceLink>false</EnableSourceLink>
     <EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
     <DeterministicSourcePaths>false</DeterministicSourcePaths>
-    <!-- Normally set by sourcelink, and needed by the Pack targets -->
-    <RepositoryUrl Condition="'$(RepositoryUrl)' == '''">https://github.com/dotnet/core-setup</RepositoryUrl>
   </PropertyGroup>
 
   <!-- Set up Default symbol and optimization for Configuration -->
index ad077c9..724a3f5 100644 (file)
   <UsingTask TaskName="GetTargetMachineInfo" AssemblyFile="$(InstallerTasksAssemblyPath)" />
   <UsingTask TaskName="RegenerateReadmeTable" AssemblyFile="$(InstallerTasksAssemblyPath)" />
 
-  <PropertyGroup>
-    <!--
-      Define this here (not just in Versions.props) because the SDK resets it
-      unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
-    -->
-    <NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
-  </PropertyGroup>
-
   <!-- Common target to find all sfxproj. In a target to avoid evaluating for every project. -->
   <Target Name="GetSharedFrameworkProjects">
     <ItemGroup>
index dd2bcf6..6c3d9c1 100644 (file)
@@ -1,25 +1,10 @@
 <Project>
-  <!-- Base repo layout properties -->
-  <PropertyGroup>
-    <RepoRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), global.json))</RepoRoot>
-    <RepoRoot>$([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))</RepoRoot>
-    <RepositoryEngineeringDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'eng'))</RepositoryEngineeringDir>
-    <LibrariesProjectRoot>$(MSBuildThisFileDirectory)</LibrariesProjectRoot>
-    <RepositoryUrl>git://github.com/dotnet/corefx</RepositoryUrl>
-  </PropertyGroup>
-
   <PropertyGroup>
     <SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
   </PropertyGroup>
   <Import Project="..\..\Directory.Build.props" />
 
   <PropertyGroup>
-    <!--
-    For non-SDK projects that import this file and then import Microsoft.Common.props,
-    tell Microsoft.Common.props not to import Directory.Build.props again
-    -->
-    <ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
-
     <!-- We use the compiler toolset that comes from NuGet Packages rather than the SDK built-in.
     This one sets UseSharedCompilation to false by default. -->
     <UseSharedCompilation>true</UseSharedCompilation>
     <BuildConfigurations Condition="'$(MSBuildProjectExtension)' == '.pkgproj' and '$(BuildConfigurations)' == ''">package</BuildConfigurations>
   </PropertyGroup>
 
-  <!-- Indicates this is not an officially supported release. Release branches should set this to false. -->
-  <PropertyGroup>
-    <IsPrerelease>true</IsPrerelease>
-  </PropertyGroup>
-
   <Import Sdk="Microsoft.DotNet.Build.Tasks.Configuration" Project="Sdk.props" />
 
   <!-- Define test projects and companions -->
 
   <!-- Common repo directories -->
   <PropertyGroup>
-    <ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin'))</ArtifactsBinDir>
-
     <!-- Need to try and keep the same logic as the native builds as we need this for packaging -->
     <NativeBinDir>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'native', '$(BuildConfiguration)'))</NativeBinDir>
 
   <PropertyGroup>
     <!-- By default make all libraries to be AnyCPU but individual projects can override it if they need to -->
     <Platform>AnyCPU</Platform>
-    <OutputType>Library</OutputType>
     <!-- Default any assembly not specifying a key to use the Open Key -->
     <StrongNameKeyId>Open</StrongNameKeyId>
+  </PropertyGroup>
+
+  <PropertyGroup>
     <RunApiCompatForSrc>$(IsSourceProject)</RunApiCompatForSrc>
     <RunMatchingRefApiCompat>$(IsSourceProject)</RunMatchingRefApiCompat>
     <ApiCompatExcludeAttributeList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt</ApiCompatExcludeAttributeList>
-    <!-- Build as portable by default -->
-    <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
-    <!-- Used for launchSettings.json and runtime config files. -->
-    <AppDesignerFolder>Properties</AppDesignerFolder>
   </PropertyGroup>
 
   <PropertyGroup>
 
   <!-- Language configuration -->
   <PropertyGroup>
-    <!-- default to allowing all language features -->
-    <LangVersion>latest</LangVersion>
-    <LangVersion Condition="'$(Language)' == 'C#'">preview</LangVersion>
     <Features>strict;nullablePublicOnly</Features>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    <Deterministic>true</Deterministic>
-
     <!-- We decided to keep this disabled by default to see some history of way have a look at https://github.com/dotnet/corefx/issues/3140 -->
     <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-
-    <!-- Suppress preview message as we are usually using preview SDK versions. -->
-    <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
     <GenFacadesIgnoreBuildAndRevisionMismatch>true</GenFacadesIgnoreBuildAndRevisionMismatch>
-
-    <!-- Resource naming bug: https://github.com/microsoft/msbuild/issues/4740 -->
-    <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
+    <EnableAnalyzers Condition="'$(EnableProjectRestore)' == 'true' and '$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.ilproj'">true</EnableAnalyzers>
   </PropertyGroup>
 
   <!-- Set up some common paths -->
     <!-- Set the documentation output file globally. -->
     <DocumentationFile Condition="'$(IsSourceProject)' == 'true' and '$(DocumentationFile)' == ''">$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
 
-    <CodeAnalysisRuleset>$(LibrariesProjectRoot)CodeAnalysis.ruleset</CodeAnalysisRuleset>
-    <EnablePinvokeUWPAnalyzer>false</EnablePinvokeUWPAnalyzer>
-
     <!-- Clear the init locals flag on all src projects, except those in VB, where we can't use spans. -->
     <ILLinkClearInitLocals Condition="'$(IsSourceProject)' == 'true' and '$(Language)' != 'VB'">true</ILLinkClearInitLocals>
   </PropertyGroup>
 
-  <PropertyGroup>
-    <!-- Experimental packages should not be stable -->
-    <SuppressFinalPackageVersion Condition="'$(SuppressFinalPackageVersion)' == '' and $(MSBuildProjectName.Contains('Experimental'))">true</SuppressFinalPackageVersion>
-    <IsShippingAssembly Condition="$(MSBuildProjectName.Contains('Experimental'))">false</IsShippingAssembly>
-
-    <!-- We don't want Private packages to be shipped to NuGet.org -->
-    <IsShippingPackage Condition="$(MSBuildProjectName.Contains('Private')) and '$(MSBuildProjectExtension)' == '.pkgproj'">false</IsShippingPackage>
-  </PropertyGroup>
-
   <PropertyGroup Condition="'$(BuildAllConfigurations)' != 'true'">
     <!-- We add extra binplacing for the test shared framework until we can get hardlinking with the runtime directory working on all platforms -->
     <BinPlaceTestSharedFramework Condition="'$(_bc_TargetGroup)' == 'netcoreapp'">true</BinPlaceTestSharedFramework>
     <CLSCompliant Condition="'$(CLSCompliant)' == '' and '$(IsTestProject)' == 'true'">false</CLSCompliant>
     <CLSCompliant Condition="'$(CLSCompliant)' == ''">true</CLSCompliant>
   </PropertyGroup>
-
-  <Import Condition="'$(EnableProjectRestore)' == 'true' and '$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.ilproj'" Project="$(RepositoryEngineeringDir)analyzers.props" />
 </Project>
index 0842649..6b65645 100644 (file)
@@ -7,28 +7,6 @@
     <ErrorReport Condition="'$(ErrorReport)' == 'prompt'" />
     <WarningsAsErrors Condition="'$(WarningsAsErrors)' == 'NU1605'" />
   </PropertyGroup>
-  
-  <!-- Adds Nullable annotation attributes to netstandard <= 2.0 builds -->
-  <Choose>
-    <When Condition="'$(Nullable)' != '' and ($(TargetFramework.StartsWith('netstandard1')) or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp2')) or '$(TargetsNetFx)' == 'true')">
-      <PropertyGroup>
-        <DefineConstants>$(DefineConstants),INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
-      </PropertyGroup>
-      <ItemGroup>
-        <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\NullableAttributes.cs" Link="System\Diagnostics\CodeAnalysis\NullableAttributes.cs" />
-      </ItemGroup>
-    </When>
-  </Choose>
-
-  <PropertyGroup>
-    <!--
-    For non-SDK projects that import this file and then import Microsoft.Common.targets,
-    tell Microsoft.Common.targets not to import Directory.Build.targets again
-    -->
-    <ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
-    <!-- This is a workaround to allow the SDK to accept the netcoreapp5.0 tfm until the SDK supports targeting this tfm. -->
-    <NETCoreAppMaximumVersion>5.0</NETCoreAppMaximumVersion>
-  </PropertyGroup>
 
   <PropertyGroup>
     <!-- Override strong name key to default to Open for test projects,
   <Target Name="GetDocumentationFile"
           Returns="$(DocumentationFile)"/>
 
+  <!-- Adds Nullable annotation attributes to netstandard <= 2.0 builds -->
+  <Choose>
+    <When Condition="'$(Nullable)' != '' and ($(TargetFramework.StartsWith('netstandard1')) or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp2')) or '$(TargetsNetFx)' == 'true')">
+      <PropertyGroup>
+        <DefineConstants>$(DefineConstants),INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
+      </PropertyGroup>
+      <ItemGroup>
+        <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\NullableAttributes.cs" Link="System\Diagnostics\CodeAnalysis\NullableAttributes.cs" />
+      </ItemGroup>
+    </When>
+  </Choose>
+
 </Project>
index ee614d5..75547d7 100644 (file)
@@ -1,12 +1,10 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <EnableBinPlacing>false</EnableBinPlacing>
+    <EnableAnalyzers>true</EnableAnalyzers>
     <Language>C#</Language>
   </PropertyGroup>
 
-  <!-- Import PackageReferences containing analyzers -->
-  <Import Project="$(RepositoryEngineeringDir)analyzers.props" />
-
   <UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.SaveItems" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
 
   <Target Name="GenerateAnalyzersPropsFile"