Skip to content

Conversation

@drewcassidy
Copy link
Member

This is a breaking change (so the version would change to 1.0.0).

Docs build for this branch: https://kspbuildtools.readthedocs.io/en/next/

The goals here were:

  • eliminating the double-import of the .csproj.user file. Instead, this branch means that the path to KSP root never gets referenced in the user .csproj at all, allowing all the path determination to be calculated at runtime
  • eliminating risk of namespace-collision with other frameworks for property names
  • allowing toggling each component of KSPBT, to account for weird use cases, such as...
  • allowing building mods for use in the Unity editor, such as UI code, by automatically disabling all the references that are unsafe there. Its up to the mod developer still to set up preprocessor directives and includes to allow compilation in this situation, but it eliminates any need for keeping code the same between the main mod codebase and "stub" cs files just to get serialization working

Changelog:

  • Renamed global msbuild properties to have the KSPBT_ prefix to avoid namespace collisions with other frameworks
    • KSPRoot is now KSPBT_GameRoot. It should no longer be referenced within a .csproj file
    • RepoRootPath is now KSPBT_ModRoot, and should now point to the mod folder within GameData rather than the
      root of a git repo
    • BinariesOutputRelativePath is now KSPBT_ModPluginFolder
    • GenerateKSPAssemblyAttribute is now KSPBT_GenerateAssemblyAttribute and defaults to true
    • GenerateKSPAssemblyDependencyAttributes is now KSPBT_GenerateDependencyAttributes and defaults to true
    • ReferenceUnityAssemblies is now KSPBT_ReferenceUnityAssemblies
    • ReferenceKSPAssemblies is now KSPBT_ReferenceGameAssemblies
  • Added the KSPBT_ReferenceSystemAssemblies property to control referencing the mono system DLLs within the KSP
    managed folder. Setting this property to false will load the implicit framework DLLs instead.
  • Mod dependencies should now be declared with
    ModReference items. This avoids the need for the KSP install path to be known at evaluation time.

It is too constraining to support both. At the moment the msbuild side still supports them, but the actions do not. they will not be tested any longer
# Conflicts:
#	.github/actions/compile/action.yml
#	docs/msbuild/dependencies.md
# Conflicts:
#	CHANGELOG.md
From now on, release with `just release {{args}}` with the usual yaclog version args like `--patch` or `--minor`. It will automatically run `yaclog release` alongside updating all reusable workflows to have the correct tags. Pinning workflows to a branch (or leaving them unpinned) should be avoided from here on, only pin to tags.

The pin updating can be done on its own with `just pin-workflows {{ref}}`

Makes #67 unnecessary

commit 82828e9
Author: Andrew Cassidy <[email protected]>
Date:   Tue Oct 28 17:49:32 2025 -0700

    Add note to the docs

commit f70929c
Author: Andrew Cassidy <[email protected]>
Date:   Tue Oct 28 17:41:19 2025 -0700

    Only run checks for tag events

commit 108d8b8
Author: Andrew Cassidy <[email protected]>
Date:   Tue Oct 28 17:39:05 2025 -0700

    Check for mismatches

    this CI run should fail, I'll later restrict this check to only on tag pushes

commit bf2a436
Author: Andrew Cassidy <[email protected]>
Date:   Tue Oct 28 17:37:59 2025 -0700

    Fix regex

commit adb4c77
Author: Andrew Cassidy <[email protected]>
Date:   Tue Oct 28 17:35:22 2025 -0700

    Fix line endings

commit 0c99c7f
Author: Andrew Cassidy <[email protected]>
Date:   Tue Oct 28 17:21:15 2025 -0700

    run yaclog via uv

    this allows us to pin the version

commit 814ba63
Author: Andrew Cassidy <[email protected]>
Date:   Tue Oct 28 17:14:56 2025 -0700

    Add tool to pin workflows while releasing a new version
This requires setting the `use-nuget-restore` option on the compile
action/build workflow.
and bump dotnet version to 8.0 nominal, with tests on 7 and 9
commit 2f23d91
Author: Andrew Cassidy <[email protected]>
Date:   Thu Oct 30 00:26:49 2025 -0700

    Fix typo preventing CKAN mod installation

commit 538f615
Author: Andrew Cassidy <[email protected]>
Date:   Thu Oct 30 00:08:50 2025 -0700

    Try that again

commit 221795f
Author: Andrew Cassidy <[email protected]>
Date:   Thu Oct 30 00:05:02 2025 -0700

    Treat warnings as errors during CI tests

    for some reason a *missing dependency dll* is treated as a *warning*???
and use an absolute path in the compile action.
Does anyone even use the .props and .props.user stuff or should we delete that?
Fixes #50
### Msbuild

- Renamed global msbuild properties to have the `KSPBT_` prefix to avoid namespace collisions with other frameworks
  - `KSPRoot` is now `KSPBT_GameRoot`. It should no longer be referenced within a .csproj file
  - `RepoRootPath` is now `KSPBT_ModRoot`, and should now point to the mod folder within GameData rather than the
    root of a git repo
  - `BinariesOutputRelativePath` is now `KSPBT_ModPluginFolder`
  - `GenerateKSPAssemblyAttribute` is now `KSPBT_GenerateAssemblyAttribute` and defaults to true
  - `GenerateKSPAssemblyDependencyAttributes` is now `KSPBT_GenerateDependencyAttributes` and defaults to true
  - `ReferenceUnityAssemblies` is now `KSPBT_ReferenceUnityAssemblies`
  - `ReferenceKSPAssemblies` is now `KSPBT_ReferenceGameAssemblies`
- Added the `KSPBT_ReferenceSystemAssemblies` property to control referencing the mono system DLLs within the KSP
  managed folder. Setting this property to false will load the implicit framework DLLs instead.
- Mod dependencies should now be declared with
  `ModReference` items. This avoids the need for the KSP install path to be known at evaluation time.
- Only include Log.cs (or anything else in include/unity) when `KSPBT_ReferenceUnityAssemblies` is `true` (#61)
- Fix `KSP_VERSION_MAX` getting mangled when using an existing version file (#64)
- Fix incorrect behavior when building without a solution (#50)

### Docs

- Fixed git submodule example to work even for tagged releases (#49)

### Actions

- KSPBT actions used in reusable workflows are now pinned with each tag, instead of using actions from `main`. All calls to reusable workflows should be pinned to a tag to ensure the correct actions are being used. (#21)
- `compile` action: Use `dotnet restore` instead of `nuget restore` by default, allowing the action to work on any Ubuntu runner image. Added the `use-nuget-restore` option to restore the previous behavior for projects that use packages.config for dependencies. (#68)
- `compile` action: Removed call to`actions/setup-dotnet`. Setting up .NET should be done as a separate step. (#65)
- `setup-ckan` action: Sped up execution by skipping recommended packages and man-db updates
- `assemble-release` action: `outputs.artifact-path` now includes the `.zip` extension (#51)
# Conflicts:
#	CHANGELOG.md
allows for skipping installation entirely, as well as supporting non-debian-based operating systems in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants