Skip to content

Commit 2825ced

Browse files
committed
readme updates and add assembly info about the date
1 parent b1bf574 commit 2825ced

File tree

5 files changed

+81
-8
lines changed

5 files changed

+81
-8
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22

3-
## [Unreleased]
3+
## [0.1.1] - 2022.01.14
4+
5+
### Added
6+
7+
- Now writes an assembly-level AssemblyMetadataAttribute with the key "BuildDate" whose
8+
value is the `YYYY-mm-dd`-formatted date in the release changelog
9+
10+
## [0.1.0] - 2022.01.13
411

512
### Added
613

README.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,71 @@
11
# Ionide.KeepAChangelog
22

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.
44

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.
86

97
## Installation
108

119
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!
1210

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+
1369
## Customization
1470

1571
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.

src/Ionide.KeepAChangelog.Tasks/Ionide.KeepAChangelog.Tasks.fsproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
<DebugType>embedded</DebugType>
99
<IsPackable>true</IsPackable>
1010
<Description>MSBuild Tasks and Targets that set your Assembly Version, Package Version, and Package Release Notes from your KeepAChangelog-compatible Changelogs.</Description>
11-
<Version>0.1.0</Version>
12-
<PackageReleaseNotes>Initial release of the Changelog parsing tasks.</PackageReleaseNotes>
11+
<Version>0.1.1</Version>
12+
<PackageReleaseNotes>### Added
13+
14+
- Now writes an assembly-level AssemblyMetadataAttribute with the key "BuildDate" whose value is the `YYYY-mm-dd`-formatted date in the release changelog
15+
</PackageReleaseNotes>
1316
</PropertyGroup>
1417

1518
<ItemGroup>

src/Ionide.KeepAChangelog.Tasks/build/Ionide.KeepAChangelog.Tasks.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
<PackageVersion>%(CurrentReleaseChangelog.Identity)</PackageVersion>
2929
<PackageReleaseNotes>@(LatestReleaseNotes)</PackageReleaseNotes>
3030
</PropertyGroup>
31+
32+
<ItemGroup Condition="'@(CurrentReleaseChangelog)' != '' and '$(GenerateAssemblyInfo)' == 'true'">
33+
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(GenerateRepositoryUrlAttribute)' == 'true' and ('$(RepositoryUrl)' != '' or '$(PublishRepositoryUrl)' == 'true')" >
34+
<_Parameter1>BuildDate</_Parameter1>
35+
<_Parameter2>%(CurrentReleaseChangelog.Date)</_Parameter2>
36+
</AssemblyAttribute>
37+
</ItemGroup>
3138
</Target>
3239

3340
</Project>

src/Ionide.KeepAChangelog/Ionide.KeepAChangelog.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<DebugType>embedded</DebugType>
77
<IsPackable>true</IsPackable>
88
<Description>A self-contained parser for the KeepAChangelog format.</Description>
9-
<Version>0.1.0</Version>
9+
<Version>0.1.1</Version>
1010
<PackageReleaseNotes>Initial release of the KeepAChangelog parser.</PackageReleaseNotes>
1111
</PropertyGroup>
1212

0 commit comments

Comments
 (0)