diff --git a/.github/actions/assemble-release/action.yml b/.github/actions/assemble-release/action.yml index 837453d..2632f61 100644 --- a/.github/actions/assemble-release/action.yml +++ b/.github/actions/assemble-release/action.yml @@ -14,7 +14,7 @@ inputs: default: "**/*.pdb" output-file-name: - description: Output artifact name used in the upload-artifact action. a zip file with this name will be created in the github workspace so that it can be immediately consumed by other actions in the workflow without having to download the artifact. + description: Output artifact name used in the upload-artifact action WITHOUT ".zip" extension. a zip file with this name will be created in the github workspace so that it can be immediately consumed by other actions in the workflow without having to download the artifact. default: ${{ github.event.repository.name || 'release'}} working-directory: @@ -61,7 +61,7 @@ runs: run: | zip -r ${{ github.workspace }}/${{ inputs.output-file-name }}.zip . echo 'ARTIFACT_FILENAME=${{ inputs.output-file-name }}' >> $GITHUB_ENV - echo 'artifact-path=${{ github.workspace }}/${{ inputs.output-file-name }}' >> $GITHUB_OUTPUT + echo 'artifact-path=${{ github.workspace }}/${{ inputs.output-file-name }}.zip' >> $GITHUB_OUTPUT - name: Upload Artifact id: upload-artifact diff --git a/.github/actions/compile/action.yml b/.github/actions/compile/action.yml index acf1fde..6c04c58 100644 --- a/.github/actions/compile/action.yml +++ b/.github/actions/compile/action.yml @@ -10,10 +10,6 @@ inputs: default: Release description: The project configuration to build. - dotnet-version: - default: 5.x - description: Version of dotnet compiler to use. Defaults to 5.x. - ksp-zip-url: default: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip description: > @@ -36,6 +32,12 @@ inputs: default: ${{ github.workspace }} description: the working directory to run in + use-nuget-restore: + default: 'false' + description: > + Set to true if your project uses a packages.config file instead of packagereferences. Ensure the environment has + nuget and mono installed, either installing them manually or by using the Github Ubuntu-22.04 images + runs: using: composite steps: @@ -55,11 +57,6 @@ runs: shell: bash run: echo 'KSP_ROOT=${{ '/tmp/ksp' }}' >> "$GITHUB_ENV" - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ inputs.dotnet-version }} - - name: Download KSP Libs shell: bash run: | @@ -68,13 +65,20 @@ runs: - name: Restore Mod Solution shell: bash + if: ${{ inputs.use-nuget-restore != 'true'}} # https://github.com/actions/runner/issues/1483 :sufferbeale: + working-directory: ${{ inputs.working-directory }} + run: dotnet restore ${{ inputs.solution-file-path }} ${{ runner.debug && '-v:diagnostic' }} + + - name: Restore Mod Solution (NuGet) + shell: bash + if: ${{ inputs.use-nuget-restore == 'true'}} working-directory: ${{ inputs.working-directory }} run: nuget restore ${{ inputs.solution-file-path }} -Verbosity detailed - name: Build Mod Solution shell: bash working-directory: ${{ inputs.working-directory }} - run: | - dotnet msbuild -m:1 -p:Configuration=${{ inputs.build-configuration }} \ - -p:ManagedRelativePath=KSP_x64_Data/Managed ${{ inputs.solution-file-path }} \ - ${{ runner.debug && '-v:detailed' }} + run: > + dotnet msbuild -m:1 -p:Configuration=${{ inputs.build-configuration }} + -p:KSPBT_ManagedPath=${{ env.KSP_ROOT }}/KSP_x64_Data/Managed ${{ inputs.solution-file-path }} + ${{ runner.debug && '-v:diagnostic' }} diff --git a/.github/actions/setup-ckan/action.yml b/.github/actions/setup-ckan/action.yml index 346fa6e..d99ba10 100644 --- a/.github/actions/setup-ckan/action.yml +++ b/.github/actions/setup-ckan/action.yml @@ -6,6 +6,10 @@ x-env: description: The path to use as the root of a KSP instance for CKAN to set-up. If not set, `/tmp/ksp` is used instead. inputs: + ckan-install-method: + description: Method of installing CKAN. Can be set to 'apt' to install from the official .deb file, or 'skip' to skip installation if your runner already has CKAN installed. + default: 'apt' + ckan-version: description: CKAN tag to install. set to an empty string to always install the most recent version. See [the CKAN releases page](https://github.com/KSP-CKAN/CKAN/tags) for a list of available tags default: '' @@ -42,24 +46,26 @@ runs: shell: bash run: echo 'KSP_ROOT=${{ '/tmp/ksp' }}' >> "$GITHUB_ENV" - - name: Install CKAN + - name: Install CKAN via apt + if: ${{ inputs.ckan-install-method == 'apt' }} shell: bash run: | + sudo rm -f /var/lib/man-db/auto-update # skip updating man pages, which takes a long time and makes no sense in a CI job gh release download ${{ inputs.ckan-version }} --repo ${{ inputs.ckan-repo }} --pattern 'ckan*.deb' -O ckan.deb ${{ env.ACT && 'sudo apt update --quiet' }} - sudo apt install --quiet ./ckan.deb ${{ runner.debug && '--verbose-versions' }} + sudo apt install --quiet --no-install-recommends --no-install-suggests ./ckan.deb ${{ runner.debug && '--verbose-versions' }} ckan version env: GH_TOKEN: ${{ github.token }} - - name: Setup CKAN Instance + - name: Setup fake KSP instance shell: bash run: | ${{ runner.debug && 'echo "$PATH"' }} ckan instance fake --set-default KSP ${{ env.KSP_ROOT }} 1.12.5 --game KSP --MakingHistory 1.9.1 --BreakingGround 1.7.1 ${{ runner.debug && '--verbose' }} ckan update - - name: Setup CKAN Compatible Versions + - name: Setup CKAN compatible versions shell: bash if: inputs.ckan-compatible-versions != '' run: | @@ -69,7 +75,7 @@ runs: env: VERSIONS: ${{ inputs.ckan-compatible-versions }} - - name: Setup CKAN Filter + - name: Setup CKAN filter shell: bash if: inputs.ckan-filters != '' run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07ee09b..00fdcf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,16 @@ on: description: > If MSBuild should be used. If your mod has no msbuild project (e.g. a pure part mod) you should set this to false + use-nuget-restore: + type: boolean + default: false + description: > + Set to true if your project uses a packages.config file instead of packagereferences. This will cause the job + to run on the Ubuntu-22.04 image instead of Ubuntu-24.04 + dotnet-version: + type: string + default: 8.x + description: Version of dotnet compiler to use. use-ckan: type: boolean default: false @@ -37,34 +47,40 @@ defaults: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ${{ inputs.use-nuget-restore && 'ubuntu-22.04' || 'ubuntu-24.04' }} steps: - name: Checkout Mod Repo uses: actions/checkout@v4 with: submodules: true + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ inputs.dotnet-version }} + # Install CKAN and set up an instance - - uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@0.0.5 + - uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@1.0.0-alpha.3 if: ${{ (inputs.use-ckan && inputs.use-msbuild) || inputs.dependency-identifiers }} # Install any listed CKAN dependencies - - uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@0.0.5 + - uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@1.0.0-alpha.3 if: ${{ inputs.dependency-identifiers }} with: dependency-identifiers: ${{ inputs.dependency-identifiers }} # Compile the mod - - uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@0.0.5 + - uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@1.0.0-alpha.3 if: ${{ inputs.use-msbuild }} with: build-configuration: ${{ inputs.build-configuration }} ksp-zip-url: ${{ inputs.ksp-zip-url }} ksp-zip-password: ${{ secrets.ksp-zip-password }} solution-file-path: ${{ inputs.solution-file-path }} + use-nuget-restore: ${{ inputs.use-nuget-restore }} # Assemble the mod into a release package and upload it as an artifact - - uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@0.0.5 + - uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@1.0.0-alpha.3 with: artifacts: ${{ inputs.artifacts }} output-file-name: ${{ github.event.repository.name }}-${{ inputs.build-configuration }} diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 37f300a..c316092 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -64,7 +64,7 @@ jobs: submodules: true - name: update-version - uses: KSPModdingLibs/KSPBuildTools/.github/actions/update-version@0.0.5 + uses: KSPModdingLibs/KSPBuildTools/.github/actions/update-version@1.0.0-alpha.3 with: version-string: ${{ inputs.version-string }} template-extension: ${{ inputs.version-template-extension }} @@ -81,18 +81,18 @@ jobs: git tag -f -a "$VERSION_STRING" -m "$VERSION_STRING" # Install CKAN and set up an instance - - uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@0.0.5 + - uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@1.0.0-alpha.3 if: ${{ (inputs.use-ckan && inputs.use-msbuild) || inputs.dependency-identifiers }} # Install any listed CKAN dependencies - - uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@0.0.5 + - uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@1.0.0-alpha.3 if: ${{ inputs.dependency-identifiers }} with: dependency-identifiers: ${{ inputs.dependency-identifiers }} - name: compile if: ${{ inputs.use-msbuild }} - uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@0.0.5 + uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@1.0.0-alpha.3 with: build-configuration: ${{ inputs.build-configuration }} ksp-zip-url: ${{ inputs.ksp-zip-url }} @@ -101,7 +101,7 @@ jobs: - name: assemble-release id: assemble-release - uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@0.0.5 + uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@1.0.0-alpha.3 with: artifacts: ${{ inputs.artifacts }} output-file-name: ${{ github.event.repository.name }}-${{ env.VERSION_STRING }} diff --git a/.github/workflows/internal-ci.yml b/.github/workflows/internal-ci.yml index 1d0a6a4..838a2b5 100644 --- a/.github/workflows/internal-ci.yml +++ b/.github/workflows/internal-ci.yml @@ -19,7 +19,7 @@ jobs: env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 outputs: package-version: ${{ steps.get-version.outputs.version }} steps: diff --git a/.github/workflows/internal-test-assetbundle.yml b/.github/workflows/internal-test-assetbundle.yml index 6463d47..6078dd1 100644 --- a/.github/workflows/internal-test-assetbundle.yml +++ b/.github/workflows/internal-test-assetbundle.yml @@ -12,7 +12,7 @@ env: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/internal-test-plugin-legacy.yml b/.github/workflows/internal-test-plugin-legacy.yml index da7c4d1..b565700 100644 --- a/.github/workflows/internal-test-plugin-legacy.yml +++ b/.github/workflows/internal-test-plugin-legacy.yml @@ -12,6 +12,11 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' - uses: ./.github/actions/setup-ckan @@ -19,6 +24,7 @@ jobs: with: ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip working-directory: ${{ env.TESTDIR }} + use-nuget-restore: true - uses: ./.github/actions/assemble-release with: diff --git a/.github/workflows/internal-test-plugin-nuget.yml b/.github/workflows/internal-test-plugin-nuget.yml index 9519ca2..b405439 100644 --- a/.github/workflows/internal-test-plugin-nuget.yml +++ b/.github/workflows/internal-test-plugin-nuget.yml @@ -13,20 +13,24 @@ env: NuGetDirectory: ${{ github.workspace}}/nuget jobs: + build: - runs-on: ubuntu-22.04 + strategy: + matrix: + dotnet-version: [ 7.x, 8.x, 9.x ] + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: ${{ matrix.dotnet-version }} - name: Setup Nuget Package Sources run: | mkdir -p ${{ env.NuGetDirectory }}/local - nuget sources add -Name local -Source ${{ env.NuGetDirectory }}/local + dotnet nuget add source ${{ env.NuGetDirectory }}/local -n local - uses: actions/download-artifact@v4 with: @@ -39,11 +43,11 @@ jobs: with: ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip working-directory: ${{ env.TESTDIR }} - solution-file-path: plugin-mod.csproj + solution-file-path: plugin-mod-nuget.csproj env: KSPBuildToolsVersion: ${{ inputs.package-version }} - uses: ./.github/actions/assemble-release with: artifacts: ${{ env.TESTDIR }}/GameData - output-file-name: plugin-mod-nuget + output-file-name: plugin-mod-nuget-${{ matrix.dotnet-version }} diff --git a/.github/workflows/internal-test-plugin.yml b/.github/workflows/internal-test-plugin.yml index d21f075..fa96929 100644 --- a/.github/workflows/internal-test-plugin.yml +++ b/.github/workflows/internal-test-plugin.yml @@ -9,9 +9,14 @@ env: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' - uses: ./.github/actions/setup-ckan diff --git a/.github/workflows/publish-to-spacedock.yml b/.github/workflows/publish-to-spacedock.yml index 5180df8..bfe82ca 100644 --- a/.github/workflows/publish-to-spacedock.yml +++ b/.github/workflows/publish-to-spacedock.yml @@ -27,11 +27,11 @@ on: jobs: publish-to-spacedock: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: get-release-info id: get-release-info - uses: KSPModdingLibs/KSPBuildTools/.github/actions/get-release-info@0.0.5 + uses: KSPModdingLibs/KSPBuildTools/.github/actions/get-release-info@1.0.0-alpha.3 with: release-tag: ${{ inputs.release-tag }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f3c4e26..a5a148b 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -6,7 +6,7 @@ on: jobs: validate: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index 3ab1cce..b6d20ad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ bin obj *.nupkg +packages # docs docs/_build diff --git a/CHANGELOG.md b/CHANGELOG.md index 136ef5f..d7fd286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,37 @@ All notable changes to this project will be documented in this file +## 1.0.0-alpha.3 - 2025-11-14 + +### 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) + +### 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 +- `setup-ckan` action: Add `ckan-install-method` option for installation method. Currently supports `'apt'` for installation on Debian/Ubuntu, or `'skip'` to skip installation for runners that already have CKAN installed. +- `assemble-release` action: `outputs.artifact-path` now includes the `.zip` extension (#51) + + ## 0.0.5 - 2025-11-07 Several non-breaking bugfixes backported from the next development version diff --git a/KSPBuildTools.csproj b/KSPBuildTools.csproj index aa6d9f9..79fd85f 100644 --- a/KSPBuildTools.csproj +++ b/KSPBuildTools.csproj @@ -24,7 +24,7 @@ 1701;1702;CS0649;CS1591;NU5128 2024 KSPModdingLibs Contributors KSPBuildTools - $(ProjectDir) + $(ProjectDir) KSPBuildTools README.md KSP Build Tools @@ -38,7 +38,7 @@ - + diff --git a/KSPBuildTools.sln b/KSPBuildTools.sln new file mode 100644 index 0000000..5b01e79 --- /dev/null +++ b/KSPBuildTools.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KSPBuildTools", "KSPBuildTools.csproj", "{F5D90A2D-BF85-4849-9A1B-AD53EE814149}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plugin-mod-legacy", "tests\plugin-mod-legacy\PluginModLegacy\plugin-mod-legacy.csproj", "{F19C7AB4-50C2-4378-9673-CC039CA12E10}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plugin-mod-nuget", "tests\plugin-mod-nuget\plugin-mod-nuget.csproj", "{4F531716-DB82-4AD4-8270-DFB32EE18A41}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plugin-mod", "tests\plugin-mod\plugin-mod.csproj", "{F0E30935-74A7-446F-A30C-5D1D0E525EC5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F5D90A2D-BF85-4849-9A1B-AD53EE814149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5D90A2D-BF85-4849-9A1B-AD53EE814149}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5D90A2D-BF85-4849-9A1B-AD53EE814149}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5D90A2D-BF85-4849-9A1B-AD53EE814149}.Release|Any CPU.Build.0 = Release|Any CPU + {F19C7AB4-50C2-4378-9673-CC039CA12E10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F19C7AB4-50C2-4378-9673-CC039CA12E10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F19C7AB4-50C2-4378-9673-CC039CA12E10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F19C7AB4-50C2-4378-9673-CC039CA12E10}.Release|Any CPU.Build.0 = Release|Any CPU + {4F531716-DB82-4AD4-8270-DFB32EE18A41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F531716-DB82-4AD4-8270-DFB32EE18A41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F531716-DB82-4AD4-8270-DFB32EE18A41}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F531716-DB82-4AD4-8270-DFB32EE18A41}.Release|Any CPU.Build.0 = Release|Any CPU + {F0E30935-74A7-446F-A30C-5D1D0E525EC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0E30935-74A7-446F-A30C-5D1D0E525EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0E30935-74A7-446F-A30C-5D1D0E525EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0E30935-74A7-446F-A30C-5D1D0E525EC5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/KSPCommon.props b/KSPCommon.props index f9ce71c..d46e6b2 100644 --- a/KSPCommon.props +++ b/KSPCommon.props @@ -4,155 +4,94 @@ true - - - true - + + + + false + false - - - true - true - + + false - - - 1.12 1.11 1.10 1.9 1.8 - + + false + false - - - - KSP_x64_Data\Managed - KSP.app\Contents\Resources\Data\Managed - KSP_Data\Managed - - - KSP_x64.exe - KSP.app/Contents/MacOS/KSP - KSP.x86_64 - C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - $(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program + + false + + + false - - + - - $(SolutionDir.TrimEnd([System.IO.Path]::DirectorySeparatorChar)) - GameData/$(SolutionName) - + + $(MSBuildProjectDirectory)/../GameData/$(MSBuildProjectName)/ - - - + + - - - + + 1.12 1.11 1.10 1.9 1.8 - - + + true + true + true + true - - - $(ManagedRelativePath)/Assembly-CSharp.dll - property - + + true - - - - $(KSP_ROOT) - environment variable - - - - - - + + true + true - - - $(SolutionDir)KSP - solution directory - + + true - - - $(ReferencePath) - reference path + true - - - $(SteamKSPRoot) - steam - + + + + false + true + + + 1.12 + 1.8 + 1.12 + + - - - $(KSPRoot)/$(ManagedRelativePath) + + + <_KSPBT_ManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64_Data/Managed + <_KSPBT_ManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/Resources/Data/Managed + <_KSPBT_ManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP_Data/Managed - - Program - $(KSPRoot)\$(KSPExecutable) - $(KSPRoot) - portable + <_KSPBT_GameExecutable Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64.exe + <_KSPBT_GameExecutable Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/MacOS/KSP + <_KSPBT_GameExecutable Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP.x86_64 + <_KSPBT_SteamGameRoot Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program + <_KSPBT_SteamGameRoot Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program - - - - true - - true - - false - $(ManagedPath) - + + + - - - - System (KSP/Mono) - False - - - System (KSP/Mono) - False - - - System.Core (KSP/Mono) - False - - - System.Xml (KSP/Mono) - False - - - - - UnityEngine - False - - - - - Assembly-CSharp - False - - - Assembly-CSharp-firstpass - False - - + + - - + + diff --git a/KSPCommon.targets b/KSPCommon.targets index 0bd520b..f43cd24 100644 --- a/KSPCommon.targets +++ b/KSPCommon.targets @@ -2,91 +2,187 @@ - + + + $(_KSPBT_ManagedRelativePath)/Assembly-CSharp.dll + property + + + + + + $(KSP_ROOT) + environment variable + - - + + + - + + + $(SolutionDir)KSP + solution directory + - - + $(ReferencePath) + reference path + + + + + $(_KSPBT_SteamGameRoot) + steam + + + + + Program + $(KSPBT_GameRoot)/$(_KSPBT_GameExecutable) + $(KSPBT_GameRoot) + portable + + + + + + $(KSPBT_GameRoot)/$(_KSPBT_ManagedRelativePath) + + + + + + true + + true + + false + true + $(KSPBT_ManagedPath) + <_FullFrameworkReferenceAssemblyPaths>$(KSPBT_ManagedPath) + <_TargetFrameworkDirectories>$(KSPBT_ManagedPath) + + + + + + System (KSP/Mono) + False + + + System (KSP/Mono) + False + + + System.Core (KSP/Mono) + False + + + System.Xml (KSP/Mono) + False + + + + + UnityEngine + False + + + + + Assembly-CSharp + False + + + Assembly-CSharp-firstpass + False + + + + + + + Condition="'$(KSPBT_GameRoot)' == ''"/> - <_KSPRootMessage Include="KSPRoot Candidates:"/> - <_KSPRootMessage Include="Candidate: %(KSPRootCandidate.source) from %(KSPRootCandidate.identity)"/> - <_KSPRootMessage Include="Chosen KSPRoot: $(KSPRoot) in $(KSPRootSource)" Condition="'$(KSPRoot)' != ''"/> + <_GameRootMessage Include="KSPBT_GameRoot Candidates:"/> + <_GameRootMessage Include="Candidate: %(KSPBT_GameRootCandidate.source) from %(KSPBT_GameRootCandidate.identity)"/> + <_GameRootMessage Include="Chosen KSPBT_GameRoot: $(KSPBT_GameRoot) in $(KSPBT_GameRootSource)" Condition="'$(KSPBT_GameRoot)' != ''"/> - - + - - + + + KSPBT_ReferenceModAssemblies;$(ResolveAssemblyReferencesDependsOn) + KSPBT_ReferenceModAssemblies;$(KSPBT_GenerateCKANScriptDependsOn) + + - + + %(ModReference.identity) + - - - + + + - $(BaseIntermediateOutputPath)ckancommands.cache + <_CKANScript>$(BaseIntermediateOutputPath)ckancommands.cache - + - <_CKANCompatibleVersionItems Include="$(CKANCompatibleVersions.Split(' '))"/> + <_CKANCompatibleVersionItems Include="$(KSPBT_CKANCompatibleVersions.Split(' '))"/> <_CKANDependency Include="%(Reference.CKANIdentifier)" Condition="'%(Reference.CKANVersion)' == ''"/> <_CKANDependency Include="%(Reference.CKANIdentifier)=%(Reference.CKANVersion)" Condition="'%(Reference.CKANVersion)' != ''"/> <_CKANDependency Include="@(CKANDependency)"/> - @(_CKANDependency, ' ') + <_CKANDependencyList>@(_CKANDependency, ' ') - <_CKANCommands Include="compat add --gamedir "$(KSPROOT)" %(_CKANCompatibleVersionItems.Identity)" - Condition=" '$(CKANCompatibleVersions)' != '' "/> + <_CKANCommands Include="compat add --gamedir "$(KSPBT_GameRoot)" %(_CKANCompatibleVersionItems.Identity)" + Condition=" '$(KSPBT_CKANCompatibleVersions)' != '' "/> - <_CKANCommands Include="install --no-recommends --gamedir "$(KSPROOT)" $(CKANDependencyList)" Condition="'$(CKANDependencyList)' != ''"/> + <_CKANCommands Include="install --no-recommends --gamedir "$(KSPBT_GameRoot)" $(_CKANDependencyList)" Condition="'$(_CKANDependencyList)' != ''"/> - + - + - - - - - - - - - - + + KSPBT_InstallCKANDependencies;$(ResolveAssemblyReferencesDependsOn) + + + - - - - - - - + + - - + + <_Parameter1>$(AssemblyName) @@ -109,10 +205,10 @@ Otherwise CKANVersion is used. Otherwise 0.0 is used (no minimum version) --> - + - + $([System.String]::Copy('%(Reference.identity)').Split(',')[0]) %(Reference.CKANVersion) 0.0 @@ -147,16 +243,12 @@ - - - 1.12 - 1.8 - 1.12 - - + - + $(ProjectName) @@ -196,4 +288,15 @@ + + + + + <_BinariesToCopy Include="$(TargetDir)/**/*.dll"/> + <_BinariesToCopy Include="$(TargetDir)/**/*.pdb" Condition="'$(Condition)' == 'Debug'"/> + + + + diff --git a/docs/actions/compile.md b/docs/actions/compile.md index 995d733..649c957 100644 --- a/docs/actions/compile.md +++ b/docs/actions/compile.md @@ -6,7 +6,9 @@ ```{warning} Due to the [handover of the Mono project](https://github.com/mono/mono/issues/21796), the `ubuntu-latest` github runner [does not currently include mono or nuget](https://github.com/actions/runner-images/issues/10636#issuecomment-2375010324). -Please use the `ubuntu-22.04` runner for this action. +Please use the `ubuntu-22.04` runner image or install nuget yourself when `use-nuget-restore` is `'true'`. + +This does not affect projects that use `packagereference` ``` ```` \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 3569d07..cf07543 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,8 +9,8 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'KSPBuildTools' -copyright = '2024, KSPModdingLibs Contributors' +project = 'KSP Build Tools' +copyright = '2025, KSPModdingLibs Contributors' author = 'KSPModdingLibs Contributors' # -- General configuration --------------------------------------------------- @@ -24,7 +24,7 @@ # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'sphinx_rtd_theme' +html_theme = 'sphinx_book_theme' html_static_path = ['_static'] # -- Options for myst-parser ------------------------------------------------- diff --git a/docs/msbuild/configuration.md b/docs/msbuild/configuration.md new file mode 100644 index 0000000..9626663 --- /dev/null +++ b/docs/msbuild/configuration.md @@ -0,0 +1,175 @@ +# Configuration + +## Properties + +```{confval} 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)`. +``` + +```{confval} KSPBT_ModPluginFolder +--- +default: `./` +--- + +the directory where compiled binaries should be copied. This is relative to the {confval}`KSPBT_ModRoot`. The DLLs will be copied to this directory after each build. +``` + +```{confval} 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 +``` + +```{confval} KSPBT_ReferenceSystemAssemblies +--- +default: `true` +--- +If set to `true`, adds assembly references to Mono System DLLs. +``` + +```{confval} KSPBT_ReferenceUnityAssemblies +--- +default: `true` +--- +If set to `true`, adds assembly references to all UnityEngine assemblies in the KSP install. +``` + +```{confval} 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. +``` + +```{confval} KSPBT_ReferenceModAssemblies +--- +default: `true`, except in the `Unity` configuration +--- +If set to `true`, adds references to the assemblies included in `ModReference` list. +``` + +```{confval} KSPBT_GenerateAssemblyAttribute +--- +default: `true`, except in the `Unity` configuration +--- +If set to `true`, automatically generates the `KSPAssembly` for your assembly from the `Version` property. +``` + +```{confval} 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`. +``` + +```{confval} KSPBT_CopyDLLsToPluginFolder +--- +default: `true`, except in the `Unity` configuration +--- +If set to `true`, automatically copies the compiled DLL to the {confval}`KSPBT_ModPluginFolder`. +``` + +```{confval} KSPBT_GenerateVersionFile +--- +default: `true`, except in the `Unity` configuration +--- +If set to `true`, automatically generates a version file using the information in any {confval}`KSPVersionFile` items. Without defining a {confval}`KSPVersionFile`, nothing will be generated. See [](generating-version-files.md/) for more details. +``` + +````{confval} 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](getting-started.md/#locating-your-ksp-install) +```` + +## Items + +````{confval} 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 [](dependencies.md) for examples. + +```{rubric} Metadata +``` + +```{describe} Identity +The name of the mod you are referencing, as set in that mod's `KSPAssemblyAttribute` +``` + +```{describe} DLLPath +The path of the mod's assembly to reference when building, relative to {confval}`KSPBT_GameRoot`. +``` + +```{describe} CKANIdentifier +The name of the mod in CKAN to install before building. +``` + +```{describe} CKANVersion +The specific version to install from CKAN, if any. +``` + +Any additional metadata is copied to the resulting [`Reference`](https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2022#reference) item +```` + +````{confval} KSPVersionFile +Defines a version file to generate. See [](generating-version-files.md) for examples. + +```{rubric} Metadata +``` + +```{describe} 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 +``` +```{describe} Destination +Path to where the generated json version file should be placed +``` + +```{confval} Name +--- +default: `$(ProjectName)` +--- +The mod name. Corresponds to the `NAME` value in json. +``` + +```{confval} Version +--- +default: `$(FileVersion)` +--- +The mod version. Corresponds with the `VERSION` value in json. +``` + +```{describe} URL +The URL of the remote version file. Corresponds with the `URL` value in json. +``` + +```{describe} Download +Where to link players to update your mod. Corresponds with the `DOWNLOAD` value in json. +``` + +```{confval} KSP_Version +--- +default: `1.12` +--- +The KSP version the mod is targeting. Corresponds with the `KSP_VERSION` value in json. +``` + +```{confval} KSP_Version_Min +--- +default: `1.8` +--- +The minimum supported KSP version. Corresponds with the `KSP_VERSION_MIN` value in json. +``` + +```{confval} KSP_Version_Max +--- +default: `1.12` +--- +The maximum supported KSP version. Corresponds with the `KSP_VERSION_MAX` value in json. +``` + +```` diff --git a/docs/msbuild/dependencies.md b/docs/msbuild/dependencies.md index b1dffb2..a9bbc2e 100644 --- a/docs/msbuild/dependencies.md +++ b/docs/msbuild/dependencies.md @@ -4,33 +4,31 @@ KSPBuildTools can help manage other mods that you depend on ## Referencing Dependency DLLs -Mod DLLs should be referenced as with any other DLLs, like so. See [the Microsoft docs on Reference items](https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2022#reference) for more info. Make sure that `False`{l=xml} is set or the DLL will be copied to your output directory. +Mod DLLs should be referenced with the {confval}`ModReference` item, like so. -the {confval}`KSPRoot` property can be used to reference the KSP install wherever it is. ```xml - - False - - - $(KSPRoot)/GameData/000_Harmony/0Harmony.dll - False - + + GameData/Modulemanager*.dll + + + GameData/000_Harmony/0Harmony.dll + ``` ## Installing Dependencies Automatically -KSPBuildTools can install CKAN mods automatically when built. This is useful for CI workflows such as those using the {gha:action}`compile` action, or to make it easier for others to compile your mod themselves. Either add the `` metadata to your `` items, or if the dependency mod doesn't have a dll you need to reference you can use the `` item. +KSPBuildTools can install CKAN mods automatically when built. This is useful for CI workflows such as those using the {gha:action}`compile` action, or to make it easier for others to compile your mod themselves. Either add the `` metadata to your `` items, or if the dependency mod doesn't have a dll you need to reference you can use the `` item. ```xml - - False + + GameData/Modulemanager*.dll ModuleManager - + @@ -42,11 +40,11 @@ You can also mark explicit versions to install. ```xml - - False + + GameData/Modulemanager*.dll ModuleManager 4.2.3 - + @@ -59,26 +57,32 @@ KSP mods should mark their dependency DLLs using the `KSPAssemblyDependency` att `[assembly: KSPAssemblyDependency("0Harmony", 0, 0, 0)]`{l=csharp} -If the {confval}`GenerateKSPAssemblyDependencyAttributes` property is set to `true`, KSPBuildTools will generate these attributes automatically. It uses any `Reference` item that has a `` or `` metadata value. +If the {confval}`KSPBT_GenerateDependencyAttributes` property is set to `true` (the default), KSPBuildTools will generate these attributes automatically. -The assembly name is set to the `` metadata value, and falls back to the `` metadata value. +The assembly name is taken from the value of the item. The version is taken from the `` metadata value, however leaving it at the default of 0.0.0 is usually acceptable ```xml - - False + + GameData/TweakScale/plugins/Scale.dll TweakScaleRescaled - Scale 3.2.0 - + +``` + +To disable generating the `KSPAssemblyDependency` attribute for a single dependency (for example, if it lacks the `KSPAssembly` attribute), you can set `GenerateDependencyAttribute` to false - - - true - true - +```xml + + + + GameData/TweakScale/plugins/Scale.dll + TweakScaleRescaled + false + + ``` diff --git a/docs/msbuild/generating-version-files.md b/docs/msbuild/generating-version-files.md index 43e72c5..27d7839 100644 --- a/docs/msbuild/generating-version-files.md +++ b/docs/msbuild/generating-version-files.md @@ -8,7 +8,7 @@ To use, add the following to your csproj, filling in the URLs and paths for your - $(RepoRootPath)GameData/MyMod/mymod.version + $(KSPBT_ModRoot)/mymod.version https://github.com/username/repo/releases/latest/download/mymod.version https://github.com/username.repo/releases/latest @@ -44,7 +44,7 @@ The `include` value can also be set to a json file including any other values yo - $(RepoRootPath)GameData/MyMod/mymod.version + $(KSPBT_ModRoot)/mymod.version ``` \ No newline at end of file diff --git a/docs/msbuild/getting-started.md b/docs/msbuild/getting-started.md index b3db452..66d6bbc 100644 --- a/docs/msbuild/getting-started.md +++ b/docs/msbuild/getting-started.md @@ -76,9 +76,9 @@ KSPBuildTools needs to know where you have KSP installed in order to reference t There are several options for this. KSPBuildTools will choose in the following order. Either [autodiscovery in the solution directory](#solution-directory) or [setting a reference path in a .user file](#environment-variable) are the recommended methods for most users. -### KSPRoot MSBuild Property +### KSPBT_GameRoot MSBuild Property -If the {confval}`KSPRoot` MSBuild property is already set, KSPBuildTools will use it as-is. This can be set in your .csproj.user file. +If the {confval}`KSPBT_GameRoot` MSBuild property is already set, KSPBuildTools will use it as-is. This can be set in your .csproj.user file. ### Environment Variable diff --git a/docs/msbuild/index.md b/docs/msbuild/index.md index 94911d4..04e5588 100644 --- a/docs/msbuild/index.md +++ b/docs/msbuild/index.md @@ -23,6 +23,6 @@ maxdepth: 1 getting-started generating-version-files dependencies -properties +configuration ``` diff --git a/docs/msbuild/properties.md b/docs/msbuild/properties.md deleted file mode 100644 index 97d35e2..0000000 --- a/docs/msbuild/properties.md +++ /dev/null @@ -1,51 +0,0 @@ -# MSBuild Properties - -```{confval} KSPRoot -This property should be set to the root directory of your KSP install. You should not set this in your csproj, see [Locating your KSP Install](getting-started.md/#locating-your-ksp-install) -``` - -```{confval} RepoRootPath ---- -default: `$(SolutionDir)` ---- - -specifies the root directory of your mod repository. Generally you'll want to set this to be relative to the csproj file using `$(MSBuildThisFileDirectory)`. -``` - -```{confval} BinariesOutputRelativePath ---- -default: `GameData/$(SolutionName)` ---- - -the directory where compiled binaries should be copied. This is relative to the `RepoRootPath`. The binaries will be copied to this directory after each build. -``` - -```{confval} 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 -``` - -```{confval} GenerateKSPAssemblyAttribute -If set to `true`, automatically generates the `KSPAssembly` for your assembly from the `Version` property. -``` - -```{confval} GenerateKSPAssemblyDependencyAttributes -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`. -``` - -```{confval} ReferenceUnityAssemblies ---- -default: `true` ---- -If set to `true`, adds assembly references to all UnityEngine assemblies in the KSP install. You can set this to `false` to opt out of this behavior if you want to create a pure C# assembly that does not depend on Unity. -``` - -```{confval} ReferenceKSPAssemblies ---- -default: `true` ---- -If set to `true`, adds references to Assembly-CSharp and Assembly-CSharp-firstpass assemblies from the KSP install. You can set this to `false` to opt out of this behavior. -``` diff --git a/docs/requirements.in b/docs/requirements.in index 8995899..5f8e8fe 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -1,5 +1,5 @@ sphinx>=8 -sphinx-rtd-theme>=2.0.0 +sphinx-book-theme sphinx-copybutton sphinx-gha sphinx-jinja>=2 \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index d9f8631..60c0f20 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,28 +1,30 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --output-file=docs/requirements.txt --strip-extras docs/requirements.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile --output-file=docs/requirements.txt --strip-extras docs/requirements.in +accessible-pygments==0.0.5 + # via pydata-sphinx-theme alabaster==1.0.0 # via sphinx -babel==2.16.0 - # via sphinx -certifi==2024.8.30 +babel==2.17.0 + # via + # pydata-sphinx-theme + # sphinx +beautifulsoup4==4.14.2 + # via pydata-sphinx-theme +certifi==2025.10.5 # via requests -charset-normalizer==3.4.0 +charset-normalizer==3.4.4 # via requests docutils==0.21.2 # via # myst-parser + # pydata-sphinx-theme # sphinx # sphinx-jinja - # sphinx-rtd-theme -gitdb==4.0.11 +gitdb==4.0.12 # via gitpython -gitpython==3.1.43 +gitpython==3.1.45 # via sphinx-gha -idna==3.10 +idna==3.11 # via requests imagesize==1.4.1 # via sphinx @@ -35,58 +37,71 @@ markdown-it-py==3.0.0 # via # mdit-py-plugins # myst-parser -markupsafe==3.0.2 +markupsafe==3.0.3 # via jinja2 -mdit-py-plugins==0.4.2 +mdit-py-plugins==0.5.0 # via myst-parser mdurl==0.1.2 # via markdown-it-py -myst-parser==4.0.0 +myst-parser==4.0.1 # via sphinx-gha -packaging==24.1 - # via sphinx -pygments==2.18.0 - # via sphinx -pyyaml==6.0.2 +packaging==25.0 # via - # myst-parser - # sphinx-gha -requests==2.32.4 + # pydata-sphinx-theme + # sphinx +pydata-sphinx-theme==0.15.4 + # via sphinx-book-theme +pygments==2.19.2 + # via + # accessible-pygments + # pydata-sphinx-theme + # sphinx +pyyaml==6.0.3 + # via myst-parser +requests==2.32.5 # via sphinx -smmap==5.0.1 +roman-numerals-py==3.1.0 + # via sphinx +ruamel-yaml==0.18.16 + # via sphinx-gha +smmap==5.0.2 # via gitdb -snowballstemmer==2.2.0 +snowballstemmer==3.0.1 # via sphinx -sphinx==8.1.3 +soupsieve==2.8 + # via beautifulsoup4 +sphinx==8.2.3 # via - # -r requirements.in + # -r docs/requirements.in # myst-parser + # pydata-sphinx-theme + # sphinx-book-theme # sphinx-copybutton # sphinx-gha # sphinx-jinja - # sphinx-rtd-theme - # sphinxcontrib-jquery +sphinx-book-theme==1.1.4 + # via -r docs/requirements.in sphinx-copybutton==0.5.2 - # via -r requirements.in -sphinx-gha==0.1.0 - # via -r requirements.in + # via -r docs/requirements.in +sphinx-gha==1.0.0 + # via -r docs/requirements.in sphinx-jinja==2.0.2 - # via -r requirements.in -sphinx-rtd-theme==3.0.1 - # via -r requirements.in + # via -r docs/requirements.in sphinxcontrib-applehelp==2.0.0 # via sphinx sphinxcontrib-devhelp==2.0.0 # via sphinx sphinxcontrib-htmlhelp==2.1.0 # via sphinx -sphinxcontrib-jquery==4.1 - # via sphinx-rtd-theme sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-qthelp==2.0.0 # via sphinx sphinxcontrib-serializinghtml==2.0.0 # via sphinx +typing-extensions==4.15.0 + # via + # beautifulsoup4 + # pydata-sphinx-theme urllib3==2.5.0 # via requests diff --git a/include/Log.cs b/include/unity/Log.cs similarity index 100% rename from include/Log.cs rename to include/unity/Log.cs diff --git a/tests/plugin-mod-legacy/PluginModLegacy/plugin-mod-legacy.csproj b/tests/plugin-mod-legacy/PluginModLegacy/plugin-mod-legacy.csproj index b269787..3f4a53a 100644 --- a/tests/plugin-mod-legacy/PluginModLegacy/plugin-mod-legacy.csproj +++ b/tests/plugin-mod-legacy/PluginModLegacy/plugin-mod-legacy.csproj @@ -13,6 +13,7 @@ + true true @@ -50,10 +51,6 @@ prompt MinimumRecommendedRules.ruleset - - $(MSBuildThisFileDirectory)../ - GameData/plugin-mod-legacy - diff --git a/tests/plugin-mod-nuget/plugin-mod.csproj b/tests/plugin-mod-nuget/plugin-mod-nuget.csproj similarity index 66% rename from tests/plugin-mod-nuget/plugin-mod.csproj rename to tests/plugin-mod-nuget/plugin-mod-nuget.csproj index 68f03b2..f7d0863 100644 --- a/tests/plugin-mod-nuget/plugin-mod.csproj +++ b/tests/plugin-mod-nuget/plugin-mod-nuget.csproj @@ -3,6 +3,8 @@ *-* + plugin-mod + true @@ -22,29 +24,23 @@ 1701;1702;CS0649;CS1591; 2024 KSPModdingLibs Contributors PluginModNuget - $(MSBuildThisFileDirectory) - GameData/plugin-mod-nuget + $(MSBuildThisFileDirectory)/GameData/$(MSBuildProjectName) - - $(KSPRoot)/GameData/000_Harmony/0Harmony.dll + + GameData/000_Harmony/0Harmony.dll Harmony2 2.2.1.0 False - + - $(RepoRootPath)$(BinariesOutputRelativePath)/plugin-mod-nuget.version + $(KSPBT_ModRoot)/plugin-mod-nuget.version - - - true - true - diff --git a/tests/plugin-mod-nuget/pluginModNuget.cs b/tests/plugin-mod-nuget/pluginModNuget.cs new file mode 100644 index 0000000..6d97374 --- /dev/null +++ b/tests/plugin-mod-nuget/pluginModNuget.cs @@ -0,0 +1,6 @@ +using KSPBuildTools; +using UnityEngine; +using HarmonyLib; +using System.Collections.Generic; + +public class pluginModNuget { } \ No newline at end of file diff --git a/tests/plugin-mod/plugin-mod.csproj b/tests/plugin-mod/plugin-mod.csproj index 4a3cc0f..e9e3c09 100644 --- a/tests/plugin-mod/plugin-mod.csproj +++ b/tests/plugin-mod/plugin-mod.csproj @@ -6,6 +6,10 @@ all runtime; build; native; contentfiles; analyzers + + all + runtime; build; native; contentfiles; analyzers + @@ -17,31 +21,25 @@ 1701;1702;CS0649;CS1591; 2024 KSPModdingLibs Contributors PluginMod - $(MSBuildThisFileDirectory) - GameData/plugin-mod + $(MSBuildThisFileDirectory)/GameData/$(MSBuildProjectName) + true - - $(KSPRoot)/GameData/000_Harmony/0Harmony.dll + + GameData/000_Harmony/0Harmony.dll Harmony2 2.2.1.0 - False - + - $(RepoRootPath)$(BinariesOutputRelativePath)/plugin-mod.version + $(KSPBT_ModRoot)/plugin-mod.version - - true - true - -