summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-01-07 17:55:15 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-01-07 17:55:15 -0500
commitd35f45fc3242d330a2021017054e932eff64f2ca (patch)
tree66ffae434f5136701c559018be981785446459a0
parent81d3baa3b516a41c4be79e833516f890b92e3dbb (diff)
downloadSMAPI-d35f45fc3242d330a2021017054e932eff64f2ca.tar.gz
SMAPI-d35f45fc3242d330a2021017054e932eff64f2ca.tar.bz2
SMAPI-d35f45fc3242d330a2021017054e932eff64f2ca.zip
fix game assemblies not excluded from release zip when bundle type not set
-rw-r--r--docs/technical/mod-package.md1
-rw-r--r--src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs23
2 files changed, 18 insertions, 6 deletions
diff --git a/docs/technical/mod-package.md b/docs/technical/mod-package.md
index 707b1641..0e710e50 100644
--- a/docs/technical/mod-package.md
+++ b/docs/technical/mod-package.md
@@ -414,6 +414,7 @@ when you compile it.
## Release notes
## Upcoming release
* Added `manifest.json` format validation on build (thanks to tylergibbs2!).
+* Fixed game assemblies no longer excluded from the release zip if referenced explicitly without setting `BundleExtraAssemblies`.
### 4.0.2
Released 09 October 2022.
diff --git a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
index 00f3f439..d47e492a 100644
--- a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
+++ b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
@@ -215,13 +215,24 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
return true;
}
- // check for bundled assembly types
- // When bundleAssemblyTypes is set, *all* dependencies are copied into the build output but only those which match the given assembly types should be bundled.
- if (bundleAssemblyTypes != ExtraAssemblyTypes.None)
+ // ignore by assembly type
+ ExtraAssemblyTypes type = this.GetExtraAssemblyType(file, modDllName);
+ switch (bundleAssemblyTypes)
{
- var type = this.GetExtraAssemblyType(file, modDllName);
- if (type != ExtraAssemblyTypes.None && !bundleAssemblyTypes.HasFlag(type))
- return true;
+ // Only explicitly-referenced assemblies are in the build output. These should be added to the zip,
+ // since it's possible the game won't load them (except game assemblies which will always be loaded
+ // separately). If they're already loaded, SMAPI will just ignore them.
+ case ExtraAssemblyTypes.None:
+ if (type is ExtraAssemblyTypes.Game)
+ return true;
+ break;
+
+ // All assemblies are in the build output (due to how .NET builds references), but only those which
+ // match the bundled type should be in the zip.
+ default:
+ if (type != ExtraAssemblyTypes.None && !bundleAssemblyTypes.HasFlag(type))
+ return true;
+ break;
}
return false;