switch to custom build of Harmony 1.2.0.1

This commit is contained in:
Jesse Plamondon-Willard 2020-06-20 00:13:23 -04:00
parent aeab19f4ac
commit a7cf886b71
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
5 changed files with 7 additions and 14 deletions

3
.gitignore vendored
View File

@ -30,8 +30,5 @@ _ReSharper*/
# sensitive files
appsettings.Development.json
# generated build files
build/0Harmony.*
# Azure generated files
src/SMAPI.Web/Properties/PublishProfiles/*.pubxml

BIN
build/0Harmony.dll Normal file

Binary file not shown.

View File

@ -28,6 +28,7 @@
* Added `Multiplayer.PeerConnected` event.
* Added `harmony_summary` console command which lists all current Harmony patches, optionally with a search filter.
* Added ability to override update keys from the compatibility list.
* SMAPI now uses [a custom build of Harmony](https://github.com/Pathoschild/Harmony#readme) to provide more useful stack traces in error logs.
* Harmony mods which use the `[HarmonyPatch(type)]` attribute now work crossplatform. Previously SMAPI couldn't rewrite types in custom attributes for compatibility.
* Improved mod rewriting for compatibility:
* Fixed rewriting types in custom attributes.

View File

@ -58,7 +58,7 @@ 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`.
`HARMONY_2` | Whether to enable experimental Harmony 2.0 support. Existing Harmony 1._x_ mods will be rewritten automatically for compatibility.
`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
### Compiling from source
@ -102,14 +102,10 @@ on the wiki for the first-time setup.
3. Rename the folders to `SMAPI <version> installer` and `SMAPI <version> installer for developers`.
4. Zip the two folders.
### Using a custom Harmony build
The official SMAPI releases include [a custom build of Harmony](https://github.com/Pathoschild/Harmony),
but compiling from source will use the official build. To use a custom build, put `0Harmony.dll` in
the `build` folder and it'll be referenced automatically.
Note that Harmony merges its dependencies into `0Harmony.dll` when compiled in release mode. To use
a debug build of Harmony, you'll need to manually copy those dependencies into your game's
`smapi-internal` folder.
### Custom Harmony build
SMAPI uses [a custom build of Harmony](https://github.com/Pathoschild/Harmony#readme), which is
included in the `build` folder. To use a different build, just replace `0Harmony.dll` in that
folder.
## Release notes
See [release notes](../release-notes.md).

View File

@ -14,14 +14,13 @@
<ItemGroup>
<PackageReference Include="LargeAddressAware" Version="1.0.4" />
<PackageReference Include="Lib.Harmony" Version="1.2.0.1" Condition="!Exists('..\..\build\0Harmony.dll')" />
<PackageReference Include="Mono.Cecil" Version="0.11.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Platonymous.TMXTile" Version="1.3.8" />
</ItemGroup>
<ItemGroup>
<Reference Include="..\..\build\0Harmony.dll" Private="True" Condition="Exists('..\..\build\0Harmony.dll')" />
<Reference Include="..\..\build\0Harmony.dll" Private="True" />
<Reference Include="$(GameExecutableName)" HintPath="$(GamePath)\$(GameExecutableName).exe" Private="False" />
<Reference Include="StardewValley.GameData" HintPath="$(GamePath)\StardewValley.GameData.dll" Private="False" />
<Reference Include="System.Numerics" Private="True" />