From fdfb060795a0cca62bc98df97c28160160f4317a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 17 Mar 2021 20:36:31 -0400 Subject: remove unused code (#767) --- src/SMAPI.Tests/SMAPI.Tests.csproj | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/SMAPI.Tests/SMAPI.Tests.csproj') diff --git a/src/SMAPI.Tests/SMAPI.Tests.csproj b/src/SMAPI.Tests/SMAPI.Tests.csproj index 51fe32bf..00623b83 100644 --- a/src/SMAPI.Tests/SMAPI.Tests.csproj +++ b/src/SMAPI.Tests/SMAPI.Tests.csproj @@ -1,5 +1,4 @@  - SMAPI.Tests SMAPI.Tests @@ -33,5 +32,4 @@ - -- cgit From 73321eceb96f263f10857667d7b3726a5098e770 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 17 Mar 2021 20:36:31 -0400 Subject: split compile flag into separate Windows + XNA flags (#767) --- build/common.targets | 2 +- docs/technical/smapi.md | 3 ++- src/SMAPI.ModBuildConfig/build/smapi.targets | 26 ++++++++++++++-------- .../SMAPI.Mods.ConsoleCommands.csproj | 15 ++++++++----- .../Patches/SpriteBatchValidationPatches.cs | 4 ++-- .../SMAPI.Mods.ErrorHandler.csproj | 15 ++++++++----- .../SMAPI.Mods.SaveBackup.csproj | 3 ++- src/SMAPI.Tests/SMAPI.Tests.csproj | 4 ++-- src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 2 ++ src/SMAPI.Web/SMAPI.Web.csproj | 4 ++-- src/SMAPI/Framework/InternalExtensions.cs | 2 +- src/SMAPI/Framework/SCore.cs | 4 ++-- src/SMAPI/SMAPI.csproj | 17 ++++++++------ 13 files changed, 61 insertions(+), 40 deletions(-) (limited to 'src/SMAPI.Tests/SMAPI.Tests.csproj') diff --git a/build/common.targets b/build/common.targets index d9d21466..21945321 100644 --- a/build/common.targets +++ b/build/common.targets @@ -9,7 +9,7 @@ latest $(AssemblySearchPaths);{GAC} - $(DefineConstants);SMAPI_FOR_WINDOWS + $(DefineConstants);SMAPI_FOR_WINDOWS;SMAPI_FOR_XNA diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index 223e9c5b..e77d9d82 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -56,7 +56,8 @@ SMAPI uses a small number of conditional compilation constants, which you can se flag | purpose ---- | ------- -`SMAPI_FOR_WINDOWS` | Whether SMAPI is being compiled on Windows for players on Windows. Set automatically in `crossplatform.targets`. +`SMAPI_FOR_WINDOWS` | Whether SMAPI is being compiled for Windows; if not set, the code assumes Linux/MacOS. Set automatically in `common.targets`. +`SMAPI_FOR_XNA` | Whether SMAPI is being compiled for XNA Framework; if not set, the code assumes MonoGame. Set automatically in `common.targets` with the same value as `SMAPI_FOR_WINDOWS`. `HARMONY_2` | Whether to enable experimental Harmony 2.0 support and rewrite existing Harmony 1._x_ mods for compatibility. Note that you need to replace `build/0Harmony.dll` with a Harmony 2.0 build (or switch to a package reference) to use this flag. ## For SMAPI developers diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets index 65544b12..76a1536c 100644 --- a/src/SMAPI.ModBuildConfig/build/smapi.targets +++ b/src/SMAPI.ModBuildConfig/build/smapi.targets @@ -47,19 +47,27 @@ - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + - - - @@ -41,5 +45,4 @@ - diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs index 95e4f5ef..f605b2ce 100644 --- a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs +++ b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs @@ -27,7 +27,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches #endif { harmony.Patch( -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA original: AccessTools.Method(typeof(SpriteBatch), "InternalDraw"), #else original: AccessTools.Method(typeof(SpriteBatch), "CheckValid", new[] { typeof(Texture2D) }), @@ -40,7 +40,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches /********* ** Private methods *********/ -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA /// The method to call instead of . /// The texture to validate. #else diff --git a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj index 5c0cf952..e5ce8f5e 100644 --- a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj +++ b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj @@ -7,6 +7,8 @@ x86 + + @@ -16,19 +18,21 @@ + + + + + + - - + - - - @@ -42,5 +46,4 @@ - diff --git a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj index 98a3f0cc..a30c2c1d 100644 --- a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj +++ b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj @@ -7,6 +7,8 @@ x86 + + @@ -20,5 +22,4 @@ - diff --git a/src/SMAPI.Tests/SMAPI.Tests.csproj b/src/SMAPI.Tests/SMAPI.Tests.csproj index 00623b83..f08b69ed 100644 --- a/src/SMAPI.Tests/SMAPI.Tests.csproj +++ b/src/SMAPI.Tests/SMAPI.Tests.csproj @@ -8,6 +8,8 @@ x86 + + @@ -30,6 +32,4 @@ - - diff --git a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj index 3fc9de58..986a5f04 100644 --- a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj +++ b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj @@ -7,6 +7,8 @@ x86 + + diff --git a/src/SMAPI.Web/SMAPI.Web.csproj b/src/SMAPI.Web/SMAPI.Web.csproj index 6cf8207f..ce5ffdbd 100644 --- a/src/SMAPI.Web/SMAPI.Web.csproj +++ b/src/SMAPI.Web/SMAPI.Web.csproj @@ -6,6 +6,8 @@ latest + + @@ -44,6 +46,4 @@ PreserveNewest - - diff --git a/src/SMAPI/Framework/InternalExtensions.cs b/src/SMAPI/Framework/InternalExtensions.cs index ba1879da..449aa2b7 100644 --- a/src/SMAPI/Framework/InternalExtensions.cs +++ b/src/SMAPI/Framework/InternalExtensions.cs @@ -181,7 +181,7 @@ namespace StardewModdingAPI.Framework { // get field name const string fieldName = -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA "inBeginEndPair"; #else "_beginCalled"; diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index e98dc04c..c758a793 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -12,7 +12,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Xna.Framework; -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA using System.Windows.Forms; #endif using Newtonsoft.Json; @@ -217,7 +217,7 @@ namespace StardewModdingAPI.Framework this.Toolkit.JsonHelper.JsonSettings.Converters.Add(converter); // add error handlers -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA Application.ThreadException += (sender, e) => this.Monitor.Log($"Critical thread exception: {e.Exception.GetLogSummary()}", LogLevel.Error); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); #endif diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 6344cb2f..ceef33df 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -12,6 +12,8 @@ icon.ico + + @@ -30,20 +32,22 @@ + + + + + + + - - + - - - - @@ -67,5 +71,4 @@ - -- cgit From b93e3cf522ebcc8711a8662a17cca1d034752269 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 17 Mar 2021 20:36:32 -0400 Subject: Drop hardcoded 32-bit restrictions on most SMAPI assemblies (#767) SMAPI itself needs to be 32-bit to avoid errors trying to load the 32-bit game. --- src/SMAPI.Installer/SMAPI.Installer.csproj | 1 - src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj | 1 - src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj | 1 - src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj | 1 - src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj | 1 - src/SMAPI.Tests/SMAPI.Tests.csproj | 1 - src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj | 1 - src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 1 - 8 files changed, 8 deletions(-) (limited to 'src/SMAPI.Tests/SMAPI.Tests.csproj') diff --git a/src/SMAPI.Installer/SMAPI.Installer.csproj b/src/SMAPI.Installer/SMAPI.Installer.csproj index 44ed3bd1..1777be5f 100644 --- a/src/SMAPI.Installer/SMAPI.Installer.csproj +++ b/src/SMAPI.Installer/SMAPI.Installer.csproj @@ -4,7 +4,6 @@ The SMAPI installer for players. net45 Exe - x86 false diff --git a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj index 1813f58b..5992fbbf 100644 --- a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj +++ b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj @@ -3,7 +3,6 @@ StardewModdingAPI.ModBuildConfig net45 - x86 latest true diff --git a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj index 2f5adc8a..a187c1ff 100644 --- a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj +++ b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj @@ -4,7 +4,6 @@ StardewModdingAPI.Mods.ConsoleCommands net45 false - x86 diff --git a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj index e5ce8f5e..788f6f16 100644 --- a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj +++ b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj @@ -4,7 +4,6 @@ StardewModdingAPI.Mods.ErrorHandler net45 false - x86 diff --git a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj index a30c2c1d..a6f76781 100644 --- a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj +++ b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj @@ -4,7 +4,6 @@ StardewModdingAPI.Mods.SaveBackup net45 false - x86 diff --git a/src/SMAPI.Tests/SMAPI.Tests.csproj b/src/SMAPI.Tests/SMAPI.Tests.csproj index f08b69ed..a0e5b2df 100644 --- a/src/SMAPI.Tests/SMAPI.Tests.csproj +++ b/src/SMAPI.Tests/SMAPI.Tests.csproj @@ -5,7 +5,6 @@ net45 false latest - x86 diff --git a/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj b/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj index 2bddc46a..d36a1882 100644 --- a/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj +++ b/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj @@ -4,7 +4,6 @@ Provides toolkit interfaces which are available to SMAPI mods. net4.5;netstandard2.0 true - x86 diff --git a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj index 986a5f04..d8e32acf 100644 --- a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj +++ b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj @@ -4,7 +4,6 @@ A library which encapsulates mod-handling logic for mod managers and tools. Not intended for use by mods. net4.5;netstandard2.0 true - x86 -- cgit