Skip to content

Commit bf10aee

Browse files
committed
remove GameFramework build property from package
1 parent 4a26c96 commit bf10aee

5 files changed

Lines changed: 11 additions & 22 deletions

File tree

docs/technical/mod-package.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ change how these work):
3232
`$(GamePath)` and `$(GameModsPath)`.
3333

3434
* **Add assembly references:**
35-
The package adds assembly references to SMAPI, Stardew Valley, xTile, and the game framework
36-
(MonoGame on Linux/macOS, XNA Framework on Windows). It automatically adjusts depending on which OS
37-
you're compiling it on. If you use [Harmony](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Harmony),
38-
it can optionally add a reference to that too.
35+
The package adds assembly references to MonoGame, SMAPI, Stardew Valley, and xTile. It
36+
automatically adjusts depending on which OS you're compiling it on. If you use
37+
[Harmony](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Harmony), it can optionally add
38+
a reference to that too.
3939

4040
* **Copy files into the `Mods` folder:**
4141
The package automatically copies your mod's DLL and PDB files, `manifest.json`, [`i18n`
@@ -129,14 +129,6 @@ The absolute path to the folder containing the game's installed mods (defaults t
129129
</td>
130130
</tr>
131131
<tr>
132-
<td><code>GameFramework</code></td>
133-
<td>
134-
135-
The game framework for which the mod is being compiled (one of `Xna` or `MonoGame`). This is
136-
auto-detected based on the platform, and you should almost never change this.
137-
138-
</td>
139-
</tr>
140132
</table>
141133
</li>
142134

@@ -373,14 +365,16 @@ when you compile it.
373365
## Upcoming release
374366
* Updated for Stardew Valley 1.5.5 and SMAPI 3.13.0. **Older versions are no longer supported.**
375367
* Added `IgnoreModFilePaths` option to ignore literal paths.
376-
* Removed the `GameExecutableName` build property (since it now has the same value on all platforms).
368+
* Removed the `GameExecutableName` and `GameFramework` build properties (since they now have the
369+
same value on all platforms).
377370
* Improved analyzer performance by enabling parallel execution.
378371

379372
**Migration guide for mod authors:**
380373
1. See [_migrate to 64-bit_](https://stardewvalleywiki.com/Modding:Migrate_to_64-bit_on_Windows) and
381374
[_migrate to Stardew Valley 1.5.5_](https://stardewvalleywiki.com/Modding:Migrate_to_Stardew_Valley_1.5.5).
382375
2. Possible changes in your `.csproj` or `.targets` files:
383376
* If you use `$(GameExecutableName)`, replace it with `Stardew Valley`.
377+
* If you use `$(GameFramework)`, replace it with `MonoGame` and remove any XNA-specific logic.
384378

385379
## 3.3.0
386380
Released 30 March 2021.

src/SMAPI.ModBuildConfig/build/smapi.targets

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
<EnableHarmony Condition="'$(EnableHarmony)' == ''">false</EnableHarmony>
3131
<EnableGameDebugging Condition="'$(EnableGameDebugging)' == ''">true</EnableGameDebugging>
3232
<CopyModReferencesToBuildOutput Condition="'$(CopyModReferencesToBuildOutput)' == '' OR ('$(CopyModReferencesToBuildOutput)' != 'true' AND '$(CopyModReferencesToBuildOutput)' != 'false')">false</CopyModReferencesToBuildOutput>
33-
34-
<GameFramework Condition="'$(GameFramework)' == '' AND '$(OS)' == 'Windows_NT'">Xna</GameFramework>
35-
<GameFramework Condition="'$(GameFramework)' == ''">MonoGame</GameFramework>
3633
</PropertyGroup>
3734

3835
<PropertyGroup Condition="'$(OS)' == 'Windows_NT' AND '$(EnableGameDebugging)' == 'true'">

src/SMAPI/Constants.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ internal static void ConfigureAssemblyResolver(AssemblyDefinitionResolver resolv
241241

242242
/// <summary>Get metadata for mapping assemblies to the current platform.</summary>
243243
/// <param name="targetPlatform">The target game platform.</param>
244-
/// <param name="framework">The game framework running the game.</param>
245-
internal static PlatformAssemblyMap GetAssemblyMap(Platform targetPlatform, GameFramework framework)
244+
internal static PlatformAssemblyMap GetAssemblyMap(Platform targetPlatform)
246245
{
247246
var removeAssemblyReferences = new List<string>();
248247
var targetAssemblies = new List<Assembly>();

src/SMAPI/Framework/ModLoading/AssemblyLoader.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,15 @@ internal class AssemblyLoader : IDisposable
5353
*********/
5454
/// <summary>Construct an instance.</summary>
5555
/// <param name="targetPlatform">The current game platform.</param>
56-
/// <param name="framework">The game framework running the game.</param>
5756
/// <param name="monitor">Encapsulates monitoring and logging.</param>
5857
/// <param name="paranoidMode">Whether to detect paranoid mode issues.</param>
5958
/// <param name="rewriteMods">Whether to rewrite mods for compatibility.</param>
60-
public AssemblyLoader(Platform targetPlatform, GameFramework framework, IMonitor monitor, bool paranoidMode, bool rewriteMods)
59+
public AssemblyLoader(Platform targetPlatform, IMonitor monitor, bool paranoidMode, bool rewriteMods)
6160
{
6261
this.Monitor = monitor;
6362
this.ParanoidMode = paranoidMode;
6463
this.RewriteMods = rewriteMods;
65-
this.AssemblyMap = this.TrackForDisposal(Constants.GetAssemblyMap(targetPlatform, framework));
64+
this.AssemblyMap = this.TrackForDisposal(Constants.GetAssemblyMap(targetPlatform));
6665

6766
// init resolver
6867
this.AssemblyDefinitionResolver = this.TrackForDisposal(new AssemblyDefinitionResolver());

src/SMAPI/Framework/SCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, ContentCoordin
14731473

14741474
// load mods
14751475
IList<IModMetadata> skippedMods = new List<IModMetadata>();
1476-
using (AssemblyLoader modAssemblyLoader = new AssemblyLoader(Constants.Platform, Constants.GameFramework, this.Monitor, this.Settings.ParanoidWarnings, this.Settings.RewriteMods))
1476+
using (AssemblyLoader modAssemblyLoader = new AssemblyLoader(Constants.Platform, this.Monitor, this.Settings.ParanoidWarnings, this.Settings.RewriteMods))
14771477
{
14781478
// init
14791479
HashSet<string> suppressUpdateChecks = new HashSet<string>(this.Settings.SuppressUpdateChecks, StringComparer.OrdinalIgnoreCase);

0 commit comments

Comments
 (0)