KSP1Retooled.BuildTools
2.0.1
dotnet add package KSP1Retooled.BuildTools --version 2.0.1
NuGet\Install-Package KSP1Retooled.BuildTools -Version 2.0.1
<PackageReference Include="KSP1Retooled.BuildTools" Version="2.0.1" />
<PackageVersion Include="KSP1Retooled.BuildTools" Version="2.0.1" />
<PackageReference Include="KSP1Retooled.BuildTools" />
paket add KSP1Retooled.BuildTools --version 2.0.1
#r "nuget: KSP1Retooled.BuildTools, 2.0.1"
#:package KSP1Retooled.BuildTools@2.0.1
#addin nuget:?package=KSP1Retooled.BuildTools&version=2.0.1
#tool nuget:?package=KSP1Retooled.BuildTools&version=2.0.1
KSP1Retooled Build Tools
This repository provides a common set of tools for developing mods for Kerbal Space Program and KSP Retooled. It integrates with MSBuild to simplify setting up plugins, and integrates with CKAN to easily reference other mods. it also includes a set of CI actions for automating builds.
Installation
Run dotnet add package KSP1Retooled.BuildTools on your project, or add
<ItemGroup>
<PackageReference Include="KSP1Retooled.BuildTools"/>
</ItemGroup>
to the .csproj file. Pinning the version is highly recommended.
Usage
Once you have a KSP installation to link to, all the game DLLs will be automatically included in your project automatically.
Configure your mod's location in GameData and where to put the output DLLs
<KSPBT_ModRoot>$(MSBuildThisFileDirectory)/../GameData/$(MSBuildProjectName)</KSPBT_ModRoot>
<KSPBT_ModPluginFolder>plugins</KSPBT_ModPluginFolder>
Reference dependency mods in your DLL by adding ModReference items to the project. They will be automatically installed using CKAN.
<ItemGroup>
<ModReference Include="Modulemanager">
<DLLPath>GameData/Modulemanager*.dll</DLLPath>
<CKANIdentifier>ModuleManager</CKANIdentifier>
</ModReference>
<ModReference Include="0Harmony">
<DLLPath>GameData/000_Harmony/0Harmony.dll</DLLPath>
<CKANIdentifier>Harmony2</CKANIdentifier>
</ModReference>
</ItemGroup>
Auto-generate version files from your project's FileVersion. This works well with minver.
<ItemGroup>
<KSPVersionFile Include=".">
<Destination>$(KSPBT_ModRoot)/mymod.version</Destination>
<URL>https://github.com/username/repo/releases/latest/download/mymod.version</URL>
<Download>https://github.com/username.repo/releases/latest</Download>
</KSPVersionFile>
</ItemGroup>
From there you should be able to build your mod with just dotnet build
KSP Retooled
Whether you are building for stock KSP or for KSP Retooled is detected from your KSP install. When building for Retooled the KSP_RETOOLED and UNITY_6_7 symbols are defined.
To build for both, set the path to each install in your .csproj.user file. Your mod then gets a MyMod.dll for stock KSP and a MyMod.Retooled.1.13.dll for Retooled, and each game loads the right one.
<KSPBT_StockGameRoot>C:\Games\Kerbal Space Program</KSPBT_StockGameRoot>
<KSPBT_RetooledGameRoot>C:\Games\KSP Retooled</KSPBT_RetooledGameRoot>
For more details, see the MSBuild section in the docs.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- JsonPoke (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.