|
| 1 | +# Migration Guide |
| 2 | +If you are migrating a mod from a <1.0.0 version KSP Build Tools, follow the instructions below |
| 3 | + |
| 4 | +## MSBuild Properties |
| 5 | + |
| 6 | +- `KSPRoot` was renamed to {confval}`KSPBT_GameRoot`. It should no longer be referenced within a .csproj file |
| 7 | +- `RepoRootPath` was renamed to {confval}`KSPBT_ModRoot`, and should now point to the mod folder within GameData rather than the root of a git repo |
| 8 | +- `BinariesOutputRelativePath` was renamed to {confval}`KSPBT_ModPluginFolder` |
| 9 | +- `GenerateKSPAssemblyAttribute` was renamed to {confval}`KSPBT_GenerateAssemblyAttribute` and defaults to true |
| 10 | +- `GenerateKSPAssemblyDependencyAttributes` was renamed to {confval}`KSPBT_GenerateDependencyAttributes` and defaults to true |
| 11 | +- `ReferenceUnityAssemblies` was renamed to {confval}`KSPBT_ReferenceUnityAssemblies` |
| 12 | +- `ReferenceKSPAssemblies` was renamed to {confval}`KSPBT_ReferenceGameAssemblies` |
| 13 | + |
| 14 | +## MSBuild Items |
| 15 | + |
| 16 | +Dependency mods should now be specified with {confval}`ModReference` items. For example |
| 17 | + |
| 18 | +```xml |
| 19 | +<ItemGroup> |
| 20 | + <Reference Include="0Harmony, Culture=neutral, PublicKeyToken=null"> |
| 21 | + <HintPath>$(KSPRoot)/GameData/000_Harmony/0Harmony.dll</HintPath> |
| 22 | + <CKANIdentifier>Harmony2</CKANIdentifier> |
| 23 | + <Private>False</Private> |
| 24 | + </Reference> |
| 25 | +</ItemGroup> |
| 26 | +``` |
| 27 | + |
| 28 | +would become |
| 29 | + |
| 30 | +```xml |
| 31 | +<ItemGroup> |
| 32 | + <ModReference Include="0Harmony"> |
| 33 | + <DLLPath>GameData/000_Harmony/0Harmony.dll</DLLPath> |
| 34 | + <CKANIdentifier>Harmony2</CKANIdentifier> |
| 35 | + <Private>False</Private> |
| 36 | + </ModReference> |
| 37 | +</ItemGroup> |
| 38 | +``` |
| 39 | + |
| 40 | +## CI Actions |
| 41 | + |
| 42 | +### {gha:action}`compile` |
| 43 | + |
| 44 | +The compile action no longer runs `setup-dotnet`. You need to run this step separately. |
| 45 | + |
| 46 | +If your mod uses a `packages.config` file, you need to specify `use-nuget-restore` like so |
| 47 | + |
| 48 | +```yaml |
| 49 | +- uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected] |
| 50 | + with: |
| 51 | + use-nuget-restore: 'true' |
| 52 | +``` |
| 53 | +
|
| 54 | +If your mod *does not* use a `packages.config` file, you can migrate your workflows on Github runners to use Ubuntu 24.04 or later. |
| 55 | + |
| 56 | +## Library |
| 57 | + |
| 58 | +If you made use of the logging utilities under the `KSPBuildTools` namespace, you should migrate to [KSPCommunityLib](https://git.offworldcolonies.nexus/KSPModdingLibs/KSPCommunityLib) instead. |
0 commit comments