From 34154e95a920eaa8d36b1f9220aec5b185618f5c Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Wed, 2 Mar 2016 13:22:39 -0800 Subject: [PATCH] Introducing netstandard13aot target group in System.IO We need to build System.IO that work with corert which we need to get rid of WinRT dependencies and that will require to have different code in System.IO which require creating a new target group. This change should be no-op for other target groups. Conflicts: src/System.IO/src/System.IO.csproj --- dir.props | 8 ++++ src/Common/src/System/SR.CoreRT.cs | 55 +++++++++++++++++++++++++ src/System.IO/pkg/aot/System.IO.pkgproj | 3 ++ src/System.IO/src/System.IO.builds | 3 ++ src/System.IO/src/System.IO.csproj | 16 +++++-- src/System.IO/src/project.json | 17 +++++++- 6 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 src/Common/src/System/SR.CoreRT.cs diff --git a/dir.props b/dir.props index d697e48b7d42..63e1a86b2f54 100644 --- a/dir.props +++ b/dir.props @@ -211,6 +211,7 @@ AnyOS netcore50aot + netstandard13aot netcore50 dnxcore50 net462 @@ -309,6 +310,13 @@ .NETCore,Version=v5.0 + + + netstandard1.3 + aot + .NETStandard,Version=v1.3 + + dnxcore50 diff --git a/src/Common/src/System/SR.CoreRT.cs b/src/Common/src/System/SR.CoreRT.cs new file mode 100644 index 000000000000..2dca79d488fe --- /dev/null +++ b/src/Common/src/System/SR.CoreRT.cs @@ -0,0 +1,55 @@ +// 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. + +using System.Runtime.CompilerServices; + +namespace System +{ + // This is a placeholder for resources access implementation for corert. + // At some point we’ll have the real implementation which expect to be shared between + // System.IO, System.Runtime.Extensions and System.Resources.ResourceManager. + + internal static partial class SR + { + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string GetResourceString(string resourceKey) + { + return resourceKey; + } + + internal static string GetResourceString(string resourceKey, string defaultString) + { + return defaultString != null ? defaultString : resourceKey; + } + + internal static string Format(string resourceFormat, params object[] args) + { + if (args != null) + { + return string.Format(resourceFormat, args); + } + + return resourceFormat; + } + + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string Format(string resourceFormat, object p1) + { + return string.Format(resourceFormat, p1); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string Format(string resourceFormat, object p1, object p2) + { + return string.Format(resourceFormat, p1, p2); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string Format(string resourceFormat, object p1, object p2, object p3) + { + return string.Format(resourceFormat, p1, p2, p3); + } + } +} diff --git a/src/System.IO/pkg/aot/System.IO.pkgproj b/src/System.IO/pkg/aot/System.IO.pkgproj index 79e4b41d6a0a..84c2c22ee834 100644 --- a/src/System.IO/pkg/aot/System.IO.pkgproj +++ b/src/System.IO/pkg/aot/System.IO.pkgproj @@ -11,6 +11,9 @@ netcore50aot + + netstandard13aot + diff --git a/src/System.IO/src/System.IO.builds b/src/System.IO/src/System.IO.builds index c178f8c49493..ea278ea17ed3 100644 --- a/src/System.IO/src/System.IO.builds +++ b/src/System.IO/src/System.IO.builds @@ -9,6 +9,9 @@ netcore50aot + + netstandard13aot + diff --git a/src/System.IO/src/System.IO.csproj b/src/System.IO/src/System.IO.csproj index ba9699157574..4b32ada8e1ae 100644 --- a/src/System.IO/src/System.IO.csproj +++ b/src/System.IO/src/System.IO.csproj @@ -16,12 +16,14 @@ + + None - + true true true @@ -41,7 +43,7 @@ - + @@ -61,9 +63,12 @@ Common\System\IO\StringBuilderCache.cs - + Common\System\SR.Core.cs + + Common\System\SR.CoreRT.cs + @@ -79,6 +84,11 @@ + + + + + diff --git a/src/System.IO/src/project.json b/src/System.IO/src/project.json index c7007f0f817a..697611784fa7 100644 --- a/src/System.IO/src/project.json +++ b/src/System.IO/src/project.json @@ -24,6 +24,21 @@ "dependencies": { "Microsoft.TargetingPack.NETFramework.v4.6": "1.0.1" } - } + }, + "netstandard1.3": { + "imports": [ "netcore50" ], + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1-rc3-23901", + "Microsoft.TargetingPack.Private.NETNative": "1.0.0-rc3-23901", + "System.Diagnostics.Contracts": "4.0.0", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tools": "4.0.0", + "System.Globalization": "4.0.0", + "System.Runtime.Extensions": "4.0.10", + "System.Text.Encoding.Extensions": "4.0.0", + "System.Threading": "4.0.0", + "System.Threading.Tasks": "4.0.10" + } + } } }