summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/mod-build-config.md7
-rw-r--r--src/SMAPI.ModBuildConfig/build/smapi.targets8
-rw-r--r--src/SMAPI.ModBuildConfig/package.nuspec1
3 files changed, 16 insertions, 0 deletions
diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md
index 87e0cf30..9121c175 100644
--- a/docs/mod-build-config.md
+++ b/docs/mod-build-config.md
@@ -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.
diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets
index 1f512400..0daf40a1 100644
--- a/src/SMAPI.ModBuildConfig/build/smapi.targets
+++ b/src/SMAPI.ModBuildConfig/build/smapi.targets
@@ -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 -->
diff --git a/src/SMAPI.ModBuildConfig/package.nuspec b/src/SMAPI.ModBuildConfig/package.nuspec
index 60f14efe..524cadfd 100644
--- a/src/SMAPI.ModBuildConfig/package.nuspec
+++ b/src/SMAPI.ModBuildConfig/package.nuspec
@@ -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.