summaryrefslogtreecommitdiff
path: root/src/SMAPI.ModBuildConfig
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-11-30 17:12:49 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-11-30 17:12:49 -0500
commit919bbe94aa027c8a4ff8db4bdb50e8e2a28c48d9 (patch)
tree5c03ee1bd3cd658586755694940ac329491d6493 /src/SMAPI.ModBuildConfig
parent3ca6fb562417748c87567d6bb6915d56b2c1b57c (diff)
parentd1d09ae1df63826dd453aa0347d668f420754ed7 (diff)
downloadSMAPI-919bbe94aa027c8a4ff8db4bdb50e8e2a28c48d9.tar.gz
SMAPI-919bbe94aa027c8a4ff8db4bdb50e8e2a28c48d9.tar.bz2
SMAPI-919bbe94aa027c8a4ff8db4bdb50e8e2a28c48d9.zip
Merge branch 'beta' into develop
Diffstat (limited to 'src/SMAPI.ModBuildConfig')
-rw-r--r--src/SMAPI.ModBuildConfig/DeployModTask.cs64
-rw-r--r--src/SMAPI.ModBuildConfig/Framework/ExtraAssemblyType.cs21
-rw-r--r--src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs126
-rw-r--r--src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj16
-rw-r--r--src/SMAPI.ModBuildConfig/build/smapi.targets59
5 files changed, 216 insertions, 70 deletions
diff --git a/src/SMAPI.ModBuildConfig/DeployModTask.cs b/src/SMAPI.ModBuildConfig/DeployModTask.cs
index 9ee6be12..140933bd 100644
--- a/src/SMAPI.ModBuildConfig/DeployModTask.cs
+++ b/src/SMAPI.ModBuildConfig/DeployModTask.cs
@@ -8,6 +8,7 @@ using System.Text.RegularExpressions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using StardewModdingAPI.ModBuildConfig.Framework;
+using StardewModdingAPI.Toolkit.Utilities;
namespace StardewModdingAPI.ModBuildConfig
{
@@ -17,6 +18,10 @@ namespace StardewModdingAPI.ModBuildConfig
/*********
** Accessors
*********/
+ /// <summary>The name (without extension or path) of the current mod's DLL.</summary>
+ [Required]
+ public string ModDllName { get; set; }
+
/// <summary>The name of the mod folder.</summary>
[Required]
public string ModFolderName { get; set; }
@@ -45,9 +50,15 @@ namespace StardewModdingAPI.ModBuildConfig
[Required]
public bool EnableModZip { get; set; }
- /// <summary>Custom comma-separated regex patterns matching files to ignore when deploying or zipping the mod.</summary>
+ /// <summary>A comma-separated list of regex patterns matching files to ignore when deploying or zipping the mod.</summary>
public string IgnoreModFilePatterns { get; set; }
+ /// <summary>A comma-separated list of relative file paths to ignore when deploying or zipping the mod.</summary>
+ public string IgnoreModFilePaths { get; set; }
+
+ /// <summary>A comma-separated list of <see cref="ExtraAssemblyTypes"/> values which indicate which extra DLLs to bundle.</summary>
+ public string BundleExtraAssemblies { get; set; }
+
/*********
** Public methods
@@ -69,11 +80,15 @@ namespace StardewModdingAPI.ModBuildConfig
try
{
+ // parse extra DLLs to bundle
+ ExtraAssemblyTypes bundleAssemblyTypes = this.GetExtraAssembliesToBundleOption();
+
// parse ignore patterns
+ string[] ignoreFilePaths = this.GetCustomIgnoreFilePaths().ToArray();
Regex[] ignoreFilePatterns = this.GetCustomIgnorePatterns().ToArray();
// get mod info
- ModFileManager package = new ModFileManager(this.ProjectDir, this.TargetDir, ignoreFilePatterns, validateRequiredModFiles: this.EnableModDeploy || this.EnableModZip);
+ ModFileManager package = new ModFileManager(this.ProjectDir, this.TargetDir, ignoreFilePaths, ignoreFilePatterns, bundleAssemblyTypes, this.ModDllName, validateRequiredModFiles: this.EnableModDeploy || this.EnableModZip);
// deploy mod files
if (this.EnableModDeploy)
@@ -134,6 +149,28 @@ namespace StardewModdingAPI.ModBuildConfig
}
}
+ /// <summary>Parse the extra assembly types which should be bundled with the mod.</summary>
+ private ExtraAssemblyTypes GetExtraAssembliesToBundleOption()
+ {
+ ExtraAssemblyTypes flags = ExtraAssemblyTypes.None;
+
+ if (!string.IsNullOrWhiteSpace(this.BundleExtraAssemblies))
+ {
+ foreach (string raw in this.BundleExtraAssemblies.Split(','))
+ {
+ if (!Enum.TryParse(raw, out ExtraAssemblyTypes type))
+ {
+ this.Log.LogWarning($"[mod build package] Ignored invalid <{nameof(this.BundleExtraAssemblies)}> value '{raw}', expected one of '{string.Join("', '", Enum.GetNames(typeof(ExtraAssemblyTypes)))}'.");
+ continue;
+ }
+
+ flags |= type;
+ }
+ }
+
+ return flags;
+ }
+
/// <summary>Get the custom ignore patterns provided by the user.</summary>
private IEnumerable<Regex> GetCustomIgnorePatterns()
{
@@ -157,6 +194,29 @@ namespace StardewModdingAPI.ModBuildConfig
}
}
+ /// <summary>Get the custom relative file paths provided by the user to ignore.</summary>
+ private IEnumerable<string> GetCustomIgnoreFilePaths()
+ {
+ if (string.IsNullOrWhiteSpace(this.IgnoreModFilePaths))
+ yield break;
+
+ foreach (string raw in this.IgnoreModFilePaths.Split(','))
+ {
+ string path;
+ try
+ {
+ path = PathUtilities.NormalizePath(raw);
+ }
+ catch (Exception ex)
+ {
+ this.Log.LogWarning($"[mod build package] Ignored invalid <{nameof(this.IgnoreModFilePaths)}> path {raw}:\n{ex}");
+ continue;
+ }
+
+ yield return path;
+ }
+ }
+
/// <summary>Copy the mod files into the game's mod folder.</summary>
/// <param name="files">The files to include.</param>
/// <param name="modFolderPath">The folder path to create with the mod files.</param>
diff --git a/src/SMAPI.ModBuildConfig/Framework/ExtraAssemblyType.cs b/src/SMAPI.ModBuildConfig/Framework/ExtraAssemblyType.cs
new file mode 100644
index 00000000..571bf7c7
--- /dev/null
+++ b/src/SMAPI.ModBuildConfig/Framework/ExtraAssemblyType.cs
@@ -0,0 +1,21 @@
+using System;
+
+namespace StardewModdingAPI.ModBuildConfig.Framework
+{
+ /// <summary>An extra assembly type for the <see cref="DeployModTask.BundleExtraAssemblies"/> field.</summary>
+ [Flags]
+ internal enum ExtraAssemblyTypes
+ {
+ /// <summary>Don't include extra assemblies.</summary>
+ None = 0,
+
+ /// <summary>Assembly files which are part of MonoGame, SMAPI, or Stardew Valley.</summary>
+ Game = 1,
+
+ /// <summary>Assembly files whose names start with <c>Microsoft.*</c> or <c>System.*</c>.</summary>
+ System = 2,
+
+ /// <summary>Assembly files which don't match any other category.</summary>
+ ThirdParty = 4
+ }
+}
diff --git a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
index 6dd595e5..ad4ffdf9 100644
--- a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
+++ b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
@@ -21,6 +21,45 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
/// <summary>The files that are part of the package.</summary>
private readonly IDictionary<string, FileInfo> Files;
+ /// <summary>The file extensions used by assembly files.</summary>
+ private readonly ISet<string> AssemblyFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
+ {
+ ".dll",
+ ".exe",
+ ".pdb",
+ ".xml"
+ };
+
+ /// <summary>The DLLs which match the <see cref="ExtraAssemblyTypes.Game"/> type.</summary>
+ private readonly ISet<string> GameDllNames = new HashSet<string>
+ {
+ // SMAPI
+ "0Harmony",
+ "Mono.Cecil",
+ "Mono.Cecil.Mdb",
+ "Mono.Cecil.Pdb",
+ "MonoMod.Common",
+ "Newtonsoft.Json",
+ "StardewModdingAPI",
+ "SMAPI.Toolkit",
+ "SMAPI.Toolkit.CoreInterfaces",
+ "TMXTile",
+
+ // game + framework
+ "BmFont",
+ "FAudio-CS",
+ "GalaxyCSharp",
+ "GalaxyCSharpGlue",
+ "Lidgren.Network",
+ "MonoGame.Framework",
+ "SkiaSharp",
+ "Stardew Valley",
+ "StardewValley.GameData",
+ "Steamworks.NET",
+ "TextCopy",
+ "xTile"
+ };
+
/*********
** Public methods
@@ -28,10 +67,13 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
/// <summary>Construct an instance.</summary>
/// <param name="projectDir">The folder containing the project files.</param>
/// <param name="targetDir">The folder containing the build output.</param>
+ /// <param name="ignoreFilePaths">The custom relative file paths provided by the user to ignore.</param>
/// <param name="ignoreFilePatterns">Custom regex patterns matching files to ignore when deploying or zipping the mod.</param>
+ /// <param name="bundleAssemblyTypes">The extra assembly types which should be bundled with the mod.</param>
+ /// <param name="modDllName">The name (without extension or path) for the current mod's DLL.</param>
/// <param name="validateRequiredModFiles">Whether to validate that required mod files like the manifest are present.</param>
/// <exception cref="UserErrorException">The mod package isn't valid.</exception>
- public ModFileManager(string projectDir, string targetDir, Regex[] ignoreFilePatterns, bool validateRequiredModFiles)
+ public ModFileManager(string projectDir, string targetDir, string[] ignoreFilePaths, Regex[] ignoreFilePatterns, ExtraAssemblyTypes bundleAssemblyTypes, string modDllName, bool validateRequiredModFiles)
{
this.Files = new Dictionary<string, FileInfo>(StringComparer.OrdinalIgnoreCase);
@@ -47,7 +89,7 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
string relativePath = entry.Item1;
FileInfo file = entry.Item2;
- if (!this.ShouldIgnore(file, relativePath, ignoreFilePatterns))
+ if (!this.ShouldIgnore(file, relativePath, ignoreFilePaths, ignoreFilePatterns, bundleAssemblyTypes, modDllName))
this.Files[relativePath] = file;
}
@@ -149,36 +191,72 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
/// <summary>Get whether a build output file should be ignored.</summary>
/// <param name="file">The file to check.</param>
/// <param name="relativePath">The file's relative path in the package.</param>
+ /// <param name="ignoreFilePaths">The custom relative file paths provided by the user to ignore.</param>
/// <param name="ignoreFilePatterns">Custom regex patterns matching files to ignore when deploying or zipping the mod.</param>
- private bool ShouldIgnore(FileInfo file, string relativePath, Regex[] ignoreFilePatterns)
+ /// <param name="bundleAssemblyTypes">The extra assembly types which should be bundled with the mod.</param>
+ /// <param name="modDllName">The name (without extension or path) for the current mod's DLL.</param>
+ private bool ShouldIgnore(FileInfo file, string relativePath, string[] ignoreFilePaths, Regex[] ignoreFilePatterns, ExtraAssemblyTypes bundleAssemblyTypes, string modDllName)
{
- return
- // release zips
- this.EqualsInvariant(file.Extension, ".zip")
+ // apply custom patterns
+ if (ignoreFilePaths.Any(p => p == relativePath) || ignoreFilePatterns.Any(p => p.IsMatch(relativePath)))
+ return true;
+
+ // ignore unneeded files
+ {
+ bool shouldIgnore =
+ // release zips
+ this.EqualsInvariant(file.Extension, ".zip")
+
+ // *.deps.json (only SMAPI's top-level one is used)
+ || file.Name.EndsWith(".deps.json")
+
+ // code analysis files
+ || file.Name.EndsWith(".CodeAnalysisLog.xml", StringComparison.OrdinalIgnoreCase)
+ || file.Name.EndsWith(".lastcodeanalysissucceeded", StringComparison.OrdinalIgnoreCase)
- // Harmony (bundled into SMAPI)
- || this.EqualsInvariant(file.Name, "0Harmony.dll")
+ // translation class builder (not used at runtime)
+ || (
+ file.Name.StartsWith("Pathoschild.Stardew.ModTranslationClassBuilder")
+ && this.AssemblyFileExtensions.Contains(file.Extension)
+ )
- // Json.NET (bundled into SMAPI)
- || this.EqualsInvariant(file.Name, "Newtonsoft.Json.dll")
- || this.EqualsInvariant(file.Name, "Newtonsoft.Json.pdb")
- || this.EqualsInvariant(file.Name, "Newtonsoft.Json.xml")
+ // OS metadata files
+ || this.EqualsInvariant(file.Name, ".DS_Store")
+ || this.EqualsInvariant(file.Name, "Thumbs.db");
+ if (shouldIgnore)
+ 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)
+ {
+ var type = this.GetExtraAssemblyType(file, modDllName);
+ if (type != ExtraAssemblyTypes.None && !bundleAssemblyTypes.HasFlag(type))
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>Get the extra assembly type for a file, assuming that the user specified one or more extra types to bundle.</summary>
+ /// <param name="file">The file to check.</param>
+ /// <param name="modDllName">The name (without extension or path) for the current mod's DLL.</param>
+ private ExtraAssemblyTypes GetExtraAssemblyType(FileInfo file, string modDllName)
+ {
+ string baseName = Path.GetFileNameWithoutExtension(file.Name);
+ string extension = file.Extension;
- // mod translation class builder (not used at runtime)
- || this.EqualsInvariant(file.Name, "Pathoschild.Stardew.ModTranslationClassBuilder.dll")
- || this.EqualsInvariant(file.Name, "Pathoschild.Stardew.ModTranslationClassBuilder.pdb")
- || this.EqualsInvariant(file.Name, "Pathoschild.Stardew.ModTranslationClassBuilder.xml")
+ if (baseName == modDllName || !this.AssemblyFileExtensions.Contains(extension))
+ return ExtraAssemblyTypes.None;
- // code analysis files
- || file.Name.EndsWith(".CodeAnalysisLog.xml", StringComparison.OrdinalIgnoreCase)
- || file.Name.EndsWith(".lastcodeanalysissucceeded", StringComparison.OrdinalIgnoreCase)
+ if (this.GameDllNames.Contains(baseName))
+ return ExtraAssemblyTypes.Game;
- // OS metadata files
- || this.EqualsInvariant(file.Name, ".DS_Store")
- || this.EqualsInvariant(file.Name, "Thumbs.db")
+ if (baseName.StartsWith("System.", StringComparison.OrdinalIgnoreCase) || baseName.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase))
+ return ExtraAssemblyTypes.System;
- // custom ignore patterns
- || ignoreFilePatterns.Any(p => p.IsMatch(relativePath));
+ return ExtraAssemblyTypes.ThirdParty;
}
/// <summary>Get whether a string is equal to another case-insensitively.</summary>
diff --git a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj
index 93769650..0bc8c45e 100644
--- a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj
+++ b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj
@@ -2,28 +2,28 @@
<PropertyGroup>
<!--build-->
<RootNamespace>StardewModdingAPI.ModBuildConfig</RootNamespace>
- <TargetFramework>net452</TargetFramework>
+ <TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<!--NuGet package-->
<PackageId>Pathoschild.Stardew.ModBuildConfig</PackageId>
<Title>Build package for SMAPI mods</Title>
- <Version>3.3.0</Version>
+ <Version>4.0.0</Version>
<Authors>Pathoschild</Authors>
- <Description>Automates the build configuration for crossplatform Stardew Valley SMAPI mods. For SMAPI 3.0 or later.</Description>
+ <Description>Automates the build configuration for crossplatform Stardew Valley SMAPI mods. For SMAPI 3.13.0 or later.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>images/icon.png</PackageIcon>
<PackageProjectUrl>https://smapi.io/package/readme</PackageProjectUrl>
<IncludeBuildOutput>false</IncludeBuildOutput>
+
+ <!--copy dependency DLLs to bin folder so we can include them in package -->
+ <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Microsoft.Build" />
- <Reference Include="Microsoft.Build.Framework" />
- <Reference Include="Microsoft.Build.Utilities.v4.0" />
- <Reference Include="System.IO.Compression" />
- <Reference Include="System.Web.Extensions" />
+ <PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.10" />
+ <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<ItemGroup>
diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets
index 698765ad..b66ec27b 100644
--- a/src/SMAPI.ModBuildConfig/build/smapi.targets
+++ b/src/SMAPI.ModBuildConfig/build/smapi.targets
@@ -12,8 +12,8 @@
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
- <!-- recognise XNA Framework DLLs in the GAC (only affects mods using new csproj format) -->
- <AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
+ <!-- don't create the 'refs' folder (which isn't useful for mods) -->
+ <ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<!-- suppress processor architecture mismatch warning (mods should be compiled in 'Any CPU' so they work in both 32-bit and 64-bit mode) -->
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
@@ -26,10 +26,10 @@
<EnableModZip Condition="'$(EnableModZip)' == ''">true</EnableModZip>
<EnableHarmony Condition="'$(EnableHarmony)' == ''">false</EnableHarmony>
<EnableGameDebugging Condition="'$(EnableGameDebugging)' == ''">true</EnableGameDebugging>
- <CopyModReferencesToBuildOutput Condition="'$(CopyModReferencesToBuildOutput)' == '' OR ('$(CopyModReferencesToBuildOutput)' != 'true' AND '$(CopyModReferencesToBuildOutput)' != 'false')">false</CopyModReferencesToBuildOutput>
+ <BundleExtraAssemblies Condition="'$(BundleExtraAssemblies)' == ''"></BundleExtraAssemblies>
- <GameFramework Condition="'$(GameFramework)' == '' AND '$(OS)' == 'Windows_NT'">Xna</GameFramework>
- <GameFramework Condition="'$(GameFramework)' == ''">MonoGame</GameFramework>
+ <!-- coppy referenced DLLs into build output -->
+ <CopyLocalLockFileAssemblies Condition="$(BundleExtraAssemblies.Contains('ThirdParty')) OR $(BundleExtraAssemblies.Contains('Game')) OR $(BundleExtraAssemblies.Contains('System')) OR $(BundleExtraAssemblies.Contains('All'))">true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT' AND '$(EnableGameDebugging)' == 'true'">
@@ -43,38 +43,21 @@
<!--*********************************************
** Add assembly references
**********************************************-->
- <!-- common -->
<ItemGroup>
- <Reference Include="$(GameExecutableName)" HintPath="$(GamePath)\$(GameExecutableName).exe" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="StardewValley.GameData" HintPath="$(GamePath)\StardewValley.GameData.dll" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="StardewModdingAPI" HintPath="$(GamePath)\StardewModdingAPI.exe" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="SMAPI.Toolkit.CoreInterfaces" HintPath="$(GamePath)\smapi-internal\SMAPI.Toolkit.CoreInterfaces.dll" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="xTile" HintPath="$(GamePath)\xTile.dll" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="0Harmony" Condition="'$(EnableHarmony)' == 'true'" HintPath="$(GamePath)\smapi-internal\0Harmony.dll" Private="$(CopyModReferencesToBuildOutput)" />
+ <!-- game -->
+ <Reference Include="Stardew Valley" HintPath="$(GamePath)\Stardew Valley.dll" Private="$(BundleExtraAssemblies.Contains('Game'))" />
+ <Reference Include="StardewValley.GameData" HintPath="$(GamePath)\StardewValley.GameData.dll" Private="$(BundleExtraAssemblies.Contains('Game'))" />
+ <Reference Include="MonoGame.Framework" HintPath="$(GamePath)\MonoGame.Framework.dll" Private="$(BundleExtraAssemblies.Contains('Game'))" />
+ <Reference Include="xTile" HintPath="$(GamePath)\xTile.dll" Private="$(BundleExtraAssemblies.Contains('Game'))" />
+
+ <!-- SMAPI -->
+ <Reference Include="StardewModdingAPI" HintPath="$(GamePath)\StardewModdingAPI.dll" Private="$(BundleExtraAssemblies.Contains('Game'))" />
+ <Reference Include="SMAPI.Toolkit.CoreInterfaces" HintPath="$(GamePath)\smapi-internal\SMAPI.Toolkit.CoreInterfaces.dll" Private="$(BundleExtraAssemblies.Contains('Game'))" />
+
+ <!-- Harmony -->
+ <Reference Include="0Harmony" Condition="'$(EnableHarmony)' == 'true'" HintPath="$(GamePath)\smapi-internal\0Harmony.dll" Private="$(BundleExtraAssemblies.Contains('Game'))" />
</ItemGroup>
- <!-- Windows only -->
- <ItemGroup Condition="'$(OS)' == 'Windows_NT'">
- <Reference Include="Netcode" HintPath="$(GamePath)\Netcode.dll" Private="$(CopyModReferencesToBuildOutput)" />
- </ItemGroup>
-
- <!-- Game framework -->
- <Choose>
- <When Condition="'$(GameFramework)' == 'Xna'">
- <ItemGroup>
- <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="$(CopyModReferencesToBuildOutput)" />
- <Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="$(CopyModReferencesToBuildOutput)" />
- </ItemGroup>
- </When>
- <Otherwise>
- <ItemGroup>
- <Reference Include="MonoGame.Framework" HintPath="$(GamePath)\MonoGame.Framework.dll" Private="$(CopyModReferencesToBuildOutput)" />
- </ItemGroup>
- </Otherwise>
- </Choose>
-
<!--*********************************************
** Show validation messages
@@ -85,8 +68,8 @@
<!-- invalid game path -->
<Error Condition="!Exists('$(GamePath)')" Text="The mod build package can't find your game folder. You can specify where to find it; see https://smapi.io/package/custom-game-path." ContinueOnError="false" />
- <Error Condition="!Exists('$(GamePath)\$(GameExecutableName).exe')" Text="The mod build package found a game folder at $(GamePath), but it doesn't contain the $(GameExecutableName) file. If this folder is invalid, delete it and the package will autodetect another game install path." ContinueOnError="false" />
- <Error Condition="!Exists('$(GamePath)\StardewModdingAPI.exe')" Text="The mod build package found a game folder at $(GamePath), but it doesn't contain SMAPI. You need to install SMAPI before building the mod." ContinueOnError="false" />
+ <Error Condition="!Exists('$(GamePath)\Stardew Valley.dll')" Text="The mod build package found a game folder at $(GamePath), but it doesn't contain the Stardew Valley file. If this folder is invalid, delete it and the package will autodetect another game install path." ContinueOnError="false" />
+ <Error Condition="!Exists('$(GamePath)\StardewModdingAPI.dll')" Text="The mod build package found a game folder at $(GamePath), but it doesn't contain SMAPI. You need to install SMAPI before building the mod." ContinueOnError="false" />
<!-- invalid target architecture (note: internal value is 'AnyCPU', value shown in Visual Studio is 'Any CPU') -->
<Warning Condition="'$(Platform)' != 'AnyCPU'" Text="The target platform should be set to 'Any CPU' for compatibility with both 32-bit and 64-bit versions of Stardew Valley (currently set to '$(Platform)'). See https://smapi.io/package/wrong-processor-architecture for details." HelpLink="https://smapi.io/package/wrong-processor-architecture" />
@@ -98,6 +81,7 @@
**********************************************-->
<Target Name="AfterBuild">
<DeployModTask
+ ModDllName="$(TargetName)"
ModFolderName="$(ModFolderName)"
ModZipPath="$(ModZipPath)"
@@ -108,6 +92,9 @@
TargetDir="$(TargetDir)"
GameModsDir="$(GameModsPath)"
IgnoreModFilePatterns="$(IgnoreModFilePatterns)"
+ IgnoreModFilePaths="$(IgnoreModFilePaths)"
+
+ BundleExtraAssemblies="$(BundleExtraAssemblies)"
/>
</Target>
</Project>