summaryrefslogtreecommitdiff
path: root/src/SMAPI.ModBuildConfig
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.ModBuildConfig')
-rw-r--r--src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs114
-rw-r--r--src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs6
-rw-r--r--src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj (renamed from src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj)24
-rw-r--r--src/SMAPI.ModBuildConfig/build/smapi.targets234
-rw-r--r--src/SMAPI.ModBuildConfig/package.nuspec31
5 files changed, 200 insertions, 209 deletions
diff --git a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
index e03683d0..a852f133 100644
--- a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
+++ b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs
@@ -3,8 +3,9 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
-using StardewModdingAPI.Toolkit.Serialisation;
-using StardewModdingAPI.Toolkit.Serialisation.Models;
+using StardewModdingAPI.Toolkit.Serialization;
+using StardewModdingAPI.Toolkit.Serialization.Models;
+using StardewModdingAPI.Toolkit.Utilities;
namespace StardewModdingAPI.ModBuildConfig.Framework
{
@@ -40,47 +41,14 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
if (!Directory.Exists(targetDir))
throw new UserErrorException("Could not create mod package because no build output was found.");
- // project manifest
- bool hasProjectManifest = false;
- {
- FileInfo manifest = new FileInfo(Path.Combine(projectDir, "manifest.json"));
- if (manifest.Exists)
- {
- this.Files[this.ManifestFileName] = manifest;
- hasProjectManifest = true;
- }
- }
-
- // project i18n files
- bool hasProjectTranslations = false;
- DirectoryInfo translationsFolder = new DirectoryInfo(Path.Combine(projectDir, "i18n"));
- if (translationsFolder.Exists)
- {
- foreach (FileInfo file in translationsFolder.EnumerateFiles())
- this.Files[Path.Combine("i18n", file.Name)] = file;
- hasProjectTranslations = true;
- }
-
- // build output
- DirectoryInfo buildFolder = new DirectoryInfo(targetDir);
- foreach (FileInfo file in buildFolder.EnumerateFiles("*", SearchOption.AllDirectories))
+ // collect files
+ foreach (Tuple<string, FileInfo> entry in this.GetPossibleFiles(projectDir, targetDir))
{
- // get relative paths
- string relativePath = file.FullName.Replace(buildFolder.FullName, "");
- string relativeDirPath = file.Directory.FullName.Replace(buildFolder.FullName, "");
+ string relativePath = entry.Item1;
+ FileInfo file = entry.Item2;
- // prefer project manifest/i18n files
- if (hasProjectManifest && this.EqualsInvariant(relativePath, this.ManifestFileName))
- continue;
- if (hasProjectTranslations && this.EqualsInvariant(relativeDirPath, "i18n"))
- continue;
-
- // handle ignored files
- if (this.ShouldIgnore(file, relativePath, ignoreFilePatterns))
- continue;
-
- // add file
- this.Files[relativePath] = file;
+ if (!this.ShouldIgnore(file, relativePath, ignoreFilePatterns))
+ this.Files[relativePath] = file;
}
// check for required files
@@ -117,6 +85,67 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
/*********
** Private methods
*********/
+ /// <summary>Get all files to include in the mod folder, not accounting for ignore patterns.</summary>
+ /// <param name="projectDir">The folder containing the project files.</param>
+ /// <param name="targetDir">The folder containing the build output.</param>
+ /// <returns>Returns tuples containing the relative path within the mod folder, and the file to copy to it.</returns>
+ private IEnumerable<Tuple<string, FileInfo>> GetPossibleFiles(string projectDir, string targetDir)
+ {
+ // project manifest
+ bool hasProjectManifest = false;
+ {
+ FileInfo manifest = new FileInfo(Path.Combine(projectDir, this.ManifestFileName));
+ if (manifest.Exists)
+ {
+ yield return Tuple.Create(this.ManifestFileName, manifest);
+ hasProjectManifest = true;
+ }
+ }
+
+ // project i18n files
+ bool hasProjectTranslations = false;
+ DirectoryInfo translationsFolder = new DirectoryInfo(Path.Combine(projectDir, "i18n"));
+ if (translationsFolder.Exists)
+ {
+ foreach (FileInfo file in translationsFolder.EnumerateFiles())
+ yield return Tuple.Create(Path.Combine("i18n", file.Name), file);
+ hasProjectTranslations = true;
+ }
+
+ // project assets folder
+ bool hasAssetsFolder = false;
+ DirectoryInfo assetsFolder = new DirectoryInfo(Path.Combine(projectDir, "assets"));
+ if (assetsFolder.Exists)
+ {
+ foreach (FileInfo file in assetsFolder.EnumerateFiles("*", SearchOption.AllDirectories))
+ {
+ string relativePath = PathUtilities.GetRelativePath(projectDir, file.FullName);
+ yield return Tuple.Create(relativePath, file);
+ }
+ hasAssetsFolder = true;
+ }
+
+ // build output
+ DirectoryInfo buildFolder = new DirectoryInfo(targetDir);
+ foreach (FileInfo file in buildFolder.EnumerateFiles("*", SearchOption.AllDirectories))
+ {
+ // get path info
+ string relativePath = PathUtilities.GetRelativePath(buildFolder.FullName, file.FullName);
+ string[] segments = PathUtilities.GetSegments(relativePath);
+
+ // prefer project manifest/i18n/assets files
+ if (hasProjectManifest && this.EqualsInvariant(relativePath, this.ManifestFileName))
+ continue;
+ if (hasProjectTranslations && this.EqualsInvariant(segments[0], "i18n"))
+ continue;
+ if (hasAssetsFolder && this.EqualsInvariant(segments[0], "assets"))
+ continue;
+
+ // add file
+ yield return Tuple.Create(relativePath, file);
+ }
+ }
+
/// <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>
@@ -129,6 +158,7 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
// 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")
// code analysis files
@@ -148,6 +178,8 @@ namespace StardewModdingAPI.ModBuildConfig.Framework
/// <param name="other">The string to compare with.</param>
private bool EqualsInvariant(string str, string other)
{
+ if (str == null)
+ return other == null;
return str.Equals(other, StringComparison.InvariantCultureIgnoreCase);
}
}
diff --git a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs
deleted file mode 100644
index e051bfbd..00000000
--- a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-using System.Reflection;
-
-[assembly: AssemblyTitle("SMAPI.ModBuildConfig")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyVersion("2.2.0")]
-[assembly: AssemblyFileVersion("2.2.0")]
diff --git a/src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj
index 44f0a3e7..ccbd9a85 100644
--- a/src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj
+++ b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj
@@ -1,23 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
+ <AssemblyName>SMAPI.ModBuildConfig</AssemblyName>
<RootNamespace>StardewModdingAPI.ModBuildConfig</RootNamespace>
- <AssemblyName>StardewModdingAPI.ModBuildConfig</AssemblyName>
+ <Version>3.0.0</Version>
<TargetFramework>net45</TargetFramework>
- <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>latest</LangVersion>
<PlatformTarget>x86</PlatformTarget>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<ItemGroup>
- <ProjectReference Include="..\SMAPI.Toolkit\StardewModdingAPI.Toolkit.csproj" />
+ <ProjectReference Include="..\SMAPI.Toolkit\SMAPI.Toolkit.csproj" />
</ItemGroup>
<ItemGroup>
- <None Include="..\..\docs\mod-build-config.md">
- <Link>mod-build-config.md</Link>
- </None>
+ <None Include="..\..\build\find-game-folder.targets" Link="build\find-game-folder.targets" />
+ <None Include="..\..\docs\technical\mod-package.md" Link="mod-build-config.md" />
</ItemGroup>
<ItemGroup>
@@ -28,7 +27,20 @@
<Reference Include="System.Web.Extensions" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\docs\technical\mod-package.md">
+ <Link>mod-package.md</Link>
+ </None>
+ </ItemGroup>
+
+ <ItemGroup>
+ <None Update="assets\nuget-icon.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+
<Import Project="..\SMAPI.Internal\SMAPI.Internal.projitems" Label="Shared" />
<Import Project="..\..\build\common.targets" />
+ <Import Project="..\..\build\prepare-nuget-package.targets" />
</Project>
diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets
index e6c3fa57..5ca9f032 100644
--- a/src/SMAPI.ModBuildConfig/build/smapi.targets
+++ b/src/SMAPI.ModBuildConfig/build/smapi.targets
@@ -1,175 +1,113 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!--*********************************************
- ** Import build tasks
- **********************************************-->
- <UsingTask TaskName="DeployModTask" AssemblyFile="StardewModdingAPI.ModBuildConfig.dll" />
+
+ <Import Project="find-game-folder.targets" />
+ <UsingTask TaskName="DeployModTask" AssemblyFile="SMAPI.ModBuildConfig.dll" />
+
<!--*********************************************
- ** Find the basic mod metadata
+ ** Set build options
**********************************************-->
- <!-- import developer's custom settings (if any) -->
- <Import Condition="$(OS) != 'Windows_NT' AND Exists('$(HOME)\stardewvalley.targets')" Project="$(HOME)\stardewvalley.targets" />
- <Import Condition="$(OS) == 'Windows_NT' AND Exists('$(USERPROFILE)\stardewvalley.targets')" Project="$(USERPROFILE)\stardewvalley.targets" />
-
- <!-- set setting defaults -->
<PropertyGroup>
- <!-- map legacy settings -->
- <ModFolderName Condition="'$(ModFolderName)' == '' AND '$(DeployModFolderName)' != ''">$(DeployModFolderName)</ModFolderName>
- <ModZipPath Condition="'$(ModZipPath)' == '' AND '$(DeployModZipTo)' != ''">$(DeployModZipTo)</ModZipPath>
+ <!-- include PDB file by default to enable line numbers in stack traces -->
+ <DebugType>pdbonly</DebugType>
+ <DebugSymbols>true</DebugSymbols>
- <!-- set default settings -->
+ <!-- recognise XNA Framework DLLs in the GAC (only affects mods using new csproj format) -->
+ <AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
+
+ <!-- set default package options -->
<ModFolderName Condition="'$(ModFolderName)' == ''">$(MSBuildProjectName)</ModFolderName>
<ModZipPath Condition="'$(ModZipPath)' == ''">$(TargetDir)</ModZipPath>
- <EnableModDeploy Condition="'$(EnableModDeploy)' == ''">True</EnableModDeploy>
- <EnableModZip Condition="'$(EnableModZip)' == ''">True</EnableModZip>
- <CopyModReferencesToBuildOutput Condition="'$(CopyModReferencesToBuildOutput)' == ''">False</CopyModReferencesToBuildOutput>
+ <EnableModDeploy Condition="'$(EnableModDeploy)' == ''">true</EnableModDeploy>
+ <EnableModZip Condition="'$(EnableModZip)' == ''">true</EnableModZip>
+ <EnableHarmony Condition="'$(EnableModZip)' == ''">false</EnableHarmony>
+ <EnableGameDebugging Condition="$(EnableGameDebugging) == ''">true</EnableGameDebugging>
+ <CopyModReferencesToBuildOutput Condition="'$(CopyModReferencesToBuildOutput)' == '' OR ('$(CopyModReferencesToBuildOutput)' != 'true' AND '$(CopyModReferencesToBuildOutput)' != 'false')">false</CopyModReferencesToBuildOutput>
</PropertyGroup>
- <!-- find platform + game path -->
- <Choose>
- <When Condition="$(OS) == 'Unix' OR $(OS) == 'OSX'">
- <PropertyGroup>
- <!-- Linux -->
- <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/GOG Games/Stardew Valley/game</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/.steam/steam/steamapps/common/Stardew Valley</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/.local/share/Steam/steamapps/common/Stardew Valley</GamePath>
-
- <!-- Mac (may be 'Unix' or 'OSX') -->
- <GamePath Condition="!Exists('$(GamePath)')">/Applications/Stardew Valley.app/Contents/MacOS</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS</GamePath>
- </PropertyGroup>
- </When>
- <When Condition="$(OS) == 'Windows_NT'">
- <PropertyGroup>
- <!-- default paths -->
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files\GalaxyClient\Games\Stardew Valley</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files\GOG Galaxy\Games\Stardew Valley</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files\Steam\steamapps\common\Stardew Valley</GamePath>
-
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\GOG Galaxy\Games\Stardew Valley</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath>
-
- <!-- registry paths -->
- <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32))</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32))</GamePath>
-
- <!-- derive from Steam library path -->
- <_SteamLibraryPath>$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Valve\Steam', 'SteamPath', null, RegistryView.Registry32))</_SteamLibraryPath>
- <GamePath Condition="!Exists('$(GamePath)') AND '$(_SteamLibraryPath)' != ''">$(_SteamLibraryPath)\steamapps\common\Stardew Valley</GamePath>
- </PropertyGroup>
- </When>
- </Choose>
+ <PropertyGroup Condition="$(OS) == 'Windows_NT' AND $(EnableGameDebugging) == 'true'">
+ <!-- enable game debugging -->
+ <StartAction>Program</StartAction>
+ <StartProgram>$(GamePath)\StardewModdingAPI.exe</StartProgram>
+ <StartWorkingDirectory>$(GamePath)</StartWorkingDirectory>
+ </PropertyGroup>
<!--*********************************************
- ** Inject the assembly references and debugging configuration
+ ** Add assembly references
**********************************************-->
- <Choose>
- <When Condition="$(OS) == 'Windows_NT'">
- <!-- references -->
- <ItemGroup>
- <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="Netcode">
- <HintPath>$(GamePath)\Netcode.dll</HintPath>
- <Private>False</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="Stardew Valley">
- <HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="StardewModdingAPI">
- <HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="StardewModdingAPI.Toolkit.CoreInterfaces">
- <HintPath>$(GamePath)\smapi-internal\StardewModdingAPI.Toolkit.CoreInterfaces.dll</HintPath>
- <HintPath Condition="!Exists('$(GamePath)\smapi-internal')">$(GamePath)\StardewModdingAPI.Toolkit.CoreInterfaces.dll</HintPath>
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="xTile, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
- <HintPath>$(GamePath)\xTile.dll</HintPath>
- <Private>false</Private>
- <SpecificVersion>False</SpecificVersion>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- </ItemGroup>
-
- <!-- launch game for debugging -->
- <PropertyGroup>
- <StartAction>Program</StartAction>
- <StartProgram>$(GamePath)\StardewModdingAPI.exe</StartProgram>
- <StartWorkingDirectory>$(GamePath)</StartWorkingDirectory>
- </PropertyGroup>
- </When>
- <Otherwise>
- <!-- references -->
- <ItemGroup>
- <Reference Include="MonoGame.Framework">
- <HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
- <Private>false</Private>
- <SpecificVersion>False</SpecificVersion>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="StardewValley">
- <HintPath>$(GamePath)\StardewValley.exe</HintPath>
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="StardewModdingAPI">
- <HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="StardewModdingAPI.Toolkit.CoreInterfaces">
- <HintPath>$(GamePath)\smapi-internal\StardewModdingAPI.Toolkit.CoreInterfaces.dll</HintPath>
- <HintPath Condition="!Exists('$(GamePath)\smapi-internal')">$(GamePath)\StardewModdingAPI.Toolkit.CoreInterfaces.dll</HintPath>
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- <Reference Include="xTile">
- <HintPath>$(GamePath)\xTile.dll</HintPath>
- <Private>false</Private>
- <Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
- </Reference>
- </ItemGroup>
- </Otherwise>
- </Choose>
+ <!-- common -->
+ <ItemGroup>
+ <Reference Include="$(GameExecutableName)">
+ <HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="StardewValley.GameData">
+ <HintPath>$(GamePath)\StardewValley.GameData.dll</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="StardewModdingAPI">
+ <HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="SMAPI.Toolkit.CoreInterfaces">
+ <HintPath>$(GamePath)\smapi-internal\SMAPI.Toolkit.CoreInterfaces.dll</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="xTile">
+ <HintPath>$(GamePath)\xTile.dll</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="0Harmony" Condition="'$(EnableHarmony)' == 'true'">
+ <HintPath>$(GamePath)\smapi-internal\0Harmony.dll</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ </ItemGroup>
+
+ <!-- Windows -->
+ <ItemGroup Condition="$(OS) == 'Windows_NT'">
+ <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ <Reference Include="Netcode">
+ <HintPath>$(GamePath)\Netcode.dll</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ </ItemGroup>
+
+ <!-- Linux/Mac -->
+ <ItemGroup Condition="$(OS) != 'Windows_NT'">
+ <Reference Include="MonoGame.Framework">
+ <HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
+ <Private>$(CopyModReferencesToBuildOutput)</Private>
+ </Reference>
+ </ItemGroup>
<!--*********************************************
- ** Deploy mod files & create release zip after build
+ ** Show friendly error for invalid OS or game path
**********************************************-->
- <!-- if game path or OS is invalid, show one user-friendly error instead of a slew of reference errors -->
<Target Name="BeforeBuild">
<Error Condition="'$(OS)' != 'OSX' AND '$(OS)' != 'Unix' AND '$(OS)' != 'Windows_NT'" Text="The mod build package doesn't recognise OS type '$(OS)'." />
- <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/buildmsg/game-path." />
- <Error Condition="'$(OS)' == 'Windows_NT' AND !Exists('$(GamePath)\Stardew Valley.exe')" Text="The mod build package found a game folder at $(GamePath), but it doesn't contain the Stardew Valley.exe file. If this folder is invalid, delete it and the package will autodetect another game install path." />
- <Error Condition="'$(OS)' != 'Windows_NT' AND !Exists('$(GamePath)\StardewValley.exe')" Text="The mod build package found a game folder at $(GamePath), but it doesn't contain the StardewValley.exe file. If this folder is invalid, delete it and the package will autodetect another game install 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." />
+ <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." />
<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." />
</Target>
- <!-- deploy mod files & create release zip -->
+
+ <!--*********************************************
+ ** Deploy mod files & create release zip
+ **********************************************-->
<Target Name="AfterBuild">
<DeployModTask
ModFolderName="$(ModFolderName)"
diff --git a/src/SMAPI.ModBuildConfig/package.nuspec b/src/SMAPI.ModBuildConfig/package.nuspec
index 21693828..846f438d 100644
--- a/src/SMAPI.ModBuildConfig/package.nuspec
+++ b/src/SMAPI.ModBuildConfig/package.nuspec
@@ -2,20 +2,35 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Pathoschild.Stardew.ModBuildConfig</id>
- <version>2.2</version>
+ <version>3.0.0</version>
<title>Build package for SMAPI mods</title>
<authors>Pathoschild</authors>
<owners>Pathoschild</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
- <licenseUrl>https://github.com/Pathoschild/SMAPI/blob/develop/LICENSE.txt</licenseUrl>
- <projectUrl>https://github.com/Pathoschild/SMAPI/blob/develop/docs/mod-build-config.md#readme</projectUrl>
+ <license type="expression">MIT</license>
+ <repository type="git" url="https://github.com/Pathoschild/SMAPI" />
+ <projectUrl>https://smapi.io/package/readme</projectUrl>
+ <icon>images\icon.png</icon>
<iconUrl>https://raw.githubusercontent.com/Pathoschild/SMAPI/develop/src/SMAPI.ModBuildConfig/assets/nuget-icon.png</iconUrl>
- <description>Automates the build configuration for crossplatform Stardew Valley SMAPI mods. For Stardew Valley 1.3 or later.</description>
+ <description>Automates the build configuration for crossplatform Stardew Valley SMAPI mods. For SMAPI 3.0 or later.</description>
<releaseNotes>
- 2.2:
- - Added support for SMAPI 2.8+ (still compatible with earlier versions).
- - Added default game paths for 32-bit Windows.
- - Fixed valid manifests marked invalid in some cases.
+ 3.0.0:
+ - Updated for SMAPI 3.0 and Stardew Valley 1.4.
+ - Added automatic support for 'assets' folders.
+ - Added $(GameExecutableName) MSBuild variable.
+ - Added support for projects using the simplified .csproj format.
+ - 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.
+ - Migrated package icon to NuGet's new format.
</releaseNotes>
</metadata>
+ <files>
+ <file src="analyzers\**" target="analyzers" />
+ <file src="build\**" target="build" />
+ <file src="images\**" target="images" />
+ </files>
</package>