diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-06-17 14:49:05 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 18:05:10 -0400 |
commit | 46a0dd6236a39175e85c11eac44a710db1c07847 (patch) | |
tree | 0a24917954de718d980417ac3487cec4469cda7c /src | |
parent | 660e8087a1885fcf48b7d34b4ec726eda0e732d1 (diff) | |
download | SMAPI-46a0dd6236a39175e85c11eac44a710db1c07847.tar.gz SMAPI-46a0dd6236a39175e85c11eac44a710db1c07847.tar.bz2 SMAPI-46a0dd6236a39175e85c11eac44a710db1c07847.zip |
move environment utility into toolkit for reuse
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs | 1 | ||||
-rw-r--r-- | src/SMAPI.Internal/SMAPI.Internal.projitems | 2 | ||||
-rw-r--r-- | src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 1 | ||||
-rw-r--r-- | src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs (renamed from src/SMAPI.Internal/EnvironmentUtility.cs) | 7 | ||||
-rw-r--r-- | src/SMAPI.Toolkit/Utilities/Platform.cs (renamed from src/SMAPI.Internal/Platform.cs) | 4 | ||||
-rw-r--r-- | src/SMAPI/Constants.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Framework/ModLoading/PlatformAssemblyMap.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/GamePlatform.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Program.cs | 2 |
10 files changed, 13 insertions, 12 deletions
diff --git a/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs b/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs index cdc729e2..40c2d986 100644 --- a/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs +++ b/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using StardewModdingAPI.Toolkit.Utilities; namespace StardewModdingAPI.Internal.ConsoleWriting { diff --git a/src/SMAPI.Internal/SMAPI.Internal.projitems b/src/SMAPI.Internal/SMAPI.Internal.projitems index 54b12003..1408cc46 100644 --- a/src/SMAPI.Internal/SMAPI.Internal.projitems +++ b/src/SMAPI.Internal/SMAPI.Internal.projitems @@ -10,9 +10,7 @@ </PropertyGroup> <ItemGroup> <Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\ColorfulConsoleWriter.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)EnvironmentUtility.cs" /> <Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\LogLevel.cs" /> <Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\MonitorColorScheme.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Platform.cs" /> </ItemGroup> </Project>
\ No newline at end of file diff --git a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj index 2c6493da..2be84316 100644 --- a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj +++ b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj @@ -18,6 +18,7 @@ <PackageReference Include="HtmlAgilityPack" Version="1.8.11" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.1" /> <PackageReference Include="Pathoschild.Http.FluentClient" Version="3.2.0" /> + <PackageReference Include="System.Management" Version="4.5.0" Condition="'$(OS)' == 'Windows_NT'" /> </ItemGroup> <ItemGroup> diff --git a/src/SMAPI.Internal/EnvironmentUtility.cs b/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs index c4e4678a..4f67c00e 100644 --- a/src/SMAPI.Internal/EnvironmentUtility.cs +++ b/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs @@ -6,10 +6,10 @@ using System.Management; #endif using System.Runtime.InteropServices; -namespace StardewModdingAPI.Internal +namespace StardewModdingAPI.Toolkit.Utilities { /// <summary>Provides methods for fetching environment information.</summary> - internal static class EnvironmentUtility + public static class EnvironmentUtility { /********* ** Fields @@ -41,7 +41,7 @@ namespace StardewModdingAPI.Internal } } - + /// <summary>Get the human-readable OS name and version.</summary> /// <param name="platform">The current platform.</param> [SuppressMessage("ReSharper", "EmptyGeneralCatchClause", Justification = "Error suppressed deliberately to fallback to default behaviour.")] @@ -77,6 +77,7 @@ namespace StardewModdingAPI.Internal return platform == Platform.Linux || platform == Platform.Mac; } + /********* ** Private methods *********/ diff --git a/src/SMAPI.Internal/Platform.cs b/src/SMAPI.Toolkit/Utilities/Platform.cs index 81ca5c1f..d64cbeb9 100644 --- a/src/SMAPI.Internal/Platform.cs +++ b/src/SMAPI.Toolkit/Utilities/Platform.cs @@ -1,7 +1,7 @@ -namespace StardewModdingAPI.Internal +namespace StardewModdingAPI.Toolkit.Utilities { /// <summary>The game's platform version.</summary> - internal enum Platform + public enum Platform { /// <summary>The Linux version of the game.</summary> Linux, diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index e02c9265..4e24477b 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -5,7 +5,7 @@ using System.Reflection; using StardewModdingAPI.Enums; using StardewModdingAPI.Framework; using StardewModdingAPI.Framework.ModLoading; -using StardewModdingAPI.Internal; +using StardewModdingAPI.Toolkit.Utilities; using StardewValley; namespace StardewModdingAPI diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index ca171ae1..8dfacc33 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -6,9 +6,9 @@ using System.Reflection; using Mono.Cecil; using Mono.Cecil.Cil; using StardewModdingAPI.Framework.Exceptions; -using StardewModdingAPI.Internal; using StardewModdingAPI.Metadata; using StardewModdingAPI.Toolkit.Framework.ModData; +using StardewModdingAPI.Toolkit.Utilities; namespace StardewModdingAPI.Framework.ModLoading { diff --git a/src/SMAPI/Framework/ModLoading/PlatformAssemblyMap.cs b/src/SMAPI/Framework/ModLoading/PlatformAssemblyMap.cs index 01460dce..d4366294 100644 --- a/src/SMAPI/Framework/ModLoading/PlatformAssemblyMap.cs +++ b/src/SMAPI/Framework/ModLoading/PlatformAssemblyMap.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using Mono.Cecil; -using StardewModdingAPI.Internal; +using StardewModdingAPI.Toolkit.Utilities; namespace StardewModdingAPI.Framework.ModLoading { diff --git a/src/SMAPI/GamePlatform.cs b/src/SMAPI/GamePlatform.cs index 3bd74462..174239e0 100644 --- a/src/SMAPI/GamePlatform.cs +++ b/src/SMAPI/GamePlatform.cs @@ -1,4 +1,4 @@ -using StardewModdingAPI.Internal; +using StardewModdingAPI.Toolkit.Utilities; namespace StardewModdingAPI { diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 3a34872a..df7654cd 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -7,7 +7,7 @@ using System.Threading; #if SMAPI_FOR_WINDOWS #endif using StardewModdingAPI.Framework; -using StardewModdingAPI.Internal; +using StardewModdingAPI.Toolkit.Utilities; namespace StardewModdingAPI { |