You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-12Lines changed: 62 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ What it does:
25
25
- Provides a standard way to copy output files that works on all operating systems
26
26
- Sets the debug symbols format to portable so that you can [debug your mod](https://gist.github.com/gotmachine/d973adcb9ae413386291170fa346d043)
27
27
- 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
28
29
- Designed to be used by the [Build github workflow](#compile-action)
29
30
30
31
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
60
61
- 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.
61
62
- 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.
62
63
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
+
63
70
### Customization
64
71
65
72
Properties can be customized at several points:
@@ -68,6 +75,29 @@ Properties can be customized at several points:
68
75
- Per-mod properties for mods with more than one `.csproj` file should be set in `$(SolutionName).props` which will be imported by `KSPCommon.props`
69
76
- 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.
70
77
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):
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
+
71
101
# update-version.sh
72
102
73
103
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.
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!
147
177
148
178
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.
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.
228
258
229
259
Inputs:
230
260
231
261
*`dependency-identifiers`
232
262
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`.
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.
246
281
247
282
Inputs:
248
283
249
284
*`version-string`
250
-
*`template-extension`
251
-
*`files`
252
285
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`
254
289
255
-
*`git-stage`
290
+
Optional. Default: `CHANGELOG.md`
256
291
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.
258
293
259
-
*`delete-template-files`
294
+
*`changelog-output-file`
260
295
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`.
262
309
263
310
*`ksp-build-tools-root`
264
311
265
312
Where to download `update-version.sh`.
266
313
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