Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/shims
diff options
context:
space:
mode:
authorWes Haggard <weshaggard@users.noreply.github.com>2017-06-08 04:14:13 +0300
committerDan Moseley <danmose@microsoft.com>2017-06-08 04:14:13 +0300
commitca49bfbfd64351fddba56f2141b90841b8561eb7 (patch)
treee73821a0d7bc98ba1a8467d909ef29c0e0a020ca /src/shims
parent271ea583e8419c86ba5e14680f6dd83383919918 (diff)
Manually build mscorlib shim to allow for internal type forwards & Adding TypeForwardFrom to serialiazable types (#20697)
* Manually build mscorlib shim to allow for internal type forwards * prepare tests for netfx->core deserialization changes * update netfx serialized data * change hash updater so it doesn't use hard-coded path * Code cleanup for binary serialization * Changed ListT to ArrayList in CookieCoolection for cross serialization * Merge * Changed observablecollection typeforwards that already had typeforwards on netfx * Adding ValueTuple blobs for netfx471 * Add internal types which need to be forwarded * Pull mscorlib shim in along with windows.winmd To build UAP refs and libs we need an mscorlib shim. So for the build we pull one in from packages and it will get overwritten when we build the final one as part of our shim builds * Removed not needed typeforward and added description * Remved typeforwards from nested types * Fixed generic type syntax * Updated coreclr version, ifdefed imports for netcoreapp * disable netfx serialization for now * Merge error fixed * Update blobs after coreclr changes * Adding ValueTuple manual typeforwards * Renamed serialization variables for SortedSet * Disabling TreeSet<,> serialization support (for now) * Exception internal data storage typeforward added * Fix type conflict for mscorlib shim in uapaot configuration * Split the runtime and ref mscorlib shim We need to build the ref mscorlib shim only against the reference assemblies so we still build in shims.proj. However the runtime mscorlib shim needs to have access to internals so we build it against the runtime implementation using a manual project.
Diffstat (limited to 'src/shims')
-rw-r--r--src/shims/manual/mscorlib.csproj28
-rw-r--r--src/shims/manual/mscorlib.forwards.cs40
-rw-r--r--src/shims/netfxreference.props4
-rw-r--r--src/shims/shims.proj13
4 files changed, 84 insertions, 1 deletions
diff --git a/src/shims/manual/mscorlib.csproj b/src/shims/manual/mscorlib.csproj
new file mode 100644
index 0000000000..f6dd71cb18
--- /dev/null
+++ b/src/shims/manual/mscorlib.csproj
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <BuildConfigurations>
+ netcoreapp;
+ uap;
+ </BuildConfigurations>
+ <IsNETCoreApp>true</IsNETCoreApp>
+ <IsUAP>true</IsUAP>
+ </PropertyGroup>
+ <!-- need to by-pass the dir.props in the shims directory for this project -->
+ <Import Project="..\..\..\dir.props" />
+ <PropertyGroup>
+ <AssemblyVersion>4.0.0.0</AssemblyVersion>
+ <AssemblyKey>ECMA</AssemblyKey>
+ <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
+ <HasMatchingContract>true</HasMatchingContract>
+ <ContractAssemblyPath>$(NetFxRefPath)mscorlib.dll</ContractAssemblyPath>
+ <GenFacadesIgnoreMissingTypes>true</GenFacadesIgnoreMissingTypes>
+ <IsRuntimeAssembly>true</IsRuntimeAssembly>
+ <DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);netcoreapp</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="mscorlib.forwards.cs" />
+ <ReferencePath Include="$(RuntimePath)System.*.dll;$(RuntimePath)Microsoft.*.dll" Exclude="$(RuntimePath)Microsoft.Diagnostics.Tracing.TraceEvent.dll" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project>
diff --git a/src/shims/manual/mscorlib.forwards.cs b/src/shims/manual/mscorlib.forwards.cs
new file mode 100644
index 0000000000..990aed8e2f
--- /dev/null
+++ b/src/shims/manual/mscorlib.forwards.cs
@@ -0,0 +1,40 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// Add any internal types that we need to forward from mscorlib.
+
+// These types are required for Desktop to Core serialization as they are not covered by GenAPI because they are marked as internal.
+#if netcoreapp
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.CultureAwareComparer))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.OrdinalComparer))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.OrdinalIgnoreCaseComparer))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.GenericComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.NullableComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.ObjectComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.Int32EnumComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.UInt32EnumComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.Int64EnumComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.UInt64EnumComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.GenericEqualityComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.NullableEqualityComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.ObjectEqualityComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.NonRandomizedStringEqualityComparer))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.ByteEqualityComparer))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.EnumEqualityComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.SByteEnumEqualityComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.ShortEnumEqualityComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.LongEnumEqualityComparer<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ListDictionaryInternal))]
+
+// This is temporary as we are building the mscorlib shim against netfx461 which doesn't contain ValueTuples.
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<,>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<,,>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<,,,>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<,,,,>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<,,,,,>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<,,,,,,>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ValueTuple<,,,,,,,>))]
+#endif
diff --git a/src/shims/netfxreference.props b/src/shims/netfxreference.props
index c82605b9a1..fbb61bfc22 100644
--- a/src/shims/netfxreference.props
+++ b/src/shims/netfxreference.props
@@ -1,6 +1,8 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
- <NetFxReference Include="mscorlib" />
+ <NetFxReference Include="mscorlib">
+ <ExcludeFromRuntime>true</ExcludeFromRuntime>
+ </NetFxReference>
<NetFxReference Include="System" />
<NetFxReference Include="System.ComponentModel.Composition" />
<NetFxReference Include="System.ComponentModel.DataAnnotations">
diff --git a/src/shims/shims.proj b/src/shims/shims.proj
index 6515b46f93..3bd3331bf3 100644
--- a/src/shims/shims.proj
+++ b/src/shims/shims.proj
@@ -74,9 +74,22 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="SwitchItemNameForRuntimeBinplaceConfigs" AfterTargets="GetBinPlaceConfiguration">
+ <ItemGroup>
+ <BinPlaceDir Condition="'%(Identity)' == '%(BinPlaceDir.RuntimePath)'">
+ <ItemName>RuntimeBinplaceItem</ItemName>
+ </BinPlaceDir>
+ <PackageFileDir Condition="'%(Identity)' == '%(PackageFileDir.PackageFileRuntimePath)'">
+ <ItemName>RuntimeBinplaceItem</ItemName>
+ </PackageFileDir>
+ </ItemGroup>
+ </Target>
+
<Target Name="GetBinPlaceItems">
<ItemGroup>
<BinPlaceItem Include="$(GenFacadesOutputPath)*.dll" />
+ <ExcludeRuntimeItems Include="@(GenFacadesContracts -> '$(GenFacadesOutputPath)%(Filename)%(Extension)')" Condition="'%(GenFacadesContracts.ExcludeFromRuntime)' == 'true'" />
+ <RuntimeBinplaceItem Include="@(BinPlaceItem)" Exclude="@(ExcludeRuntimeItems)" />
<FileWrites Include="@(BinPlaceItem)" />
</ItemGroup>
</Target>