summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-14 11:29:07 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-14 11:29:07 -0400
commit2d19095169019a1cb07da5802dd83fb13550a051 (patch)
treecfc7559315d6bf724efd4ac364dee890c7005d22
parent79181012ee01e93c1af7c4bf8bd1a3a717274ded (diff)
downloadSMAPI-2d19095169019a1cb07da5802dd83fb13550a051.tar.gz
SMAPI-2d19095169019a1cb07da5802dd83fb13550a051.tar.bz2
SMAPI-2d19095169019a1cb07da5802dd83fb13550a051.zip
add support for using a custom Harmony build (#711)
-rw-r--r--.gitignore4
-rw-r--r--docs/technical/smapi.md33
-rw-r--r--src/SMAPI/SMAPI.csproj3
3 files changed, 24 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 5450a2f5..02522716 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,8 +30,8 @@ _ReSharper*/
# sensitive files
appsettings.Development.json
-# AWS generated files
-src/SMAPI.Web.LegacyRedirects/aws-beanstalk-tools-defaults.json
+# generated build files
+build/0Harmony.*
# Azure generated files
src/SMAPI.Web/Properties/PublishProfiles/*.pubxml
diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md
index c9d5c07e..ca8a9c70 100644
--- a/docs/technical/smapi.md
+++ b/docs/technical/smapi.md
@@ -15,6 +15,7 @@ This document is about SMAPI itself; see also [mod build package](mod-package.md
* [Compiling from source](#compiling-from-source)
* [Debugging a local build](#debugging-a-local-build)
* [Preparing a release](#preparing-a-release)
+ * [Using a custom Harmony build](#using-a-custom-harmony-build)
* [Release notes](#release-notes)
## Customisation
@@ -60,21 +61,18 @@ flag | purpose
## For SMAPI developers
### Compiling from source
-Using an official SMAPI release is recommended for most users.
+Using an official SMAPI release is recommended for most users, but you can compile from source
+directly if needed. There are no special steps (just open the project and compile), but SMAPI often
+uses the latest C# syntax. You may need the latest version of your IDE to compile it.
-SMAPI often uses the latest C# syntax. You may need the latest version of
-[Visual Studio](https://www.visualstudio.com/vs/community/) on Windows,
-[MonoDevelop](https://www.monodevelop.com/) on Linux,
-[Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/), or an equivalent IDE
-to compile it. It uses build configuration derived from the
-[crossplatform mod config](https://smapi.io/package/readme) to detect your current OS automatically
-and load the correct references. Compile output will be placed in a `bin` folder at the root of the
-git repository.
+SMAPI uses build configuration derived from the [crossplatform mod config](https://smapi.io/package/readme)
+to detect your current OS automatically and load the correct references. Compile output will be
+placed in a `bin` folder at the root of the Git repository.
### Debugging a local build
Rebuilding the solution in debug mode will copy the SMAPI files into your game folder. Starting
the `SMAPI` project with debugging from Visual Studio (on Mac or Windows) will launch SMAPI with
-the debugger attached, so you can intercept errors and step through the code being executed. This
+the debugger attached, so you can intercept errors and step through the code being executed. That
doesn't work in MonoDevelop on Linux, unfortunately.
### Preparing a release
@@ -87,9 +85,9 @@ on the wiki for the first-time setup.
build type | format | example
:--------- | :----------------------- | :------
- dev build | `<version>-alpha.<date>` | `3.0-alpha.20171230`
- prerelease | `<version>-beta.<count>` | `3.0-beta.2`
- release | `<version>` | `3.0`
+ dev build | `<version>-alpha.<date>` | `3.0.0-alpha.20171230`
+ prerelease | `<version>-beta.<count>` | `3.0.0-beta.2`
+ release | `<version>` | `3.0.0`
2. In Windows:
1. Rebuild the solution in Release mode.
@@ -103,5 +101,14 @@ 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.
+
## Release notes
See [release notes](../release-notes.md).
diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj
index 02f1763f..443d5baa 100644
--- a/src/SMAPI/SMAPI.csproj
+++ b/src/SMAPI/SMAPI.csproj
@@ -14,13 +14,14 @@
<ItemGroup>
<PackageReference Include="LargeAddressAware" Version="1.0.4" />
- <PackageReference Include="Lib.Harmony" Version="2.0.0.10" />
+ <PackageReference Include="Lib.Harmony" Version="2.0.0.10" 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.7" />
</ItemGroup>
<ItemGroup>
+ <Reference Include="..\..\build\0Harmony.dll" Private="True" Condition="Exists('..\..\build\0Harmony.dll')" />
<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" />