From af68910685326a660cc88cd92582b38cbc0d9b2f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 8 Oct 2017 00:20:13 -0400 Subject: convert mod build config into .NET project to simplify C# build tasks --- src/ModBuildConfig/README.md | 121 --------- src/ModBuildConfig/assets/nuget-icon.pdn | Bin 7401 -> 0 bytes src/ModBuildConfig/assets/nuget-icon.png | Bin 5054 -> 0 bytes src/ModBuildConfig/build/smapi.targets | 273 --------------------- src/ModBuildConfig/package.nuspec | 22 -- src/ModBuildConfig/release-notes.md | 28 --- .../Properties/AssemblyInfo.cs | 9 + src/SMAPI.ModBuildConfig/README.md | 121 +++++++++ .../StardewModdingAPI.ModBuildConfig.csproj | 49 ++++ src/SMAPI.ModBuildConfig/assets/nuget-icon.pdn | Bin 0 -> 7401 bytes src/SMAPI.ModBuildConfig/assets/nuget-icon.png | Bin 0 -> 5054 bytes src/SMAPI.ModBuildConfig/build/smapi.targets | 273 +++++++++++++++++++++ src/SMAPI.ModBuildConfig/package.nuspec | 22 ++ src/SMAPI.ModBuildConfig/release-notes.md | 28 +++ src/SMAPI.sln | 12 + 15 files changed, 514 insertions(+), 444 deletions(-) delete mode 100644 src/ModBuildConfig/README.md delete mode 100644 src/ModBuildConfig/assets/nuget-icon.pdn delete mode 100644 src/ModBuildConfig/assets/nuget-icon.png delete mode 100644 src/ModBuildConfig/build/smapi.targets delete mode 100644 src/ModBuildConfig/package.nuspec delete mode 100644 src/ModBuildConfig/release-notes.md create mode 100644 src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs create mode 100644 src/SMAPI.ModBuildConfig/README.md create mode 100644 src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj create mode 100644 src/SMAPI.ModBuildConfig/assets/nuget-icon.pdn create mode 100644 src/SMAPI.ModBuildConfig/assets/nuget-icon.png create mode 100644 src/SMAPI.ModBuildConfig/build/smapi.targets create mode 100644 src/SMAPI.ModBuildConfig/package.nuspec create mode 100644 src/SMAPI.ModBuildConfig/release-notes.md (limited to 'src') diff --git a/src/ModBuildConfig/README.md b/src/ModBuildConfig/README.md deleted file mode 100644 index c261e705..00000000 --- a/src/ModBuildConfig/README.md +++ /dev/null @@ -1,121 +0,0 @@ -**Stardew.ModBuildConfig** is an open-source NuGet package which automates the build configuration -for [Stardew Valley](http://stardewvalley.net/) [SMAPI](https://github.com/Pathoschild/SMAPI) mods. - -The package... - -* lets you write your mod once, and compile it on any computer. It detects the current platform - (Linux, Mac, or Windows) and game install path, and injects the right references automatically. -* configures Visual Studio so you can debug into the mod code when the game is running (_Windows - only_). -* packages the mod automatically into the game's mod folder when you build the code (_optional_). - -## Contents -* [Install](#install) -* [Simplify mod development](#simplify-mod-development) -* [Troubleshoot](#troubleshoot) -* [Versions](#versions) - -## Install -**When creating a new mod:** - -1. Create an empty library project. -2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). -3. [Write your code](http://canimod.com/guides/creating-a-smapi-mod). -4. Compile on any platform. - -**When migrating an existing mod:** - -1. Remove any project references to `Microsoft.Xna.*`, `MonoGame`, Stardew Valley, - `StardewModdingAPI`, and `xTile`. -2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). -3. Compile on any platform. - -## Simplify mod development -### Package your mod into the game folder automatically -You can copy your mod files into the `Mods` folder automatically each time you build, so you don't -need to do it manually: - -1. Edit your mod's `.csproj` file. -2. Add this block above the first `` line: - - ```xml - $(MSBuildProjectName) - ``` - -That's it! Each time you build, the files in `\Mods\` will be updated with -your `manifest.json`, build output, and any `i18n` files. - -Notes: -* To add custom files, just [add them to the build output](https://stackoverflow.com/a/10828462/262123). -* To customise the folder name, just replace `$(MSBuildProjectName)` with the folder name you want. -* If your project references another mod, make sure the reference is [_not_ marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx). - -### Debug into the mod code (Windows-only) -Stepping into your mod code when the game is running is straightforward, since this package injects -the configuration automatically. To do it: - -1. [Package your mod into the game folder automatically](#package-your-mod-into-the-game-folder-automatically). -2. Launch the project with debugging in Visual Studio or MonoDevelop. - -This will deploy your mod files into the game folder, launch SMAPI, and attach a debugger -automatically. Now you can step through your code, set breakpoints, etc. - -### Create release zips automatically (Windows-only) -You can create the mod package automatically when you build: - -1. Edit your mod's `.csproj` file. -2. Add this block above the first `` line: - - ```xml - $(SolutionDir)\_releases - ``` - -That's it! Each time you build, the mod files will be zipped into `_releases\.zip`. (You -can change the value to save the zips somewhere else.) - -## Troubleshoot -### "Failed to find the game install path" -That error means the package couldn't figure out where the game is installed. You need to specify -the game location yourself. There's two ways to do that: - -* **Option 1: set the path globally.** - _This will apply to every project that uses version 1.5+ of package._ - - 1. Get the full folder path containing the Stardew Valley executable. - 2. Create this file path: - - platform | path - --------- | ---- - Linux/Mac | `~/stardewvalley.targets` - Windows | `%USERPROFILE%\stardewvalley.targets` - - 3. Save the file with this content: - - ```xml - - - PATH_HERE - - - ``` - - 4. Replace `PATH_HERE` with your custom game install path. - -* **Option 2: set the path in the project file.** - _(You'll need to do it for every project that uses the package.)_ - 1. Get the folder path containing the Stardew Valley `.exe` file. - 2. Add this to your `.csproj` file under the ` - PATH_HERE - - ``` - - 3. Replace `PATH_HERE` with your custom game install path. - -The configuration will check your custom path first, then fall back to the default paths (so it'll -still compile on a different computer). - -## Versions -See [release notes](release-notes.md). diff --git a/src/ModBuildConfig/assets/nuget-icon.pdn b/src/ModBuildConfig/assets/nuget-icon.pdn deleted file mode 100644 index 7bd5c0c5..00000000 Binary files a/src/ModBuildConfig/assets/nuget-icon.pdn and /dev/null differ diff --git a/src/ModBuildConfig/assets/nuget-icon.png b/src/ModBuildConfig/assets/nuget-icon.png deleted file mode 100644 index 611cdf88..00000000 Binary files a/src/ModBuildConfig/assets/nuget-icon.png and /dev/null differ diff --git a/src/ModBuildConfig/build/smapi.targets b/src/ModBuildConfig/build/smapi.targets deleted file mode 100644 index a1b6aab3..00000000 --- a/src/ModBuildConfig/build/smapi.targets +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - - - - - - - A build task which packs mod files into a conventional release zip. - public class CreateModReleaseZip : Task, ITask - { - /********* - ** Accessors - *********/ - /// The mod files to pack. - public ITaskItem[] Files { get; set; } - - /// The name of the mod. - public string ModName { get; set; } - - /// The absolute or relative path to the folder which should contain the generated zip file. - public string OutputFolderPath { get; set; } - - - /********* - ** Public methods - *********/ - public override bool Execute() - { - try - { - // create output path if needed - Directory.CreateDirectory(OutputFolderPath); - - // get zip filename - string fileName = string.Format("{0}-{1}.zip", this.ModName, this.GetManifestVersion()); - - // clear old zip file if present - string zipPath = Path.Combine(OutputFolderPath, fileName); - if (File.Exists(zipPath)) - File.Delete(zipPath); - - // create zip file - using (Stream zipStream = new FileStream(zipPath, FileMode.Create, FileAccess.Write)) - using (ZipArchive archive = new ZipArchive(zipStream, ZipArchiveMode.Create)) - { - foreach (ITaskItem file in Files) - { - // get file info - string filePath = file.ItemSpec; - string entryName = ModName + '/' + file.GetMetadata("RecursiveDir") + file.GetMetadata("Filename") + file.GetMetadata("Extension"); - if (new FileInfo(filePath).Directory.Name.Equals("i18n", StringComparison.InvariantCultureIgnoreCase)) - entryName = Path.Combine("i18n", entryName); - - // add to zip - using (Stream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) - using (Stream fileStreamInZip = archive.CreateEntry(entryName).Open()) - { - fileStream.CopyTo(fileStreamInZip); - } - } - } - - return true; - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return false; - } - } - - /// Get a semantic version from the mod manifest (if available). - public string GetManifestVersion() - { - // Get the file JSON string - string json = ""; - foreach(ITaskItem file in Files) - { - if(Path.GetFileName(file.ItemSpec).ToLower() != "manifest.json") - continue; - json = File.ReadAllText(file.ItemSpec); - break; - } - - // Serialize the manifest json into a data object, then get a version object from that. - IDictionary data = (IDictionary)new JavaScriptSerializer().DeserializeObject(json); - IDictionary version = (IDictionary)data["Version"]; - - // Store our version numbers for ease of use - int major = (int)version["MajorVersion"]; - int minor = (int)version["MinorVersion"]; - int patch = (int)version["PatchVersion"]; - - return String.Format("{0}.{1}.{2}", major, minor, patch); - } - } - ]]> - - - - - - - - - - - - - - - - $(HOME)/GOG Games/Stardew Valley/game - $(HOME)/.local/share/Steam/steamapps/common/Stardew Valley - - - /Applications/Stardew Valley.app/Contents/MacOS - $(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS - - - - - C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley - C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley - $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32)) - $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32)) - - - - - - - - - - - - false - - - false - - - false - - - false - - - $(GamePath)\Stardew Valley.exe - false - - - $(GamePath)\StardewModdingAPI.exe - false - - - $(GamePath)\xTile.dll - false - False - - - - - - Program - $(GamePath)\StardewModdingAPI.exe - $(GamePath) - - - - - - - $(GamePath)\MonoGame.Framework.dll - false - False - - - $(GamePath)\StardewValley.exe - false - - - $(GamePath)\StardewModdingAPI.exe - false - - - $(GamePath)\xTile.dll - false - - - - - - - - - - - - - - - - - - - - - - - - $(GamePath)\Mods\$(DeployModFolderName) - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ModBuildConfig/package.nuspec b/src/ModBuildConfig/package.nuspec deleted file mode 100644 index b8e96481..00000000 --- a/src/ModBuildConfig/package.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - - Pathoschild.Stardew.ModBuildConfig - 1.7.1 - MSBuild config for Stardew Valley mods - Pathoschild - Pathoschild - false - https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.7.1/LICENSE.txt - https://github.com/Pathoschild/Stardew.ModBuildConfig#readme - https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.7.1/assets/nuget-icon.png - Automates the build configuration for crossplatform Stardew Valley SMAPI mods. - - 1.7 added an option to create release zips on build and added a reference to XNA's XACT library for audio-related mods. - 1.7.1 fixed an issue where i18n folders were flattened, and ensures that the manifest/i18n files in the project take precedence over those in the build output if both are present. - - - - - - diff --git a/src/ModBuildConfig/release-notes.md b/src/ModBuildConfig/release-notes.md deleted file mode 100644 index ff2734f8..00000000 --- a/src/ModBuildConfig/release-notes.md +++ /dev/null @@ -1,28 +0,0 @@ -## Release notes -### 1.6 -* Added support for deploying mod files into `Mods` automatically. -* Added a build error if a game folder is found, but doesn't contain Stardew Valley or SMAPI. - -### 1.5 -* Added support for setting a custom game path globally. -* Added default GOG path on Mac. - -### 1.4 -* Fixed detection of non-default game paths on 32-bit Windows. -* Removed support for SilVerPLuM (discontinued). -* Removed support for overriding the target platform (no longer needed since SMAPI crossplatforms mods automatically). - -### 1.3 -* Added support for non-default game paths on Windows. - -### 1.2 -* Exclude game binaries from mod build output. - -### 1.1 -* Added support for overriding the target platform. - -### 1.0 -* Initial release. -* Added support for detecting the game path automatically. -* Added support for injecting XNA/MonoGame references automatically based on the OS. -* Added support for mod builders like SilVerPLuM. diff --git a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..57dde638 --- /dev/null +++ b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("StardewModdingAPI.ModBuildConfig")] +[assembly: AssemblyDescription("")] +[assembly: Guid("ea4f1e80-743f-4a1d-9757-ae66904a196a")] +[assembly: ComVisible(false)] +[assembly: AssemblyVersion("1.7.1.0")] +[assembly: AssemblyFileVersion("1.7.1.0")] diff --git a/src/SMAPI.ModBuildConfig/README.md b/src/SMAPI.ModBuildConfig/README.md new file mode 100644 index 00000000..c261e705 --- /dev/null +++ b/src/SMAPI.ModBuildConfig/README.md @@ -0,0 +1,121 @@ +**Stardew.ModBuildConfig** is an open-source NuGet package which automates the build configuration +for [Stardew Valley](http://stardewvalley.net/) [SMAPI](https://github.com/Pathoschild/SMAPI) mods. + +The package... + +* lets you write your mod once, and compile it on any computer. It detects the current platform + (Linux, Mac, or Windows) and game install path, and injects the right references automatically. +* configures Visual Studio so you can debug into the mod code when the game is running (_Windows + only_). +* packages the mod automatically into the game's mod folder when you build the code (_optional_). + +## Contents +* [Install](#install) +* [Simplify mod development](#simplify-mod-development) +* [Troubleshoot](#troubleshoot) +* [Versions](#versions) + +## Install +**When creating a new mod:** + +1. Create an empty library project. +2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). +3. [Write your code](http://canimod.com/guides/creating-a-smapi-mod). +4. Compile on any platform. + +**When migrating an existing mod:** + +1. Remove any project references to `Microsoft.Xna.*`, `MonoGame`, Stardew Valley, + `StardewModdingAPI`, and `xTile`. +2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). +3. Compile on any platform. + +## Simplify mod development +### Package your mod into the game folder automatically +You can copy your mod files into the `Mods` folder automatically each time you build, so you don't +need to do it manually: + +1. Edit your mod's `.csproj` file. +2. Add this block above the first `` line: + + ```xml + $(MSBuildProjectName) + ``` + +That's it! Each time you build, the files in `\Mods\` will be updated with +your `manifest.json`, build output, and any `i18n` files. + +Notes: +* To add custom files, just [add them to the build output](https://stackoverflow.com/a/10828462/262123). +* To customise the folder name, just replace `$(MSBuildProjectName)` with the folder name you want. +* If your project references another mod, make sure the reference is [_not_ marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx). + +### Debug into the mod code (Windows-only) +Stepping into your mod code when the game is running is straightforward, since this package injects +the configuration automatically. To do it: + +1. [Package your mod into the game folder automatically](#package-your-mod-into-the-game-folder-automatically). +2. Launch the project with debugging in Visual Studio or MonoDevelop. + +This will deploy your mod files into the game folder, launch SMAPI, and attach a debugger +automatically. Now you can step through your code, set breakpoints, etc. + +### Create release zips automatically (Windows-only) +You can create the mod package automatically when you build: + +1. Edit your mod's `.csproj` file. +2. Add this block above the first `` line: + + ```xml + $(SolutionDir)\_releases + ``` + +That's it! Each time you build, the mod files will be zipped into `_releases\.zip`. (You +can change the value to save the zips somewhere else.) + +## Troubleshoot +### "Failed to find the game install path" +That error means the package couldn't figure out where the game is installed. You need to specify +the game location yourself. There's two ways to do that: + +* **Option 1: set the path globally.** + _This will apply to every project that uses version 1.5+ of package._ + + 1. Get the full folder path containing the Stardew Valley executable. + 2. Create this file path: + + platform | path + --------- | ---- + Linux/Mac | `~/stardewvalley.targets` + Windows | `%USERPROFILE%\stardewvalley.targets` + + 3. Save the file with this content: + + ```xml + + + PATH_HERE + + + ``` + + 4. Replace `PATH_HERE` with your custom game install path. + +* **Option 2: set the path in the project file.** + _(You'll need to do it for every project that uses the package.)_ + 1. Get the folder path containing the Stardew Valley `.exe` file. + 2. Add this to your `.csproj` file under the ` + PATH_HERE + + ``` + + 3. Replace `PATH_HERE` with your custom game install path. + +The configuration will check your custom path first, then fall back to the default paths (so it'll +still compile on a different computer). + +## Versions +See [release notes](release-notes.md). diff --git a/src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj b/src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj new file mode 100644 index 00000000..2e37a89d --- /dev/null +++ b/src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj @@ -0,0 +1,49 @@ + + + + + Debug + x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A} + Library + Properties + StardewModdingAPI.ModBuildConfig + StardewModdingAPI.ModBuildConfig + v4.6.1 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SMAPI.ModBuildConfig/assets/nuget-icon.pdn b/src/SMAPI.ModBuildConfig/assets/nuget-icon.pdn new file mode 100644 index 00000000..7bd5c0c5 Binary files /dev/null and b/src/SMAPI.ModBuildConfig/assets/nuget-icon.pdn differ diff --git a/src/SMAPI.ModBuildConfig/assets/nuget-icon.png b/src/SMAPI.ModBuildConfig/assets/nuget-icon.png new file mode 100644 index 00000000..611cdf88 Binary files /dev/null and b/src/SMAPI.ModBuildConfig/assets/nuget-icon.png differ diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets new file mode 100644 index 00000000..a1b6aab3 --- /dev/null +++ b/src/SMAPI.ModBuildConfig/build/smapi.targets @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + A build task which packs mod files into a conventional release zip. + public class CreateModReleaseZip : Task, ITask + { + /********* + ** Accessors + *********/ + /// The mod files to pack. + public ITaskItem[] Files { get; set; } + + /// The name of the mod. + public string ModName { get; set; } + + /// The absolute or relative path to the folder which should contain the generated zip file. + public string OutputFolderPath { get; set; } + + + /********* + ** Public methods + *********/ + public override bool Execute() + { + try + { + // create output path if needed + Directory.CreateDirectory(OutputFolderPath); + + // get zip filename + string fileName = string.Format("{0}-{1}.zip", this.ModName, this.GetManifestVersion()); + + // clear old zip file if present + string zipPath = Path.Combine(OutputFolderPath, fileName); + if (File.Exists(zipPath)) + File.Delete(zipPath); + + // create zip file + using (Stream zipStream = new FileStream(zipPath, FileMode.Create, FileAccess.Write)) + using (ZipArchive archive = new ZipArchive(zipStream, ZipArchiveMode.Create)) + { + foreach (ITaskItem file in Files) + { + // get file info + string filePath = file.ItemSpec; + string entryName = ModName + '/' + file.GetMetadata("RecursiveDir") + file.GetMetadata("Filename") + file.GetMetadata("Extension"); + if (new FileInfo(filePath).Directory.Name.Equals("i18n", StringComparison.InvariantCultureIgnoreCase)) + entryName = Path.Combine("i18n", entryName); + + // add to zip + using (Stream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) + using (Stream fileStreamInZip = archive.CreateEntry(entryName).Open()) + { + fileStream.CopyTo(fileStreamInZip); + } + } + } + + return true; + } + catch (Exception ex) + { + Log.LogErrorFromException(ex); + return false; + } + } + + /// Get a semantic version from the mod manifest (if available). + public string GetManifestVersion() + { + // Get the file JSON string + string json = ""; + foreach(ITaskItem file in Files) + { + if(Path.GetFileName(file.ItemSpec).ToLower() != "manifest.json") + continue; + json = File.ReadAllText(file.ItemSpec); + break; + } + + // Serialize the manifest json into a data object, then get a version object from that. + IDictionary data = (IDictionary)new JavaScriptSerializer().DeserializeObject(json); + IDictionary version = (IDictionary)data["Version"]; + + // Store our version numbers for ease of use + int major = (int)version["MajorVersion"]; + int minor = (int)version["MinorVersion"]; + int patch = (int)version["PatchVersion"]; + + return String.Format("{0}.{1}.{2}", major, minor, patch); + } + } + ]]> + + + + + + + + + + + + + + + + $(HOME)/GOG Games/Stardew Valley/game + $(HOME)/.local/share/Steam/steamapps/common/Stardew Valley + + + /Applications/Stardew Valley.app/Contents/MacOS + $(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS + + + + + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley + C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32)) + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32)) + + + + + + + + + + + + false + + + false + + + false + + + false + + + $(GamePath)\Stardew Valley.exe + false + + + $(GamePath)\StardewModdingAPI.exe + false + + + $(GamePath)\xTile.dll + false + False + + + + + + Program + $(GamePath)\StardewModdingAPI.exe + $(GamePath) + + + + + + + $(GamePath)\MonoGame.Framework.dll + false + False + + + $(GamePath)\StardewValley.exe + false + + + $(GamePath)\StardewModdingAPI.exe + false + + + $(GamePath)\xTile.dll + false + + + + + + + + + + + + + + + + + + + + + + + + $(GamePath)\Mods\$(DeployModFolderName) + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/SMAPI.ModBuildConfig/package.nuspec b/src/SMAPI.ModBuildConfig/package.nuspec new file mode 100644 index 00000000..b8e96481 --- /dev/null +++ b/src/SMAPI.ModBuildConfig/package.nuspec @@ -0,0 +1,22 @@ + + + + Pathoschild.Stardew.ModBuildConfig + 1.7.1 + MSBuild config for Stardew Valley mods + Pathoschild + Pathoschild + false + https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.7.1/LICENSE.txt + https://github.com/Pathoschild/Stardew.ModBuildConfig#readme + https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.7.1/assets/nuget-icon.png + Automates the build configuration for crossplatform Stardew Valley SMAPI mods. + + 1.7 added an option to create release zips on build and added a reference to XNA's XACT library for audio-related mods. + 1.7.1 fixed an issue where i18n folders were flattened, and ensures that the manifest/i18n files in the project take precedence over those in the build output if both are present. + + + + + + diff --git a/src/SMAPI.ModBuildConfig/release-notes.md b/src/SMAPI.ModBuildConfig/release-notes.md new file mode 100644 index 00000000..ff2734f8 --- /dev/null +++ b/src/SMAPI.ModBuildConfig/release-notes.md @@ -0,0 +1,28 @@ +## Release notes +### 1.6 +* Added support for deploying mod files into `Mods` automatically. +* Added a build error if a game folder is found, but doesn't contain Stardew Valley or SMAPI. + +### 1.5 +* Added support for setting a custom game path globally. +* Added default GOG path on Mac. + +### 1.4 +* Fixed detection of non-default game paths on 32-bit Windows. +* Removed support for SilVerPLuM (discontinued). +* Removed support for overriding the target platform (no longer needed since SMAPI crossplatforms mods automatically). + +### 1.3 +* Added support for non-default game paths on Windows. + +### 1.2 +* Exclude game binaries from mod build output. + +### 1.1 +* Added support for overriding the target platform. + +### 1.0 +* Initial release. +* Added support for detecting the game path automatically. +* Added support for injecting XNA/MonoGame references automatically based on the OS. +* Added support for mod builders like SilVerPLuM. diff --git a/src/SMAPI.sln b/src/SMAPI.sln index 7941394d..d43ba1c2 100644 --- a/src/SMAPI.sln +++ b/src/SMAPI.sln @@ -45,6 +45,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{09CF91E5 ..\build\prepare-install-package.targets = ..\build\prepare-install-package.targets EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StardewModdingAPI.ModBuildConfig", "SMAPI.ModBuildConfig\StardewModdingAPI.ModBuildConfig.csproj", "{EA4F1E80-743F-4A1D-9757-AE66904A196A}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution SMAPI.Common\StardewModdingAPI.Common.projitems*{2aa02fb6-ff03-41cf-a215-2ee60ab4f5dc}*SharedItemsImports = 13 @@ -121,6 +123,16 @@ Global {A308F679-51A3-4006-92D5-BAEC7EBD01A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU {A308F679-51A3-4006-92D5-BAEC7EBD01A1}.Release|x86.ActiveCfg = Release|Any CPU {A308F679-51A3-4006-92D5-BAEC7EBD01A1}.Release|x86.Build.0 = Release|Any CPU + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Debug|Any CPU.ActiveCfg = Debug|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Debug|x86.ActiveCfg = Debug|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Debug|x86.Build.0 = Debug|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Release|Any CPU.ActiveCfg = Release|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Release|Mixed Platforms.Build.0 = Release|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Release|x86.ActiveCfg = Release|x86 + {EA4F1E80-743F-4A1D-9757-AE66904A196A}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit