Pathoschild.Stardew.ModBuildConfig 2.0.3-alpha20180307

This is a prerelease version of Pathoschild.Stardew.ModBuildConfig.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Pathoschild.Stardew.ModBuildConfig --version 2.0.3-alpha20180307                
NuGet\Install-Package Pathoschild.Stardew.ModBuildConfig -Version 2.0.3-alpha20180307                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.0.3-alpha20180307" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pathoschild.Stardew.ModBuildConfig --version 2.0.3-alpha20180307                
#r "nuget: Pathoschild.Stardew.ModBuildConfig, 2.0.3-alpha20180307"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pathoschild.Stardew.ModBuildConfig as a Cake Addin
#addin nuget:?package=Pathoschild.Stardew.ModBuildConfig&version=2.0.3-alpha20180307&prerelease

// Install Pathoschild.Stardew.ModBuildConfig as a Cake Tool
#tool nuget:?package=Pathoschild.Stardew.ModBuildConfig&version=2.0.3-alpha20180307&prerelease                

The mod build package is an open-source NuGet package which automates the MSBuild configuration for SMAPI mods.

The package...

  • lets your code compile on any computer (Linux/Mac/Windows) without changing assembly references or game path.
  • packages the mod into the game's Mods folder when you rebuild the code (configurable).
  • configures Visual Studio so you can debug into the mod code when the game is running (Windows only).
  • creates a release .zip in your bin folder you can upload to release the mod.

Install

When creating a new mod:

  1. Create an empty library project.
  2. Reference the Pathoschild.Stardew.ModBuildConfig NuGet package.
  3. Write your code.
  4. Compile on any platform.

When migrating an existing mod:

  1. Remove any project references to Microsoft.Xna.*, MonoGame, NetCode, Stardew Valley, StardewModdingAPI, and xTile.
  2. Reference the Pathoschild.Stardew.ModBuildConfig NuGet package.
  3. Compile on any platform.

Configure

Deploy files into the Mods folder

By default, your mod will be copied into the game's Mods folder (with a subfolder matching your project name) when you rebuild the code. The package will automatically include your manifest.json, any i18n files, and the build output.

To add custom files to the mod folder, just add them to the build output. (If your project references another mod, make sure the reference is not marked 'copy local'.)

You can change the mod's folder name by adding this above the first </PropertyGroup> in your .csproj:

<ModFolderName>YourModName</ModFolderName>

If you don't want to deploy the mod automatically, you can add this:

<EnableModDeploy>False</EnableModDeploy>
Create release zip

By default, a zip file will be created in the build output when you rebuild the code. This zip file contains all the files needed to share your mod in the recommended format for uploading to Nexus Mods or other sites.

You can change the zipped folder name (and zip name) by adding this above the first </PropertyGroup> in your .csproj:

<ModFolderName>YourModName</ModFolderName>

You can change the folder path where the zip is created like this:

<ModZipPath>$(SolutionDir)\_releases</ModZipPath>

Finally, you can disable the zip creation with this:

<EnableModZip>False</EnableModZip>

Or only create it in release builds with this:

<EnableModZip Condition="$(Configuration) != 'Release'">False</EnableModZip>
Game path

The package usually detects where your game is installed automatically. If it can't find your game or you have multiple installs, you can specify the path yourself. There's two ways to do that:

  • Option 1: global game path (recommended).
    This will apply to every project that uses the package.

    1. Get the full folder path containing the Stardew Valley executable.

    2. Create this file:

      • Linux/Mac: ~/stardewvalley.targets
      • Windows: %USERPROFILE%\stardewvalley.targets
    3. Save the file with this content:

      <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
         <PropertyGroup>
           <GamePath>PATH_HERE</GamePath>
         </PropertyGroup>
      </Project>
      
    4. Replace PATH_HERE with your game path.

  • Option 2: path in the project file.
    You'll need to do this for each 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 <Project line:

      <PropertyGroup>
        <GamePath>PATH_HERE</GamePath>
      </PropertyGroup>
      
    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).

Troubleshoot

"Failed to find the game install path"

That error means the package couldn't find your game. You can specify the game path yourself; see Game path above.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on Pathoschild.Stardew.ModBuildConfig:

Package Downloads
Platonymous.PyTK

Modding Toolkit for Stardew Valley

MaxVollmer.StardewValley.DeepWoodsMod.API

API for the DeepWoodsMod for Stardew Valley.

Juice805.StardewConfigFramework

A Unified Mod Options Page For Modders and Users. Keep all your mod settings in one place!

Bookcase

Additional utilities for making stardew mods and ensuring cross compatability.

EventGenerator

A handy Event Generator API for Stardew Valley's "SMAPI by PathosChild"

GitHub repositories (6)

Showing the top 5 popular GitHub repositories that depend on Pathoschild.Stardew.ModBuildConfig:

Repository Stars
Pathoschild/StardewMods
Mods for Stardew Valley using SMAPI.
FlashShifter/StardewValleyExpanded
The Stardew Valley Expanded mod for Stardew Valley.
Pathoschild/StardewXnbHack
A simple one-way XNB unpacker for Stardew Valley.
CJBok/SDV-Mods
spacechase0/StardewValleyMods
New home for my stardew valley mod source code
Version Downloads Last updated
4.3.2 541 11/9/2024
4.3.1 361 11/5/2024
4.3.0 682 10/7/2024
4.2.0 792 9/5/2024
4.1.1 13,356 6/24/2023
4.1.0 4,810 1/9/2023
4.0.2 2,883 10/9/2022
4.0.1 5,796 4/14/2022
4.0.0 5,363 11/30/2021
4.0.0-beta.20210916 729 9/17/2021
3.4.0-beta.20210813 432 8/13/2021
3.3.0 4,799 3/31/2021
3.2.2 5,878 9/24/2020
3.2.1 1,942 9/11/2020
3.2.0 2,024 9/7/2020
3.1.0 4,819 2/1/2020
3.0.0 4,214 11/26/2019
3.0.0-beta.8 649 7/17/2019
3.0.0-beta.7 1,485 7/9/2019
3.0.0-beta.6 1,331 7/9/2019
3.0.0-beta.5 428 6/28/2019
3.0.0-beta.4 355 6/19/2019
3.0.0-beta.3 461 6/17/2019
3.0.0-beta.2 341 6/13/2019
3.0.0-beta 1,590 6/13/2019
3.0.0-alpha.20190419 420 4/19/2019
2.2.0 9,374 10/28/2018
2.2.0-beta-20180819 2,581 8/20/2018
2.1.0 5,058 7/27/2018
2.1.0-beta-20180630 3,470 6/30/2018
2.1.0-beta-20180629 2,343 6/30/2018
2.1.0-beta-20180625 2,276 6/25/2018
2.1.0-beta-20180428 3,718 4/29/2018
2.1.0-beta-20180426 2,300 4/27/2018
2.1.0-beta 2,548 4/26/2018
2.1.0-alpha20180410 2,287 4/10/2018
2.0.3-alpha20180325 2,342 3/25/2018
2.0.3-alpha20180307 2,209 3/7/2018
2.0.2 4,560 11/1/2017
2.0.1 2,821 10/11/2017
2.0.0 2,447 10/11/2017
1.7.1 3,107 7/28/2017
1.7.0 3,036 7/28/2017
1.6.2 2,749 7/10/2017
1.6.1 2,879 7/10/2017
1.6.0 2,709 6/5/2017
1.5.0 3,806 1/23/2017
1.4.0 2,553 1/11/2017
1.3.0 3,202 12/31/2016
1.2.0 2,942 10/24/2016
1.1.0 2,922 10/21/2016
1.0.1 3,235 10/21/2016

2.0:
     - Added: mods are now copied into the `Mods` folder automatically (configurable).
     - Added: release zips are now created automatically in your build output folder (configurable).
     - Added: mod deploy and release zips now exclude Json.NET automatically, since it's provided by SMAPI.
     - Added mod's version to release zip filename.
     - Improved errors to simplify troubleshooting.
     - Fixed release zip not having a mod folder.
     - Fixed release zip failing if mod name contains characters that aren't valid in a filename.

     2.0.1:
     - Fixed mod deploy failing to create subfolders if they don't already exist.

     2.0.2:
     - Fixed compatibility issue on Linux.

     2.0.3:
     - Added support for Stardew Valley 1.3.