add optional Harmony reference to mod build package

This commit is contained in:
Jesse Plamondon-Willard 2019-06-19 13:47:05 -04:00
parent a07e2de9a0
commit a54db1b330
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
3 changed files with 16 additions and 0 deletions

View File

@ -49,6 +49,12 @@ non-mod projects like unit tests, you can set this property:
<CopyModReferencesToBuildOutput>true</CopyModReferencesToBuildOutput>
```
If your mod uses [Harmony](https://github.com/pardeike/Harmony) (not recommended for most mods),
the package can add a reference to SMAPI's Harmony DLL for you:
```xml
<EnableHarmony>true</EnableHarmony>
```
### Copy files into the `Mods` folder and create release zip
<dl>
<dt>Files considered part of your mod</dt>
@ -269,6 +275,7 @@ If you need to copy the referenced DLLs into your build output, add this too:
* added GAC to assembly search paths to fix references to XNA Framework.
* Added option to disable game debugging config.
* Added `.pdb` files to builds by default (to enable line numbers in error stack traces).
* Added optional Harmony reference.
* Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly.
* Fixed `<IgnoreModFilePatterns>` not working for `i18n` files.
* Dropped support for older versions of SMAPI and Visual Studio.

View File

@ -24,6 +24,7 @@
<ModZipPath Condition="'$(ModZipPath)' == ''">$(TargetDir)</ModZipPath>
<EnableModDeploy Condition="'$(EnableModDeploy)' == ''">true</EnableModDeploy>
<EnableModZip Condition="'$(EnableModZip)' == ''">true</EnableModZip>
<EnableHarmony Condition="'$(EnableModZip)' == ''">false</EnableHarmony>
<EnableGameDebugging Condition="$(EnableGameDebugging) == ''">true</EnableGameDebugging>
<CopyModReferencesToBuildOutput Condition="'$(CopyModReferencesToBuildOutput)' == ''">false</CopyModReferencesToBuildOutput>
</PropertyGroup>
@ -32,6 +33,13 @@
<!--*********************************************
** Inject the assembly references and debugging configuration
**********************************************-->
<ItemGroup>
<Reference Include="0Harmony" Condition="'$(EnableHarmony)' == 'true'">
<HintPath>$(GamePath)\smapi-internal\0Harmony.dll</HintPath>
<Private>false</Private>
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
</Reference>
</ItemGroup>
<Choose>
<When Condition="$(OS) == 'Windows_NT'">
<!-- references -->

View File

@ -22,6 +22,7 @@
- added GAC to assembly search paths to fix references to XNA Framework.
- Added option to disable game debugging config.
- Added `.pdb` files to builds by default (to enable line numbers in error stack traces).
- Added optional Harmony reference.
- Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly.
- Fixed `&lt;IgnoreModFilePatterns&gt;` not working for `i18n` files.
- Dropped support for older versions of SMAPI and Visual Studio.