Skip to content

Commit eddc17b

Browse files
authored
Fix #14: add documentation on changelogs and other stuff
1 parent 4f899b7 commit eddc17b

File tree

1 file changed

+62
-12
lines changed

1 file changed

+62
-12
lines changed

README.md

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ What it does:
2525
- Provides a standard way to copy output files that works on all operating systems
2626
- Sets the debug symbols format to portable so that you can [debug your mod](https://gist.github.com/gotmachine/d973adcb9ae413386291170fa346d043)
2727
- Sets up Visual Studio's debugging start actions so you can launch KSP directly from VS
28+
- Includes a target for installing dependencies with CKAN
2829
- Designed to be used by the [Build github workflow](#compile-action)
2930

3031
To use it, import KSPCommon.targets in your .csproj file after it imports Microsoft.CSharp.targets. You should remove ALL the existing assembly references to `System`, `Assembly-CSharp`, and `Unity`.
@@ -60,6 +61,12 @@ This property should be set to the root directory of your KSP install. If it is
6061
- If `$(SolutionDir)KSP/buildID.txt` exists, then `$(SolutionDir)KSP` becomes the value of the `KSPRoot` property. This could be a full copy of a KSP install, or just a symlink or junction to one.
6162
- If `KSPRoot` still isn't set, then it will default to `C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program` on Windows or `$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program` on OSX.
6263

64+
#### `CKANCompatibleVersions`
65+
66+
Default value: `1.12 1.11 1.10 1.9 1.8`
67+
68+
Used by the `CKANInstall` target to set additional KSP versions to treat as compatible when installing dependencies.
69+
6370
### Customization
6471

6572
Properties can be customized at several points:
@@ -68,6 +75,29 @@ Properties can be customized at several points:
6875
- Per-mod properties for mods with more than one `.csproj` file should be set in `$(SolutionName).props` which will be imported by `KSPCommon.props`
6976
- Per-user properties should be set in `KSPCommon.props.user`. This is usually where you want to set the path to your KSP installation. You should have `.user` files added to your `.gitignore` file.
7077

78+
### Referencing Dependencies
79+
80+
Referencing assemblies (DLLs) from other mods should be done with a HintPath relative to `$(KSPRoot)`. In addition, you can include the CKAN identifier of the mod to make it installable with the `CKANInstall` target.
81+
82+
Example from [Shabby](https://github.com/KSPModdingLibs/Shabby/blob/e61ec5084b83c7e6941e62f43439cdd28fe867e6/Source/Shabby.csproj#L30):
83+
84+
```
85+
<Reference Include="0Harmony, Culture=neutral, PublicKeyToken=null">
86+
<HintPath>$(KSPRoot)/GameData/000_Harmony/0Harmony.dll</HintPath>
87+
<CKANIdentifier>Harmony2</CKANIdentifier>
88+
</Reference>
89+
```
90+
91+
### CKANInstall target
92+
93+
This is a build target that you can invoke with msbuild to install all the dependencies of your mod using CKAN. Each dependency should be marked with its `CKANIdentifier` as shown above. Dependencies will be installed in `$(KSPRoot)`. It may also be invoked from the [`install-dependencies`](#install-dependencies) action.
94+
95+
Example usage:
96+
97+
```
98+
msbuild -t:CKANInstall
99+
```
100+
71101
# update-version.sh
72102

73103
This is a bash shell script that can update version numbers in several text files (AssemblyInfo.cs, .version files, readme, etc). All it does is process files with a common extension and replaces certain tokens in them.
@@ -143,7 +173,7 @@ For details:
143173

144174
## [create-release](https://github.com/KSPModdingLibs/KSPBuildTools/blob/main/.github/workflows/create-release.yml)
145175

146-
Builds and packages a new version of mod.
176+
Builds and packages a new version of mod. You can reference this workflow in your own repository on `workflow-dispatch` and have the user type in a version number. Then it does the rest!
147177

148178
After running `update-version`, this workflow commits the version file changes and creates a new tag. Then it runs `compile` and `assemble-release`. And then finally it creates a draft github release with the packaged mod attached.
149179

@@ -224,13 +254,18 @@ Inputs:
224254

225255
## [install-dependencies](https://github.com/KSPModdingLibs/KSPBuildTools/blob/main/.github/actions/install-dependencies/action.yml)
226256

227-
Uses CKAN to install any dependent mods so that your code can be compiled against them.
257+
Uses CKAN to install any dependent mods so that your code can be compiled against them. At least one of `dependency-identifiers` or `msbuild-dependency-target` should be specified, or this action won't do anything.
228258

229259
Inputs:
230260

231261
* `dependency-identifiers`
232262

233-
A list of mod identifiers to install
263+
Optional. A list of mod identifiers to install
264+
265+
* `msbuild-dependency-target`
266+
267+
Optional. The name of a msbuild target to build in order to install dependencies.
268+
If your dependencies are specified in the .csproj file using `CKANIdentifier` and you're using the standard `KSPCommon.targets` file, then you should set this to `CKANInstall`.
234269

235270
* `ckan-compatible-versions`
236271

@@ -242,26 +277,41 @@ Inputs:
242277

243278
## [update-version](https://github.com/KSPModdingLibs/KSPBuildTools/blob/main/.github/actions/update-version/action.yml)
244279

245-
Runs [update-version.sh](#update-version.sh) to replace version tokens in several text files. TODO: support in-repo installs of KSPBuildTools. NOTE: this section is out of date and needs to be updated
280+
Uses `yaclog` and `yaclog-ksp` to update a changelog and get release notes. Then runs [update-version.sh](#update-version.sh) to replace version tokens in several text files. All modifications will be staged to git but not committed.
246281

247282
Inputs:
248283

249284
* `version-string`
250-
* `template-extension`
251-
* `files`
252285

253-
Correspond to the inputs to `update-version.sh`.
286+
Required. A version number in major.minor.patch.build form, or one of the special strings `--major` `--minor` `--patch` which will increment the version based on the most recent entry in the changelog file.
287+
288+
* `changelog-input-file`
254289

255-
* `git-stage`
290+
Optional. Default: `CHANGELOG.md`
256291

257-
Corresponds to the `-g` input to `update-version.sh`.
292+
The name of a changelog file to use. Should be formatted according to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), with a `## Unreleased` section at the top for changes that are pending release. `yaclog release` will be invoked which replaces the `## Unreleased` section with the version number and the date stamp.
258293

259-
* `delete-template-files`
294+
* `changelog-output-file`
260295

261-
Corresponds to the `-d` input to `update-version.sh`.
296+
Optional. If specified, this action will run `yaclog-ksp` on the changelog input file which generates a changelog .cfg file suitable for [Kerbal Changelog](https://github.com/HebaruSan/KerbalChangelog/blob/master/README.md). As such, `changelog-output-file` should be somewhere in your mod's artifact path so that it will be included when the mod is installed.
297+
298+
* `release-notes-output-file`
299+
300+
Optional. If specified, uses `yaclog` to save the most recent changelog info in markdown format to this file. This can then be used by the [`assemble-release` action](#assemble-release).
301+
302+
* `template-extension`
303+
304+
Corresponds to the input to `update-version.sh`. Defaults to `.versiontemplate`
305+
306+
* `files`
307+
308+
Corresponds to the input to `update-version.sh`.
262309

263310
* `ksp-build-tools-root`
264311

265312
Where to download `update-version.sh`.
266313

267-
314+
Outputs:
315+
316+
* The final version string is saved in `VERSION_STRING` as an environment variable and `outputs.version-string`
317+
* The path to the release notes file is saved in `RELEASE_NOTES_FILE` as an environment variable and `outputs-release-notes-output-file`

0 commit comments

Comments
 (0)