From 9be620e2fcdc13c6e6a918323157e21e1fed568f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 14:33:13 -0400 Subject: extract build configuration from Lookup Anything mod --- stardewvalley.targets | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 stardewvalley.targets diff --git a/stardewvalley.targets b/stardewvalley.targets new file mode 100644 index 00000000..1e71d06a --- /dev/null +++ b/stardewvalley.targets @@ -0,0 +1,51 @@ + + + + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley + C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley + ~\Library\Application Support\Steam\steamapps\common\Stardew Valley\Contents\MacOS + Program + $(GamePath)\StardewModdingAPI.exe + $(GamePath) + + + + + + + + + $(GamePath)\Stardew Valley.exe + + + $(GamePath)\StardewModdingAPI.exe + + + False + $(GamePath)\xTile.dll + + + + + + + False + $(GamePath)\MonoGame.Framework.dll + + + $(GamePath)\StardewValley.exe + + + $(GamePath)\StardewModdingAPI.exe + + + $(GamePath)\xTile.dll + + + + + + + + + \ No newline at end of file -- cgit From c6dbad2594620f9c25e7e548b813522c1e6c626d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 14:46:23 -0400 Subject: add license + readme --- LICENSE.txt | 8 ++++++++ README.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 LICENSE.txt create mode 100644 README.md diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..6463a584 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright Pathoschild and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..6ea731d1 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +**Stardew.ModBuildConfig** is an open-source NuGet package which automates the build configuration +for crossplatform [Stardew Valley](http://stardewvalley.net/) mods that use SMAPI. + +The configuration detects the operating system (Linux, Mac, or Windows) and the Stardew Valley +install path, and injects the correct references to Stardew Valley, SMAPI, and XNA/MonoGame. +It also adds a `GamePath` variable which can be used to automate mod installation during testing +if desired. + +## Contents +* [Installation](#installation) +* [Configuration](#configuration) +* [Versions](#versions) +* [See also](#see-also) + +## Installation +### New mod +_TODO_ + +### Migrating an existing mod +_TODO_ + +## Configuration +_TODO_ + +## Versions +_TODO_ + +## See also +_TODO_ +* NuGet package +* Discussion thread \ No newline at end of file -- cgit From 555e0d12241f9bda0262f513fa6bc8c55cc7d5fe Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 18:54:04 -0400 Subject: add NuGet package spec + icon --- assets/nuget-icon.pdn | Bin 0 -> 7401 bytes assets/nuget-icon.png | Bin 0 -> 5054 bytes build/smapi.targets | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ package.nuspec | 20 ++++++++++++++++++++ stardewvalley.targets | 51 -------------------------------------------------- 5 files changed, 71 insertions(+), 51 deletions(-) create mode 100644 assets/nuget-icon.pdn create mode 100644 assets/nuget-icon.png create mode 100644 build/smapi.targets create mode 100644 package.nuspec delete mode 100644 stardewvalley.targets diff --git a/assets/nuget-icon.pdn b/assets/nuget-icon.pdn new file mode 100644 index 00000000..7bd5c0c5 Binary files /dev/null and b/assets/nuget-icon.pdn differ diff --git a/assets/nuget-icon.png b/assets/nuget-icon.png new file mode 100644 index 00000000..611cdf88 Binary files /dev/null and b/assets/nuget-icon.png differ diff --git a/build/smapi.targets b/build/smapi.targets new file mode 100644 index 00000000..1e71d06a --- /dev/null +++ b/build/smapi.targets @@ -0,0 +1,51 @@ + + + + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley + C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley + ~\Library\Application Support\Steam\steamapps\common\Stardew Valley\Contents\MacOS + Program + $(GamePath)\StardewModdingAPI.exe + $(GamePath) + + + + + + + + + $(GamePath)\Stardew Valley.exe + + + $(GamePath)\StardewModdingAPI.exe + + + False + $(GamePath)\xTile.dll + + + + + + + False + $(GamePath)\MonoGame.Framework.dll + + + $(GamePath)\StardewValley.exe + + + $(GamePath)\StardewModdingAPI.exe + + + $(GamePath)\xTile.dll + + + + + + + + + \ No newline at end of file diff --git a/package.nuspec b/package.nuspec new file mode 100644 index 00000000..5d8e5e52 --- /dev/null +++ b/package.nuspec @@ -0,0 +1,20 @@ + + + + Pathoschild.Stardew.ModdingBuildConfig + 1.0-alpha + MSBuild config for Stardew Valley mods + Pathoschild + Pathoschild + false + https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/master/LICENSE.txt + https://github.com/Pathoschild/Stardew.ModBuildConfig + https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.0/assets/nuget-icon.png + Automates the build configuration for a crossplatform Stardew Valley mod that uses SMAPI. + Initial release + + + + + + \ No newline at end of file diff --git a/stardewvalley.targets b/stardewvalley.targets deleted file mode 100644 index 1e71d06a..00000000 --- a/stardewvalley.targets +++ /dev/null @@ -1,51 +0,0 @@ - - - - C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley - C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley - ~\Library\Application Support\Steam\steamapps\common\Stardew Valley\Contents\MacOS - Program - $(GamePath)\StardewModdingAPI.exe - $(GamePath) - - - - - - - - - $(GamePath)\Stardew Valley.exe - - - $(GamePath)\StardewModdingAPI.exe - - - False - $(GamePath)\xTile.dll - - - - - - - False - $(GamePath)\MonoGame.Framework.dll - - - $(GamePath)\StardewValley.exe - - - $(GamePath)\StardewModdingAPI.exe - - - $(GamePath)\xTile.dll - - - - - - - - - \ No newline at end of file -- cgit From 520c46fbe661acac7f6c7854b71d05f58a06cf64 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 19:26:33 -0400 Subject: expand readme, restructure config --- README.md | 39 +++++++++++++++---------- build/smapi.targets | 82 ++++++++++++++++++++++++++++++----------------------- package.nuspec | 2 +- 3 files changed, 71 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 6ea731d1..564f508e 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,38 @@ **Stardew.ModBuildConfig** is an open-source NuGet package which automates the build configuration for crossplatform [Stardew Valley](http://stardewvalley.net/) mods that use SMAPI. -The configuration detects the operating system (Linux, Mac, or Windows) and the Stardew Valley -install path, and injects the correct references to Stardew Valley, SMAPI, and XNA/MonoGame. -It also adds a `GamePath` variable which can be used to automate mod installation during testing -if desired. +The configuration... -## Contents -* [Installation](#installation) -* [Configuration](#configuration) -* [Versions](#versions) -* [See also](#see-also) +1. detects the operating system (Linux, Mac, or Windows) and the Stardew Valley install path; +2. injects the correct references to Stardew Valley, SMAPI, and XNA/MonoGame; +3. (on Windows) configures Visual Studio so you can launch the game for debugging; +4. and adds a `GamePath` variable which can be used to automate mod installation during testing + if desired. ## Installation -### New mod -_TODO_ +### Creating a new mod +1. Create an empty library project. +2. Reference the `Pathoschild.Stardew.ModBuildConfig` NuGet package. +3. [Write your code](http://canimod.com/guides/creating-a-smapi-mod). +4. Compile on any platform. ### Migrating an existing mod -_TODO_ +1. Remove any references to `Microsoft.Xna.*`, Stardew Valley, `StardewModdingAPI`, and xTile. +2. Reference the `Pathoschild.Stardew.ModBuildConfig` NuGet package. +3. Compile on any platform. ## Configuration -_TODO_ +### Custom game path +If you customised where Stardew Valley is installed, you can add your path to the list to try. -## Versions -_TODO_ +1. Get the full path to the directory containing the Stardew Valley executable. +2. Add this section to your `.csproj` file (anywhere before the added ` + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley + + ``` ## See also _TODO_ diff --git a/build/smapi.targets b/build/smapi.targets index 1e71d06a..6231650c 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -1,47 +1,57 @@ - + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley ~\Library\Application Support\Steam\steamapps\common\Stardew Valley\Contents\MacOS - Program - $(GamePath)\StardewModdingAPI.exe - $(GamePath) - - - - - - - $(GamePath)\Stardew Valley.exe - - - $(GamePath)\StardewModdingAPI.exe - - - False - $(GamePath)\xTile.dll - - + + + + + + + + + + $(GamePath)\Stardew Valley.exe + + + $(GamePath)\StardewModdingAPI.exe + + + False + $(GamePath)\xTile.dll + + - - - - False - $(GamePath)\MonoGame.Framework.dll - - - $(GamePath)\StardewValley.exe - - - $(GamePath)\StardewModdingAPI.exe - - - $(GamePath)\xTile.dll - - + + + Program + $(GamePath)\StardewModdingAPI.exe + $(GamePath) + + + + + + + False + $(GamePath)\MonoGame.Framework.dll + + + $(GamePath)\StardewValley.exe + + + $(GamePath)\StardewModdingAPI.exe + + + $(GamePath)\xTile.dll + + + + diff --git a/package.nuspec b/package.nuspec index 5d8e5e52..a000d986 100644 --- a/package.nuspec +++ b/package.nuspec @@ -2,7 +2,7 @@ Pathoschild.Stardew.ModdingBuildConfig - 1.0-alpha + 1.0-alpha2 MSBuild config for Stardew Valley mods Pathoschild Pathoschild -- cgit From e5d38b73720c58b00ea747b66be18f8b735d2e6e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 20:16:06 -0400 Subject: tweak error text --- build/smapi.targets | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/smapi.targets b/build/smapi.targets index 6231650c..f38f1585 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -53,9 +53,8 @@ - + - + - \ No newline at end of file -- cgit From 465bd538e476766f1114f915f955e30c9abab944 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 20:43:35 -0400 Subject: add more install paths --- build/smapi.targets | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build/smapi.targets b/build/smapi.targets index f38f1585..7d512a29 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -1,9 +1,18 @@ - C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley + + $(STARDEWVALLEY_DIR) + + + ~/.local/share/Steam/steamapps/common/Stardew Valley + + + ~/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 - ~\Library\Application Support\Steam\steamapps\common\Stardew Valley\Contents\MacOS -- cgit From e3d9894bf353197169fc3e84c973e07cfb5f3aae Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 20:56:48 -0400 Subject: add package links to readme --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 564f508e..c53b1ac3 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ The configuration... ## Installation ### Creating a new mod 1. Create an empty library project. -2. Reference the `Pathoschild.Stardew.ModBuildConfig` NuGet package. +2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModdingBuildConfig). 3. [Write your code](http://canimod.com/guides/creating-a-smapi-mod). 4. Compile on any platform. ### Migrating an existing mod 1. Remove any references to `Microsoft.Xna.*`, Stardew Valley, `StardewModdingAPI`, and xTile. -2. Reference the `Pathoschild.Stardew.ModBuildConfig` NuGet package. +2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModdingBuildConfig). 3. Compile on any platform. ## Configuration @@ -35,6 +35,5 @@ If you customised where Stardew Valley is installed, you can add your path to th ``` ## See also -_TODO_ -* NuGet package +* [NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModdingBuildConfig) * Discussion thread \ No newline at end of file -- cgit From 524c56ee757464b5785c4d704d4da1862b173db9 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 19 Oct 2016 22:53:49 -0400 Subject: correct home paths on Linux/Mac --- build/smapi.targets | 4 ++-- package.nuspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/smapi.targets b/build/smapi.targets index 7d512a29..2ca7a829 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -5,10 +5,10 @@ $(STARDEWVALLEY_DIR) - ~/.local/share/Steam/steamapps/common/Stardew Valley + $(HOME)/.local/share/Steam/steamapps/common/Stardew Valley - ~/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS + $(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley diff --git a/package.nuspec b/package.nuspec index a000d986..2f585ab5 100644 --- a/package.nuspec +++ b/package.nuspec @@ -2,7 +2,7 @@ Pathoschild.Stardew.ModdingBuildConfig - 1.0-alpha2 + 1.0-alpha4 MSBuild config for Stardew Valley mods Pathoschild Pathoschild -- cgit From 502559146bfb3cd39ee941245c3f71a7798a0760 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 21 Oct 2016 01:25:21 -0400 Subject: add GOG path on Linux --- build/smapi.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/build/smapi.targets b/build/smapi.targets index 2ca7a829..2c0ca5b7 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -5,6 +5,7 @@ $(STARDEWVALLEY_DIR) + $(HOME)/GOG Games/Stardew Valley/game $(HOME)/.local/share/Steam/steamapps/common/Stardew Valley -- cgit From 8d532e1cabe374a5b8673f07249e2d3848bc1a78 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 21 Oct 2016 01:25:41 -0400 Subject: mention mod builder compatibility in readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c53b1ac3..73aa082a 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,11 @@ If you customised where Stardew Valley is installed, you can add your path to th ``` +### Compatibility with mod builders +The configuration is designed for compatibility with third-party mod compilers. [Silverplum](https://github.com/rumangerst/SilVerPLuM) +is officially supported, and you can inject the `GAMEPATH` environment variable to override the +detected game path. + ## See also * [NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModdingBuildConfig) * Discussion thread \ No newline at end of file -- cgit From f9c107b751476b799a87cf25f9ed2424ab1a4775 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 21 Oct 2016 01:41:26 -0400 Subject: bump to 1.0 --- README.md | 6 +++--- package.nuspec | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 73aa082a..e1b065ec 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ The configuration... ## Installation ### 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.ModdingBuildConfig). +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. ### Migrating an existing mod 1. Remove any references to `Microsoft.Xna.*`, Stardew Valley, `StardewModdingAPI`, and xTile. -2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModdingBuildConfig). +2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). 3. Compile on any platform. ## Configuration @@ -40,5 +40,5 @@ is officially supported, and you can inject the `GAMEPATH` environment variable detected game path. ## See also -* [NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModdingBuildConfig) +* [NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig) * Discussion thread \ No newline at end of file diff --git a/package.nuspec b/package.nuspec index 2f585ab5..05c478de 100644 --- a/package.nuspec +++ b/package.nuspec @@ -1,13 +1,13 @@ - Pathoschild.Stardew.ModdingBuildConfig - 1.0-alpha4 + Pathoschild.Stardew.ModBuildConfig + 1.0 MSBuild config for Stardew Valley mods Pathoschild Pathoschild false - https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/master/LICENSE.txt + https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.0/LICENSE.txt https://github.com/Pathoschild/Stardew.ModBuildConfig https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.0/assets/nuget-icon.png Automates the build configuration for a crossplatform Stardew Valley mod that uses SMAPI. -- cgit From 137d795ab3d01bc132e99e19ba9567fd70f3cec3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 21 Oct 2016 01:48:57 -0400 Subject: fix package --- package.nuspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.nuspec b/package.nuspec index 05c478de..58701695 100644 --- a/package.nuspec +++ b/package.nuspec @@ -2,7 +2,7 @@ Pathoschild.Stardew.ModBuildConfig - 1.0 + 1.0.1 MSBuild config for Stardew Valley mods Pathoschild Pathoschild @@ -11,10 +11,10 @@ https://github.com/Pathoschild/Stardew.ModBuildConfig https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.0/assets/nuget-icon.png Automates the build configuration for a crossplatform Stardew Valley mod that uses SMAPI. - Initial release + Corrected package structure - + \ No newline at end of file -- cgit From cb9efa4e8266b67ddb5c19a107af389cdedce49c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 21 Oct 2016 19:42:09 -0400 Subject: add support for platform targeting --- README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++--------- build/smapi.targets | 31 ++++++++++++++++++++++++++---- package.nuspec | 8 ++++---- 3 files changed, 77 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e1b065ec..b94c118b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,18 @@ **Stardew.ModBuildConfig** is an open-source NuGet package which automates the build configuration for crossplatform [Stardew Valley](http://stardewvalley.net/) mods that use SMAPI. -The configuration... +## Usage +Basically this package lets you write your mod once, and compile it on any computer. It detects +your current platform (Linux, Mac, or Windows) and game path, and injects the right references +automatically. You can also target a specific platform to create a mod package compatible with that +platform. -1. detects the operating system (Linux, Mac, or Windows) and the Stardew Valley install path; -2. injects the correct references to Stardew Valley, SMAPI, and XNA/MonoGame; -3. (on Windows) configures Visual Studio so you can launch the game for debugging; -4. and adds a `GamePath` variable which can be used to automate mod installation during testing - if desired. +More specifically, the configuration... + +1. detects the operating system and Stardew Valley path; +2. injects the right references to Stardew Valley, SMAPI, and XNA/MonoGame for your platform; +3. configures Visual Studio so you can launch the game for debugging (_Windows only_); +4. and adds a `GamePath` variable which can be used to script mod packaging if desired. ## Installation ### Creating a new mod @@ -23,7 +28,7 @@ The configuration... ## Configuration ### Custom game path -If you customised where Stardew Valley is installed, you can add your path to the list to try. +If you customised where Stardew Valley is installed, you can specify where it is. 1. Get the full path to the directory containing the Stardew Valley executable. 2. Add this section to your `.csproj` file (anywhere before the added ` ``` +The configuration will check your custom path first, then fall back to the default paths. (That way +you can still compile it normally on a different computer.) + +### Target platform +By default the build configuration will target your current platform (e.g. Linux, Mac, or Windows). +If you're compiling it for a different platform (and have the required dependencies installed), you +can manually override the platform detection. + +You can define it... + +* in your `.csproj` (anywhere before the added ` + Windows + + ``` + +* _or_ by setting one of these compile constant: `GAME_PLATFORM_LINUX`, `GAME_PLATFORM_MAC`, or + `GAME_PLATFORM_WINDOWS`. + * In Visual Studio: right-click on the project and choose _Properties_. Click the _Build_ + tab, and enter the constants into the _Conditional compilation symbols_ field. + * In MonoDevelop: right-click on the project and choose _Options. Click the + _Build » Compiler_ tab, and enter the constants into the _Define Symbols_ field. + ### Compatibility with mod builders The configuration is designed for compatibility with third-party mod compilers. [Silverplum](https://github.com/rumangerst/SilVerPLuM) -is officially supported, and you can inject the `GAMEPATH` environment variable to override the -detected game path. +is officially supported, and mod builds can set the following environment variables: + +* `GAMEPATH`: overrides the Stardew Valley install path. +* `GAMEPLATFORM`: overrides the detected platform. Should be only of `Linux`, `Mac`, or `Windows`. + +## Versions +* 1.0: initial release. +* 1.1: added support for targeting platforms. ## See also * [NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig) diff --git a/build/smapi.targets b/build/smapi.targets index 2c0ca5b7..074581b4 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -1,5 +1,23 @@ - + + + + + Linux + Mac + Windows + + + Linux + Mac + Windows + + + $(STARDEWVALLEY_DIR) @@ -16,9 +34,11 @@ C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley - + - + @@ -63,8 +83,11 @@ - + + \ No newline at end of file diff --git a/package.nuspec b/package.nuspec index 58701695..3236e636 100644 --- a/package.nuspec +++ b/package.nuspec @@ -2,16 +2,16 @@ Pathoschild.Stardew.ModBuildConfig - 1.0.1 + 1.1 MSBuild config for Stardew Valley mods Pathoschild Pathoschild false - https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.0/LICENSE.txt + https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.1/LICENSE.txt https://github.com/Pathoschild/Stardew.ModBuildConfig - https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.0/assets/nuget-icon.png + https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.1/assets/nuget-icon.png Automates the build configuration for a crossplatform Stardew Valley mod that uses SMAPI. - Corrected package structure + Added support for targeting platforms. -- cgit From 9db2bbc94168ea4770fb0714f51a6fa813bb9e04 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 24 Oct 2016 10:51:54 -0400 Subject: no longer copy game binaries to build output --- README.md | 2 +- build/smapi.targets | 23 ++++++++++++++++++----- package.nuspec | 8 ++++---- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b94c118b..0894c49d 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ You can define it... `GAME_PLATFORM_WINDOWS`. * In Visual Studio: right-click on the project and choose _Properties_. Click the _Build_ tab, and enter the constants into the _Conditional compilation symbols_ field. - * In MonoDevelop: right-click on the project and choose _Options. Click the + * In MonoDevelop: right-click on the project and choose _Options_. Click the _Build » Compiler_ tab, and enter the constants into the _Define Symbols_ field. ### Compatibility with mod builders diff --git a/build/smapi.targets b/build/smapi.targets index 074581b4..0bd8e0ae 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -41,18 +41,27 @@ - - - + + false + + + false + + + false + $(GamePath)\Stardew Valley.exe + false $(GamePath)\StardewModdingAPI.exe + false - False $(GamePath)\xTile.dll + false + False @@ -67,17 +76,21 @@ - False $(GamePath)\MonoGame.Framework.dll + false + False $(GamePath)\StardewValley.exe + false $(GamePath)\StardewModdingAPI.exe + false $(GamePath)\xTile.dll + false diff --git a/package.nuspec b/package.nuspec index 3236e636..8072ad38 100644 --- a/package.nuspec +++ b/package.nuspec @@ -2,16 +2,16 @@ Pathoschild.Stardew.ModBuildConfig - 1.1 + 1.2 MSBuild config for Stardew Valley mods Pathoschild Pathoschild false - https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.1/LICENSE.txt + https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.2/LICENSE.txt https://github.com/Pathoschild/Stardew.ModBuildConfig - https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.1/assets/nuget-icon.png + https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.2/assets/nuget-icon.png Automates the build configuration for a crossplatform Stardew Valley mod that uses SMAPI. - Added support for targeting platforms. + No longer copies game binaries to build output. -- cgit From d3946c3324cf6fc0c73590b22770da061b025331 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 5 Dec 2016 11:57:12 -0500 Subject: add 'simplify mod development' section, add TOC --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0894c49d..1b106f1c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ **Stardew.ModBuildConfig** is an open-source NuGet package which automates the build configuration for crossplatform [Stardew Valley](http://stardewvalley.net/) mods that use SMAPI. +## Contents +* [Usage](#usage) +* [Installation](#installation) +* [Configuration](#configuration) +* [Simplify mod development](#simplify-mod-development) + ## Usage Basically this package lets you write your mod once, and compile it on any computer. It detects your current platform (Linux, Mac, or Windows) and game path, and injects the right references @@ -72,10 +78,40 @@ is officially supported, and mod builds can set the following environment variab * `GAMEPATH`: overrides the Stardew Valley install path. * `GAMEPLATFORM`: overrides the detected platform. Should be only of `Linux`, `Mac`, or `Windows`. +## Simplify mod development +### Package your mod into the game directory automatically +During development, it's helpful to have the mod files packaged into your `Mods` directory automatically each time you build. To do that: + +1. Edit your mod's `.csproj` file. +2. Add this block of code at the bottom, right above the closing `` tag: + + ```cs + + + $(GamePath)\Mods\$(TargetName) + + + + + + + ``` +3. Optionally, edit the `` value to change the name, or add any additional files your mod needs. + +That's it! Each time you build, the files in `\Mods\` will be updated. + +### Debugging +Debugging into your mod code when the game is running is pretty straightforward, since this package injects some of the configuration automatically. To do that: + +1. [Package your mod into the game directory automatically](#package-your-mod-into-the-game-directory-automatically). +2. Launch the project with debugging in Visual Studio or MonoDevelop. + +This will deploy your mod files into the game directory, launch SMAPI, and attach a debugger automatically. Now you can step through your code, set breakpoints, etc. + ## Versions * 1.0: initial release. * 1.1: added support for targeting platforms. ## See also * [NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig) -* Discussion thread \ No newline at end of file +* Discussion thread -- cgit From 0fe3275037b03fefb4e4c09a30097a85a12a3c03 Mon Sep 17 00:00:00 2001 From: Patrick Müssig Date: Tue, 6 Dec 2016 21:04:50 +0100 Subject: add support for non default Stardew Valley pathes (Steam and gog) --- build/smapi.targets | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/smapi.targets b/build/smapi.targets index 0bd8e0ae..759bd104 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -30,9 +30,11 @@ $(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 - + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley + $([" >$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1453375253}', 'PATH', null,RegistryView.Registry64, RegistryView.Registry32)) + C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null,RegistryView.Registry64, RegistryView.Registry32)) + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley - $([" >$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1453375253}', 'PATH', null,RegistryView.Registry64, RegistryView.Registry32)) C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley - $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null,RegistryView.Registry64, RegistryView.Registry32)) - + $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1453375253@PATH) + $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150@InstallLocation) + C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley - $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1453375253@PATH) - $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150@InstallLocation) + $([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)) 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)) + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32)) + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry64) + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32)) - - $(STARDEWVALLEY_DIR) - $(HOME)/GOG Games/Stardew Valley/game $(HOME)