|
1 | 1 | # Ionide.KeepAChangelog |
2 | 2 |
|
3 | | -This project implements a Changelog parser according to the spec at KeepAChangelog. It also provides MSBuild tasks and targets to automate the setting of Versions and Package Release Notes for your NuGet packages, so that the Changelogs are your source of truth. |
| 3 | +This project implements a Changelog parser according to the spec at KeepAChangelog. It also provides MSBuild tasks and targets to automate the setting of **Versions** and **Package Release Notes** for your NuGet packages, so that the Changelogs are your source of truth. |
4 | 4 |
|
5 | | -## TBDs before release |
6 | | - |
7 | | -* [ ] think about how to use CHANGELOG as the source of truth in this project (seems a bit circular now) |
| 5 | +When configured, this package will set the `Version`, `PackageVersion`, and `PackageReleaseNotes` of your packable project with the matching data from the latest Changelog release, as well as adding AssemblyMetadata for the `BuildDate` in the `YYYY-mm-dd` format. |
8 | 6 |
|
9 | 7 | ## Installation |
10 | 8 |
|
11 | 9 | The MSBuild package is authored as a set of tasks and targets that are used automatically. You just have to install the `Ionide.KeepAChangelog.Tasks` package and you're all set! |
12 | 10 |
|
| 11 | +```xml |
| 12 | +<ItemGroup> |
| 13 | + <PackageReference Include="Ionide.KeepAChangelog.Tasks" Version="<insert here>" PrivateAssets="all" /> |
| 14 | +</ItemGroup> |
| 15 | +``` |
| 16 | + |
| 17 | +## Examples |
| 18 | + |
| 19 | +It might be helpful to see how this library can help you. Imagine you have a project file like this: |
| 20 | + |
| 21 | +```xml |
| 22 | +<Project Sdk="Microsoft.NET.Sdk"> |
| 23 | + <PropertyGroup> |
| 24 | + <TargetFramework>netstandard2.0</TargetFramework> |
| 25 | + <GenerateDocumentationFile>true</GenerateDocumentationFile> |
| 26 | + </PropertyGroup> |
| 27 | + <ItemGroup> |
| 28 | + <Compile Include="Main.fs" /> |
| 29 | + </ItemGroup> |
| 30 | +</Project> |
| 31 | +``` |
| 32 | + |
| 33 | +and a CHANGELOG.md file like this: |
| 34 | + |
| 35 | +```md |
| 36 | +# Changelog |
| 37 | + |
| 38 | +## 1.0.0 - 2022-01-14 |
| 39 | + |
| 40 | +### Added |
| 41 | + |
| 42 | +* Initial release |
| 43 | +``` |
| 44 | + |
| 45 | +packaging the project with this library results in the same result as packing a project that looks like this: |
| 46 | + |
| 47 | +```xml |
| 48 | +<Project Sdk="Microsoft.NET.Sdk"> |
| 49 | + <PropertyGroup> |
| 50 | + <TargetFramework>netstandard2.0</TargetFramework> |
| 51 | + <GenerateDocumentationFile>true</GenerateDocumentationFile> |
| 52 | + <Versions>1.0.0</Versions> |
| 53 | + <ReleaseNotes> |
| 54 | +## 1.0.0 - 2022-01-14 |
| 55 | + |
| 56 | +### Added |
| 57 | + |
| 58 | +* Initial release |
| 59 | + </ReleaseNotes> |
| 60 | + </PropertyGroup> |
| 61 | + <ItemGroup> |
| 62 | + <Compile Include="Main.fs" /> |
| 63 | + </ItemGroup> |
| 64 | +</Project> |
| 65 | +``` |
| 66 | + |
| 67 | +If your changelog has multiple versions, the latest one will be used. |
| 68 | + |
13 | 69 | ## Customization |
14 | 70 |
|
15 | 71 | There's really only one property that matters for these targets, and that's `ChangelogFile`. This needs to point to the Changelog file you want to read, but it defaults to `CHANGELOG.md` in the root of a given project in case you want to adhere to defaults. |
|
0 commit comments