summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.nuget/optdata/ibcmerge.csproj2
-rw-r--r--src/.nuget/optdata/optdata.csproj2
-rw-r--r--src/Directory.Build.props9
-rw-r--r--src/Directory.Build.targets20
-rw-r--r--src/System.Private.CoreLib/Common/System/SR.cs12
-rw-r--r--src/System.Private.CoreLib/GenerateCompilerResponseFile.targets12
-rw-r--r--src/System.Private.CoreLib/ILLink.targets2
-rw-r--r--src/System.Private.CoreLib/System.Private.CoreLib.csproj141
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs2
-rw-r--r--src/System.Private.CoreLib/src/System/Internal.cs14
-rw-r--r--src/ToolBox/SOS/NETCore/SOS.NETCore.csproj76
-rw-r--r--src/build.proj62
-rw-r--r--src/scripts/check-definitions.py18
-rw-r--r--src/tools/r2rdump/R2RDump.csproj7
14 files changed, 166 insertions, 213 deletions
diff --git a/src/.nuget/optdata/ibcmerge.csproj b/src/.nuget/optdata/ibcmerge.csproj
index 3ec0272a7a..e00d3d1d54 100644
--- a/src/.nuget/optdata/ibcmerge.csproj
+++ b/src/.nuget/optdata/ibcmerge.csproj
@@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
- <TargetFramework>netstandard</TargetFramework>
+ <TargetFramework>netstandard2.0</TargetFramework>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<RuntimeIdentifiers>win7-x64;win7-x86;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
diff --git a/src/.nuget/optdata/optdata.csproj b/src/.nuget/optdata/optdata.csproj
index 408e5363ed..8ab2f5bf1d 100644
--- a/src/.nuget/optdata/optdata.csproj
+++ b/src/.nuget/optdata/optdata.csproj
@@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
- <TargetFramework>netstandard</TargetFramework>
+ <TargetFramework>netstandard2.0</TargetFramework>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<RuntimeIdentifiers>win7-x64;win7-x86;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
new file mode 100644
index 0000000000..afe45ab396
--- /dev/null
+++ b/src/Directory.Build.props
@@ -0,0 +1,9 @@
+<Project>
+ <Import Project="../Directory.Build.props" />
+
+ <!-- Properties that should be defined for all managed product assemblies -->
+ <PropertyGroup>
+ <Company>Microsoft Corporation</Company>
+ <Product>Microsoft%AE .NET Core</Product>
+ </PropertyGroup>
+</Project> \ No newline at end of file
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
new file mode 100644
index 0000000000..9758453686
--- /dev/null
+++ b/src/Directory.Build.targets
@@ -0,0 +1,20 @@
+<Project>
+ <Import Project="../Directory.Build.targets" />
+
+ <ItemGroup>
+ <BuiltBinary Include="$(TargetPath)" />
+ </ItemGroup>
+
+ <!-- Target used to consolidate all PDBs into a single location -->
+ <Target Name="MoveSymbolFiles"
+ AfterTargets="Build"
+ Condition="Exists(@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb'))"
+ Inputs="@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb')"
+ Outputs="@(BuiltBinary -> '$(BinDir)PDB/%(Filename).pdb')">
+
+ <Move SourceFiles="@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb')"
+ DestinationFolder="$(BinDir)PDB" />
+
+ </Target>
+
+</Project> \ No newline at end of file
diff --git a/src/System.Private.CoreLib/Common/System/SR.cs b/src/System.Private.CoreLib/Common/System/SR.cs
index da03e59c17..4c04be45c5 100644
--- a/src/System.Private.CoreLib/Common/System/SR.cs
+++ b/src/System.Private.CoreLib/Common/System/SR.cs
@@ -14,12 +14,6 @@ namespace System
{
internal static partial class SR
{
- private static ResourceManager? ResourceManager
- {
- get;
- set;
- }
-
// This method is used to decide if we need to append the exception message parameters to the message when calling SR.Format.
// by default it returns false.
[MethodImpl(MethodImplOptions.NoInlining)]
@@ -121,10 +115,6 @@ namespace System
_currentlyLoading.Add(key); // Push
- if (ResourceManager == null)
- {
- ResourceManager = new ResourceManager(SR.ResourceType);
- }
string? s = ResourceManager.GetString(key, null);
_currentlyLoading.RemoveAt(_currentlyLoading.Count - 1); // Pop
@@ -136,7 +126,7 @@ namespace System
if (lockTaken)
{
// Backout code - throw away potentially corrupt state
- ResourceManager = null;
+ s_resourceManager = null;
_currentlyLoading = null;
}
throw;
diff --git a/src/System.Private.CoreLib/GenerateCompilerResponseFile.targets b/src/System.Private.CoreLib/GenerateCompilerResponseFile.targets
index ed9136ffc6..3801c76c0d 100644
--- a/src/System.Private.CoreLib/GenerateCompilerResponseFile.targets
+++ b/src/System.Private.CoreLib/GenerateCompilerResponseFile.targets
@@ -5,18 +5,22 @@
</PropertyGroup>
<Target Name="GenerateCompilerResponseFile">
- <Message Text="Generating module name response file: $(IntermediateOutputPath)\moduleName.$(AssemblyName).rsp" />
+ <PropertyGroup>
+ <GeneratedCompilerResponseFile>$(IntermediateOutputPath)/moduleName.$(AssemblyName).rsp</GeneratedCompilerResponseFile>
+ </PropertyGroup>
+
+ <Message Text="Generating module name response file: $(GeneratedCompilerResponseFile)" />
<!-- We need to set the runtimemetadataversion -->
- <WriteLinesToFile File="$(IntermediateOutputPath)\moduleName.$(AssemblyName).rsp"
+ <WriteLinesToFile File="$(GeneratedCompilerResponseFile)"
Lines="/runtimemetadataversion:v4.0.30319"
Overwrite="true" />
<ItemGroup>
- <Clean Include="$(IntermediateOutputPath)\moduleName.$(AssemblyName).rsp" />
+ <Clean Include="$(GeneratedCompilerResponseFile)" />
</ItemGroup>
<PropertyGroup>
- <CompilerResponseFile>$(IntermediateOutputPath)\moduleName.$(AssemblyName).rsp;$(CompilerResponseFile)</CompilerResponseFile>
+ <CompilerResponseFile>$(GeneratedCompilerResponseFile);$(CompilerResponseFile)</CompilerResponseFile>
</PropertyGroup>
</Target>
</Project> \ No newline at end of file
diff --git a/src/System.Private.CoreLib/ILLink.targets b/src/System.Private.CoreLib/ILLink.targets
index f33e2203ea..e5ede35f04 100644
--- a/src/System.Private.CoreLib/ILLink.targets
+++ b/src/System.Private.CoreLib/ILLink.targets
@@ -48,7 +48,7 @@
rewriting the assembly to an "output assembly"
-->
<UsingTask TaskName="ILLink" AssemblyFile="$(ILLinkTasksPath)" />
- <Target Name="ILLinkTrimAssembly" Condition="'$(ILLinkTrimAssembly)' == 'true'" DependsOnTargets="EnsureBuildToolsRuntime">
+ <Target Name="ILLinkTrimAssembly" Condition="'$(ILLinkTrimAssembly)' == 'true'">
<PropertyGroup>
<ILLinkArgs>$(ILLinkArgs)-r $(TargetName)</ILLinkArgs>
<!-- default action for core assemblies -->
diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj
index f1b8b6f24c..9bc07880fa 100644
--- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -1,16 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- Include common build properties -->
+<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <!-- Compilation options -->
+
+ <!-- Generate rsp -->
+ <Import Project="GenerateCompilerResponseFile.targets" />
+
+ <Target Name="GenerateTheRSPFile" BeforeTargets="CoreCompile" DependsOnTargets="GenerateCompilerResponseFile">
+ </Target>
+
+ <PropertyGroup>
+ <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
+ <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+ <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. -->
+ <DebugType>Portable</DebugType>
+ <DebugSymbols>true</DebugSymbols>
+
+ <!-- Force System.Private.CoreLib.dll into a special IL output directory -->
+ <OutputPath>$(BinDir)IL/</OutputPath>
+ </PropertyGroup>
+
+ <!-- Note that various places in SPCL depend on this resource name i.e. TplEventSource -->
+ <ItemGroup Label="Embedded Resources">
+ <EmbeddedResource Update="$(MSBuildThisFileDirectory)Resources\Strings.resx">
+ <GenerateSource>true</GenerateSource>
+ <ClassName>System.SR</ClassName>
+ </EmbeddedResource>
+ </ItemGroup>
+
<PropertyGroup>
<AvailablePlatforms>x64,x86,arm,armel,arm64</AvailablePlatforms>
<Configuration Condition=" '$(Configuration)' == '' ">$(BuildType)</Configuration>
<Platform Condition=" '$(Platform)' == '' ">$(BuildArch)</Platform>
<Platform Condition=" '$(Platform)' == 'armel' ">arm</Platform>
<ProjectGuid>{3DA06C3A-2E7B-4CB7-80ED-9B12916013F9}</ProjectGuid>
- <OutputType>Library</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
@@ -19,19 +48,18 @@
<NoStdLib>true</NoStdLib>
<NoCompilerStandardLib>true</NoCompilerStandardLib>
<SubsystemVersion>6.00</SubsystemVersion>
- <UTF8OutPut>true</UTF8OutPut>
+ <Utf8Output>true</Utf8Output>
<HighEntropyVA>true</HighEntropyVA>
<ErrorReport>prompt</ErrorReport>
- <CLSCompliant>true</CLSCompliant>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <!-- Remove BCL0020 once https://github.com/dotnet/arcade/pull/2158 is available
- Remove CS8608 once https://github.com/dotnet/roslyn/issues/23268 is resolved -->
- <NoWarn>649,1573,1591,0419,BCL0020,CS8609</NoWarn>
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
- <SignAssembly>true</SignAssembly>
- <DelaySign>true</DelaySign>
- <DefineConstants>$(DefineConstants);CORECLR;netcoreapp</DefineConstants>
+ <!-- Remove CS8608 once https://github.com/dotnet/roslyn/issues/23268 is resolved -->
+ <NoWarn>649,1573,1591,0419,3021,CS8609</NoWarn>
+
+ <!-- Ignore all previous constants since SPCL is sensitive to what is defined and the Sdk adds some by default -->
+ <DefineConstants>CORECLR;netcoreapp</DefineConstants>
+ <DisableImplicitConfigurationDefines>true</DisableImplicitConfigurationDefines>
+
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
@@ -40,25 +68,6 @@
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
</PropertyGroup>
- <!-- Approximate Arcade version string https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md -->
- <!-- This workaround should be removed once CoreCLR repo is updated to use Arcade -->
- <PropertyGroup>
- <InformationalVersion>$(VersionPrefix)</InformationalVersion>
- </PropertyGroup>
- <PropertyGroup Condition="'$(PreReleaseLabel)' != ''">
- <InformationalVersion>$(InformationalVersion)-$(PreReleaseLabel).$(BuildNumberMajor).$(BuildNumberMinor)</InformationalVersion>
- </PropertyGroup>
- <PropertyGroup Condition="'$(LatestCommit)' != ''">
- <InformationalVersion>$(InformationalVersion)+$(LatestCommit)</InformationalVersion>
- </PropertyGroup>
-
- <!-- Add Serviceable attribute to the project's metadata -->
- <ItemGroup>
- <AssemblyMetadata Include="Serviceable">
- <Value>True</Value>
- <Visible>false</Visible>
- </AssemblyMetadata>
- </ItemGroup>
<!-- Platform specific properties -->
<PropertyGroup Condition="'$(Platform)' == 'x64'">
<PlatformTarget>x64</PlatformTarget>
@@ -77,27 +86,32 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DefineConstants>BIT64;ARM64;$(DefineConstants)</DefineConstants>
</PropertyGroup>
+
<!-- Configuration specific properties -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">
- <DebugSymbols>true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Debug'">false</Optimize>
<Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Checked'">true</Optimize>
- <DebugType Condition="'$(DebugType)' == ''">full</DebugType>
<DefineConstants>_LOGGING;DEBUG;$(DefineConstants)</DefineConstants>
<DefineConstants Condition="'$(Platform)' == 'x86' or '$(Platform)' == 'x64'">CODE_ANALYSIS;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
- <DebugSymbols>true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
</PropertyGroup>
+
<!-- Assembly attributes -->
<PropertyGroup>
<AssemblyName>System.Private.CoreLib</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
- <MajorVersion>4</MajorVersion>
- <MinorVersion>6</MinorVersion>
<ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile>
+ <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
+ </PropertyGroup>
+
+ <!-- Signing -->
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ <StrongNameKeyId>SilverlightPlatform</StrongNameKeyId>
</PropertyGroup>
+
<!--
Helper Paths
-->
@@ -105,19 +119,17 @@
<CommonPath>$(MSBuildThisFileDirectory)Common</CommonPath>
<BclSourcesRoot>$(MSBuildThisFileDirectory)src</BclSourcesRoot>
</PropertyGroup>
+
<!-- Msbuild variables needed to get CoreCLR features to be set properly. -->
<PropertyGroup>
<!-- These are needed to make sure we have the right set of defines -->
<TargetArch Condition="'$(Platform)'=='x86'">i386</TargetArch>
<TargetArch Condition="'$(Platform)'!='x86'">$(Platform)</TargetArch>
</PropertyGroup>
- <!-- CLR Features -->
- <Import Project="$(MSBuildThisFileDirectory)..\..\clr.coreclr.props" />
- <Import Project="$(MSBuildThisFileDirectory)..\..\clr.defines.targets" />
- <!-- Experimental features -->
- <PropertyGroup Condition="'$(FeatureUtf8String)' == 'true'">
- <DefineConstants>$(DefineConstants);FEATURE_UTF8STRING</DefineConstants>
- </PropertyGroup>
+
+ <!-- Compilation options -->
+ <Import Project="../../clr.featuredefines.props" />
+
<!-- Sources -->
<ItemGroup>
<Compile Include="$(BclSourcesRoot)\Internal\Console.cs" />
@@ -287,7 +299,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\XplatEventLogger.cs" Condition="'$(FeatureXplatEventSource)' == 'true'" />
- <Compile Include="$(IntermediateOutputPath)..\Eventing\NativeRuntimeEventSource.cs" Condition="'$(FeaturePerfTracing)' == 'true'"/>
+ <Compile Include="$(IntermediateOutputPath)../Eventing/NativeRuntimeEventSource.cs" Condition="'$(FeaturePerfTracing)' == 'true'"/>
</ItemGroup>
<ItemGroup Condition="'$(FeatureCominterop)' == 'true'">
<Compile Include="$(BclSourcesRoot)\Internal\Runtime\InteropServices\WindowsRuntime\ExceptionSupport.cs" />
@@ -413,9 +425,9 @@
<Target Name="CDefineChecker" BeforeTargets="Build" Condition="'$(CheckCDefines)'=='true'">
<!-- Compiler Definition Verification -->
<PropertyGroup>
- <CMakeDefinitionSaveFile>$(IntermediateOutputPath)..\cmake.definitions</CMakeDefinitionSaveFile>
+ <CMakeDefinitionSaveFile>$(IntermediateOutputPath)\cmake.definitions</CMakeDefinitionSaveFile>
</PropertyGroup>
- <Exec Command="&quot;$(PYTHON)&quot; $(MSBuildThisFileDirectory)..\scripts\check-definitions.py &quot;$(CMakeDefinitionSaveFile)&quot; &quot;$(DefineConstants)&quot; &quot;$(IgnoreDefineConstants)&quot; " />
+ <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>
@@ -425,28 +437,29 @@
<PropertyGroup>
<FeatureAsyncCausalityTracer Condition="'$(FeatureCominterop)' == 'true'">true</FeatureAsyncCausalityTracer>
</PropertyGroup>
+
+ <!-- Globals used by ILLink.targets -->
<PropertyGroup>
- <StrongNameSig>Silverlight</StrongNameSig>
+ <TargetName>$(MSBuildProjectName)</TargetName>
+ <TargetExt>.dll</TargetExt>
</PropertyGroup>
+
+ <!-- Setup ILLink.targets -->
<ItemGroup>
- <AssemblyInfoLines Include="[assembly:System.Runtime.InteropServices.ComVisible(false)]" />
- <AssemblyInfoLines Include="[assembly:System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute(System.Runtime.InteropServices.DllImportSearchPath.AssemblyDirectory | System.Runtime.InteropServices.DllImportSearchPath.System32)]" />
+ <PackageReference Include="$(ILLinkTasksPackage)">
+ <Version>$(ILLinkTasksPackageVersion)</Version>
+ </PackageReference>
</ItemGroup>
- <!--
- Import common targets: codeAnalysis, Microsoft.CSharp, sign, versioning, codeOptimizations, etc.
- In doing so, override versioning targets.
- -->
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup>
- <!-- Overwrite the key that we are going to use for signing -->
- <AssemblyOriginatorKeyFile>$(ToolsDir)SilverlightPlatformPublicKey.snk</AssemblyOriginatorKeyFile>
- <!-- Don't need a strong name signature because we only ship the native image -->
- <StrongNameSig>None</StrongNameSig>
- </PropertyGroup>
+
<Import Project="CreateRuntimeRootILLinkDescriptorFile.targets" />
+
+ <Target Name="CreateRuntimeRootIlLinkDescFile" BeforeTargets="CoreCompile" DependsOnTargets="_CreateILLinkRuntimeRootDescriptorFile">
+ </Target>
+
<ItemGroup>
- <EmbeddedResource Include="$(_ILLinkRuntimeRootDescriptorFilePath)" />
+ <EmbeddedResource Include="$(_ILLinkRuntimeRootDescriptorFilePath)">
+ <LogicalName>$(MSBuildProjectName).xml</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<Import Project="ILLink.targets" />
- <Import Project="GenerateCompilerResponseFile.targets" />
</Project>
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs
index 184cc32890..44e5d0ad11 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs
@@ -14,7 +14,7 @@ namespace System.Threading.Tasks
Name = "System.Threading.Tasks.TplEventSource",
Guid = "2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5"
#if CORECLR
- ,LocalizationResources = "FxResources.System.Private.CoreLib.SR"
+ ,LocalizationResources = "System.Private.CoreLib.Resources.Strings"
#endif
)]
internal sealed class TplEventSource : EventSource
diff --git a/src/System.Private.CoreLib/src/System/Internal.cs b/src/System.Private.CoreLib/src/System/Internal.cs
index 534969a3c8..b6181b8d30 100644
--- a/src/System.Private.CoreLib/src/System/Internal.cs
+++ b/src/System.Private.CoreLib/src/System/Internal.cs
@@ -13,10 +13,11 @@
===========================================================*/
#nullable disable // Code in this file isn't actually executed
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
+using System;
using System.Collections.Generic;
using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
using System.Security;
using System.StubHelpers;
using System.Threading.Tasks;
@@ -25,9 +26,12 @@ using System.Threading.Tasks;
using System.Runtime.InteropServices.WindowsRuntime;
#endif // FEATURE_COMINTEROP
-[assembly: DefaultDependencyAttribute(LoadHint.Always)]
-// mscorlib would like to have its literal strings frozen if possible
-[assembly: System.Runtime.CompilerServices.StringFreezingAttribute()]
+[assembly: CLSCompliant(true)]
+[assembly: ComVisible(false)]
+[assembly: DefaultDllImportSearchPathsAttribute(DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.System32)]
+
+// Add Serviceable attribute to the assembly metadata
+[assembly: AssemblyMetadata("Serviceable", "True")]
namespace System
{
diff --git a/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj b/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj
index 7cff9d7b6f..5e888a2c9f 100644
--- a/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj
+++ b/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj
@@ -1,80 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>SOS.NETCore</AssemblyName>
- <AssemblyVersion>1.0.0.0</AssemblyVersion>
- <ProjectGuid>{20513BA2-A156-4A17-4C70-5AC2DBD4F833}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <OutputType>Library</OutputType>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <NoStdLib>true</NoStdLib>
- <NoCompilerStandardLib>true</NoCompilerStandardLib>
- <IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
- <AssemblyKey>Open</AssemblyKey>
- <ExcludeMscorlibFacade>true</ExcludeMscorlibFacade>
- <ContainsPackageReferences>true</ContainsPackageReferences>
-
- <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
- the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
- <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
- <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
- </PropertyGroup>
-
- <!-- Default configurations to help VS understand the options -->
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
-
- <!-- Configuration specific properties -->
- <PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">
- <DebugSymbols>true</DebugSymbols>
- <DefineConstants>_DEBUG;DEBUG;TRACE;$(DefineConstants)</DefineConstants>
- </PropertyGroup>
-
- <PropertyGroup>
- <DebugType>portable</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <Compile Include="SymbolReader.cs" />
- </ItemGroup>
-
- <PropertyGroup>
- <TargetFramework>netcoreapp1.0</TargetFramework>
- <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
- <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>
+ <NoWarn>;1591;1701</NoWarn>
+ <Description>.NET Core SOS</Description>
+ <OutputPath>$(BinDir)</OutputPath>
+ <EnsureRuntimePackageDependencies>false</EnsureRuntimePackageDependencies>
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="System.IO.FileSystem">
- <Version>4.3.0</Version>
- </PackageReference>
- <PackageReference Include="System.Runtime.InteropServices">
- <Version>4.3.0</Version>
- </PackageReference>
- <PackageReference Include="System.Reflection.Metadata">
- <Version>1.4.1</Version>
- </PackageReference>
+ <PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
</ItemGroup>
-
- <Target Name="CopyItemsToDirectory" AfterTargets="Build">
- <Copy
- SourceFiles="$(OutputPath)$(AssemblyName).dll"
- DestinationFolder="$(BinDir)"
- SkipUnchangedFiles="false"
- OverwriteReadOnlyFiles="false"
- UseHardlinksIfPossible="false">
- </Copy>
-
- <Copy
- SourceFiles="$(OutputPath)$(AssemblyName).pdb"
- DestinationFolder="$(BinDir)\PDB"
- SkipUnchangedFiles="false"
- OverwriteReadOnlyFiles="false"
- UseHardlinksIfPossible="false">
- </Copy>
- </Target>
-
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
diff --git a/src/build.proj b/src/build.proj
index b7d0e8b797..c4e9d4d011 100644
--- a/src/build.proj
+++ b/src/build.proj
@@ -1,54 +1,30 @@
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\dir.props"/>
+<Project Sdk="Microsoft.Build.Traversal">
+
+ <!-- List the projects that need to be restored only -->
+ <ItemGroup Condition="'$(IncludeRestoreOnlyProjects)' == 'true'">
+ <ProjectReference Condition="'$(BuildType)'=='Release'" Include="$(SourceDir).nuget/optdata/optdata.csproj" />
+ <ProjectReference Include="$(SourceDir).nuget/init/init.csproj" />
+ </ItemGroup>
<!-- List the projects that need to be built -->
<ItemGroup>
- <Project Condition="$(SkipSOS) != 'true'" Include="ToolBox\SOS\NETCore\SOS.NETCore.csproj" />
- <Project Include="System.Private.CoreLib\System.Private.CoreLib.csproj" />
+ <ProjectReference Condition="'$(SkipSOS)' != 'true'" Include="ToolBox\SOS\NETCore\SOS.NETCore.csproj" />
+ <ProjectReference Condition="'$(BuildManagedTools)' == 'true'" Include="tools/r2rdump/R2RDump.csproj" />
+ <ProjectReference Include="System.Private.CoreLib\System.Private.CoreLib.csproj" />
</ItemGroup>
- <Import Project="..\dir.targets" />
-
- <Import Project="..\dir.traversal.targets" />
-
- <Target Name="MovePostBuildBinaries" AfterTargets="Build">
- <Move SourceFiles="@(BinariesToMove)"
- DestinationFolder="$(BinDir)" />
- </Target>
+ <!-- [ARCADE_REMOVE] The below targets should be removed entirely when all projects become SDK
+ projects. These should not be in this project file, but in a separate targets file for post-build.
+ -->
+ <Import Project="../dir.props" />
- <ItemGroup>
- <ILToCopy Include="$(BinDir)System.Private.CoreLib.dll"/>
- <PDBSToMove Include="$(BinDir)System.Private.CoreLib.pdb"/>
- </ItemGroup>
-
- <PropertyGroup>
- <CoreLibPath>$(BinDir)System.Private.CoreLib.dll</CoreLibPath>
- <CoreLibPDBPath>$(BinDir)System.Private.CoreLib.pdb</CoreLibPDBPath>
- </PropertyGroup>
-
- <Target Name="BuildR2RDumpPackages" Condition="'$(DotNetBuildFromSource)' != 'true' AND '$(BuildManagedTools)' == 'true'" BeforeTargets="Build">
- <Exec Command="$(DotnetToolCommand) build /p:__BuildArch=$(BuildArch) /p:__BuildOS=$(BuildOS) /p:__BuildType=$(BuildType) tools/r2rdump/R2RDump.csproj"
- StandardOutputImportance="Low" />
- </Target>
-
- <Target Name="CopyCoreLib" AfterTargets="Build">
- <Copy Condition="Exists($(CoreLibPath))"
- SourceFiles="@(ILToCopy)"
- DestinationFolder="$(BinDir)IL" />
- </Target>
-
- <Target Name="MovePDB" AfterTargets="Build">
- <Move Condition="Exists($(CoreLibPDBPath))"
- SourceFiles="@(PDBSToMove)"
- DestinationFolder="$(BinDir)PDB" />
- </Target>
-
- <ItemGroup>
- <UcrtFilesToCopy Include="$(UniversalCRTSDKDir)Redist\ucrt\DLLs\$(BuildArch)\*.dll" />
- </ItemGroup>
<!-- Copy the UCRT files from the windows kit directory to the local directory.
The api-*xstate.dll binary needs to be signed. -->
<Target Name="CopyUcrtFiles" AfterTargets="Build">
+ <ItemGroup>
+ <UcrtFilesToCopy Include="$(UniversalCRTSDKDir)Redist\ucrt\DLLs\$(BuildArch)\*.dll" />
+ </ItemGroup>
+
<Copy Condition="'$(BuildType)'=='Release' AND '$(BuildArch)' != 'arm64'"
SourceFiles="@(UcrtFilesToCopy)"
DestinationFolder="$(BinDir)Redist\ucrt\DLLs\$(BuildArch)" />
@@ -66,6 +42,6 @@
</ItemGroup>
<Message Text="Checking if the following DLLs are properly compiled with PGO" Importance="High" />
- <Exec Command="python $(MSBuildThisFileDirectory)scripts\pgocheck.py @(PGOEnforcedFiles)" />
+ <Exec Command="&quot;$(PYTHON)&quot; $(MSBuildThisFileDirectory)scripts\pgocheck.py @(PGOEnforcedFiles)" />
</Target>
</Project>
diff --git a/src/scripts/check-definitions.py b/src/scripts/check-definitions.py
index 4f1026d4ef..24e75b4ddb 100644
--- a/src/scripts/check-definitions.py
+++ b/src/scripts/check-definitions.py
@@ -27,6 +27,7 @@ from __future__ import print_function
import sys
import re
+import os
debug = 0
@@ -130,32 +131,33 @@ def printPotentiallyCritical(arrDefinitions, referencedFilename, arrIgnore):
# MAIN SCRIPT
if len(sys.argv) < 3:
print("\nUsage:")
- print("$ check-definitions.py [Definition file] [String of definitions]")
+ print("$ check-definitions.py [ProjectDir] [Definition file] [String of definitions]")
print(" Definition file contains the list of cmake (native) compiler definitions")
print(" seperated by line.")
print(" String of definitions contains the list of csproj (managed) definitions")
print(" seperated by semicolons.")
sys.exit(-1)
-filename = sys.argv[1]
-string = sys.argv[2]
+projectDir = sys.argv[1]
+filename = sys.argv[2]
+string = sys.argv[3]
arrayNative = loadDefinitionFile(filename)
arrayManaged = loadDefinitionString(string)
arrayIgnore = []
-if len(sys.argv) > 3:
- arrayIgnore = loadDefinitionString(sys.argv[3])
+if len(sys.argv) > 4:
+ arrayIgnore = loadDefinitionString(sys.argv[4])
arrays = getDiff(arrayNative, arrayManaged)
# arrays[0] = array of added in managed
# arrays[1] = array of omitted in managed (added in native)
print("Potentially Dangerous Compiler Definitions in clrdefinitions.cmake (omitted in native build):")
-printPotentiallyCritical(arrays[0], "../../clrdefinitions.cmake", arrayIgnore)
+printPotentiallyCritical(arrays[0], os.path.join(projectDir, "clrdefinitions.cmake"), arrayIgnore)
-print("Potentially Dangerous Compiler Definitions in clr.defines.targets (omitted in managed build):")
-printPotentiallyCritical(arrays[1], "../../clr.defines.targets", arrayIgnore)
+print("Potentially Dangerous Compiler Definitions in clr.featuredefines.props (omitted in managed build):")
+printPotentiallyCritical(arrays[1], os.path.join(projectDir, "clr.featuredefines.props"), arrayIgnore)
print("Definition Check Completed.")
diff --git a/src/tools/r2rdump/R2RDump.csproj b/src/tools/r2rdump/R2RDump.csproj
index 026e4a5ee9..18c2cadb8d 100644
--- a/src/tools/r2rdump/R2RDump.csproj
+++ b/src/tools/r2rdump/R2RDump.csproj
@@ -1,5 +1,5 @@
-<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+<Project Sdk="Microsoft.NET.Sdk">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<AssemblyName>R2RDump</AssemblyName>
@@ -17,7 +17,6 @@
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
</PropertyGroup>
-
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.CoreDisTools">
<Version>1.0.1-prerelease-00005</Version>
@@ -29,6 +28,4 @@
<Version>1.6.0</Version>
</PackageReference>
</ItemGroup>
-
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>