From 18ad6e5810ceef54e3c9dda1b880d601f8450696 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Sat, 9 Jul 2016 17:46:12 -0400 Subject: [PATCH 1/2] Add EnvironmentAugments to coreclr --- src/mscorlib/model.xml | 16 ++++++++++++++ src/mscorlib/mscorlib.shared.sources.props | 3 +++ .../Runtime/Augments/EnvironmentAugments.cs | 21 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs diff --git a/src/mscorlib/model.xml b/src/mscorlib/model.xml index 4b363a229d7c..b951881869ad 100644 --- a/src/mscorlib/model.xml +++ b/src/mscorlib/model.xml @@ -1847,6 +1847,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/mscorlib/mscorlib.shared.sources.props b/src/mscorlib/mscorlib.shared.sources.props index 78983c0639c8..3fcfd2703291 100644 --- a/src/mscorlib/mscorlib.shared.sources.props +++ b/src/mscorlib/mscorlib.shared.sources.props @@ -450,6 +450,9 @@ + + + diff --git a/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs b/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs new file mode 100644 index 000000000000..28104683c7c5 --- /dev/null +++ b/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs @@ -0,0 +1,21 @@ +// 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; + +namespace Internal.Runtime.Augments +{ + /// For internal use only. Exposes runtime functionality to the Environments implementation in corefx. + public static class EnvironmentAugments + { + public static int CurrentManagedThreadId => Environment.CurrentManagedThreadId; + public static void Exit(int exitCode) => Environment.Exit(exitCode); + public static int ExitCode { get { return Environment.ExitCode; } set { Environment.ExitCode = value; } } + public static void FailFast(string message, Exception error) => Environment.FailFast(message, error); + public static string[] GetCommandLineArgs() => Environment.GetCommandLineArgs(); + public static bool HasShutdownStarted => Environment.HasShutdownStarted; + public static string StackTrace => Environment.StackTrace; + public static int TickCount => Environment.TickCount; + } +} From 340f1b0b03cc03767ae0ea40c299ec708752b76c Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Wed, 13 Jul 2016 16:51:54 -0400 Subject: [PATCH 2/2] Conditionally compile EnvironmentAugments.cs for coreclr --- src/mscorlib/mscorlib.shared.sources.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mscorlib/mscorlib.shared.sources.props b/src/mscorlib/mscorlib.shared.sources.props index 3fcfd2703291..eed8917cd154 100644 --- a/src/mscorlib/mscorlib.shared.sources.props +++ b/src/mscorlib/mscorlib.shared.sources.props @@ -451,7 +451,7 @@ - +