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 # sensitive files
appsettings.Development.json appsettings.Development.json
# generated build files
build/0Harmony.*
# Azure generated files # Azure generated files
src/SMAPI.Web/Properties/PublishProfiles/*.pubxml 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 `Multiplayer.PeerConnected` event.
* Added `harmony_summary` console command which lists all current Harmony patches, optionally with a search filter. * 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. * 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. * 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: * Improved mod rewriting for compatibility:
* Fixed rewriting types in custom attributes. * 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 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 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 ## For SMAPI developers
### Compiling from source ### 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`. 3. Rename the folders to `SMAPI <version> installer` and `SMAPI <version> installer for developers`.
4. Zip the two folders. 4. Zip the two folders.
### Using a custom Harmony build ### Custom Harmony build
The official SMAPI releases include [a custom build of Harmony](https://github.com/Pathoschild/Harmony), SMAPI uses [a custom build of Harmony](https://github.com/Pathoschild/Harmony#readme), which is
but compiling from source will use the official build. To use a custom build, put `0Harmony.dll` in included in the `build` folder. To use a different build, just replace `0Harmony.dll` in that
the `build` folder and it'll be referenced automatically. folder.
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.
## Release notes ## Release notes
See [release notes](../release-notes.md). See [release notes](../release-notes.md).

View File

@ -14,14 +14,13 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="LargeAddressAware" Version="1.0.4" /> <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="Mono.Cecil" Version="0.11.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Platonymous.TMXTile" Version="1.3.8" /> <PackageReference Include="Platonymous.TMXTile" Version="1.3.8" />
</ItemGroup> </ItemGroup>
<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="$(GameExecutableName)" HintPath="$(GamePath)\$(GameExecutableName).exe" Private="False" />
<Reference Include="StardewValley.GameData" HintPath="$(GamePath)\StardewValley.GameData.dll" Private="False" /> <Reference Include="StardewValley.GameData" HintPath="$(GamePath)\StardewValley.GameData.dll" Private="False" />
<Reference Include="System.Numerics" Private="True" /> <Reference Include="System.Numerics" Private="True" />