diff options
-rw-r--r-- | Directory.Build.props | 52 | ||||
-rw-r--r-- | Directory.Build.targets | 16 | ||||
-rw-r--r-- | eng/Analyzers.props (renamed from eng/analyzers.props) | 5 | ||||
-rw-r--r-- | eng/Build.props | 4 | ||||
-rw-r--r-- | eng/CodeAnalysis.ruleset (renamed from src/libraries/CodeAnalysis.ruleset) | 0 | ||||
-rw-r--r-- | eng/Subsets.props | 9 | ||||
-rw-r--r-- | eng/Tools.props | 11 | ||||
-rw-r--r-- | eng/Versions.props | 1 | ||||
-rw-r--r-- | eng/illink.targets | 5 | ||||
-rw-r--r-- | eng/restore/illink.targets | 20 | ||||
-rw-r--r-- | src/coreclr/src/Directory.Build.targets | 3 | ||||
-rw-r--r-- | src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets | 3 | ||||
-rw-r--r-- | src/coreclr/src/System.Private.CoreLib/ILLink.targets | 146 | ||||
-rw-r--r-- | src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj | 49 | ||||
-rw-r--r-- | src/installer/Directory.Build.props | 23 | ||||
-rw-r--r-- | src/installer/Directory.Build.targets | 8 | ||||
-rw-r--r-- | src/libraries/Directory.Build.props | 56 | ||||
-rw-r--r-- | src/libraries/Directory.Build.targets | 34 | ||||
-rw-r--r-- | src/libraries/restore/analyzers/analyzers.depproj | 4 |
19 files changed, 114 insertions, 335 deletions
diff --git a/Directory.Build.props b/Directory.Build.props index 42b9df1427b..867d863b83a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -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: @@ -20,20 +28,19 @@ <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> @@ -49,6 +56,37 @@ <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> diff --git a/Directory.Build.targets b/Directory.Build.targets index 5180c31001b..7d40eb9ac30 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -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 diff --git a/eng/analyzers.props b/eng/Analyzers.props index 4aa6b322991..24d83dca9c0 100644 --- a/eng/analyzers.props +++ b/eng/Analyzers.props @@ -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" /> diff --git a/eng/Build.props b/eng/Build.props index 20dbe662c83..5e060adde8d 100644 --- a/eng/Build.props +++ b/eng/Build.props @@ -15,10 +15,6 @@ https://github.com/dotnet/arcade/issues/388 --> - <PropertyGroup> - <SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot> - </PropertyGroup> - <Import Project="$(MSBuildThisFileDirectory)Subsets.props" /> <Target Name="CheckSpecifiedSubsetValidity" diff --git a/src/libraries/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index 646deabaf86..646deabaf86 100644 --- a/src/libraries/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset diff --git a/eng/Subsets.props b/eng/Subsets.props index d858467901a..a1ca197fe66 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -47,8 +47,13 @@ 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> diff --git a/eng/Tools.props b/eng/Tools.props index a763640c26f..fa9804318e7 100644 --- a/eng/Tools.props +++ b/eng/Tools.props @@ -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> diff --git a/eng/Versions.props b/eng/Versions.props index b310637bd10..dd076d4ffa8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -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. --> diff --git a/eng/illink.targets b/eng/illink.targets index 44c6adbf93c..924122b0e97 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -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 index aa40e2a2a4e..00000000000 --- a/eng/restore/illink.targets +++ /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> diff --git a/src/coreclr/src/Directory.Build.targets b/src/coreclr/src/Directory.Build.targets index 97584536861..99a23759538 100644 --- a/src/coreclr/src/Directory.Build.targets +++ b/src/coreclr/src/Directory.Build.targets @@ -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 diff --git a/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets b/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets index d5e49b3ccb2..9d362c93b1b 100644 --- a/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets +++ b/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets @@ -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 index ccf2cbfd214..00000000000 --- a/src/coreclr/src/System.Private.CoreLib/ILLink.targets +++ /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> diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 29158971446..307f8847e6f 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -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. --> @@ -20,6 +18,10 @@ <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 --> @@ -96,10 +98,6 @@ <!-- Assembly attributes --> <PropertyGroup> - <AssemblyName>System.Private.CoreLib</AssemblyName> - <AssemblyVersion>5.0.0.0</AssemblyVersion> - <ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile> - <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> <Description>$(AssemblyName)</Description> </PropertyGroup> @@ -422,54 +420,29 @@ <Exec Command=""$(PYTHON)" $(MSBuildThisFileDirectory)..\scripts\check-definitions.py "$(ProjectDir.TrimEnd('\'))" "$(CMakeDefinitionSaveFile)" "$(DefineConstants)" "$(IgnoreDefineConstants)" " /> </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> diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props index c26b17925b2..d6cda923cc6 100644 --- a/src/installer/Directory.Build.props +++ b/src/installer/Directory.Build.props @@ -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> @@ -39,19 +31,6 @@ </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> @@ -121,8 +100,6 @@ <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 --> diff --git a/src/installer/Directory.Build.targets b/src/installer/Directory.Build.targets index ad077c9b207..724a3f5557e 100644 --- a/src/installer/Directory.Build.targets +++ b/src/installer/Directory.Build.targets @@ -19,14 +19,6 @@ <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> diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index dd2bcf6b76f..6c3d9c13980 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -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> @@ -80,11 +65,6 @@ <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 --> @@ -108,8 +88,6 @@ <!-- 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> @@ -119,16 +97,14 @@ <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> @@ -247,23 +223,13 @@ <!-- 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 --> @@ -332,22 +298,10 @@ <!-- 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> @@ -409,6 +363,4 @@ <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> diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 08426497067..6b65645f4ff 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -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, @@ -199,4 +177,16 @@ <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> diff --git a/src/libraries/restore/analyzers/analyzers.depproj b/src/libraries/restore/analyzers/analyzers.depproj index ee614d52326..75547d787bc 100644 --- a/src/libraries/restore/analyzers/analyzers.depproj +++ b/src/libraries/restore/analyzers/analyzers.depproj @@ -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" |