Configuration

Properties

KSPBT_ModRoot
Default:
$(MSBuildProjectDir)/../GameData/$(MSBuildProjectName)/

specifies the root directory of your mod (the folder that gets placed into GameData). Generally you’ll want to set this to be relative to the csproj file using $(MSBuildThisFileDirectory).

KSPBT_ModPluginFolder
Default:
./

the directory where compiled binaries should be copied. This is relative to the KSPBT_ModRoot. The DLLs will be copied to this directory after each build.

KSPBT_CKANCompatibleVersions
Default:
1.12 1.11 1.10 1.9 1.8

Used by the CKANInstall target to set additional KSP versions to treat as compatible when installing

KSPBT_ReferenceSystemAssemblies
Default:
true

If set to true, adds assembly references to Mono System DLLs.

KSPBT_ReferenceUnityAssemblies
Default:
true

If set to true, adds assembly references to all UnityEngine assemblies in the KSP install.

KSPBT_ReferenceGameAssemblies
Default:
true, except in the Unity configuration

If set to true, adds references to Assembly-CSharp and Assembly-CSharp-firstpass assemblies from the KSP install.

KSPBT_ReferenceModAssemblies
Default:
true, except in the Unity configuration

If set to true, adds references to the assemblies included in ModReference list.

KSPBT_GenerateAssemblyAttribute
Default:
true, except in the Unity configuration

If set to true, automatically generates the KSPAssembly for your assembly from the Version property.

KSPBT_GenerateDependencyAttributes
Default:
true, except in the Unity configuration

If set to true, automatically generates KSPAssemblyDependency attributes for each dependency. Dependencies should have either the CKANIdentifier metadata or KSPAssemblyName metadata. Versions can be supplied with CKANVersion or KSPAssemblyVersion.

KSPBT_CopyDLLsToPluginFolder
Default:
true, except in the Unity configuration

If set to true, automatically copies the compiled DLL to the KSPBT_ModPluginFolder.

KSPBT_GenerateVersionFile
Default:
true, except in the Unity configuration

If set to true, automatically generates a version file using the information in any KSPVersionFile items. Without defining a KSPVersionFile, nothing will be generated. See Generating Version Files for more details.

KSPBT_GameRoot

Warning

You should not set or use this property in your csproj file.

This property should be set to the root directory of your KSP install. see Locating your KSP Install

Items

ModReference

A reference to another mod that is a dependency. This mod will be automatically referenced in the build process and installed using CKAN if an identifier is given. See Using Dependencies for examples.

Metadata

Identity

The name of the mod you are referencing, as set in that mod’s KSPAssemblyAttribute

DLLPath

The path of the mod’s assembly to reference when building, relative to KSPBT_GameRoot.

CKANIdentifier

The name of the mod in CKAN to install before building.

CKANVersion

The specific version to install from CKAN, if any.

Any additional metadata is copied to the resulting Reference item

KSPVersionFile

Defines a version file to generate. See Generating Version Files for examples.

Metadata

Identity

To create a new version file from scratch, set to .. Otherwise set to a path to a json version file to use as a base

Destination

Path to where the generated json version file should be placed

Name
Default:
$(ProjectName)

The mod name. Corresponds to the NAME value in json.

Version
Default:
$(FileVersion)

The mod version. Corresponds with the VERSION value in json.

URL

The URL of the remote version file. Corresponds with the URL value in json.

Download

Where to link players to update your mod. Corresponds with the DOWNLOAD value in json.

KSP_Version
Default:
1.12

The KSP version the mod is targeting. Corresponds with the KSP_VERSION value in json.

KSP_Version_Min
Default:
1.8

The minimum supported KSP version. Corresponds with the KSP_VERSION_MIN value in json.

KSP_Version_Max
Default:
1.12

The maximum supported KSP version. Corresponds with the KSP_VERSION_MAX value in json.