This is part of the Fake.Core.ReleaseNotes module.

Changelog

Contains helpers which allow to parse Change log text files. These files have to be in a format as described on http://keepachangelog.com/en/0.1.0/

Sample

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
let changelogFile = "CHANGELOG.md"
let newVersion = "1.0.0"

Target.create "AssemblyInfo" (fun _ ->
    let changelog = changeLogFile |> Changelog.load
    CreateFSharpAssemblyInfo "src/Common/AssemblyInfo.fs"
      [ Attribute.Title project
        Attribute.Product project
        Attribute.Description summary
        Attribute.Version changelog.LatestEntry.AssemblyVersion
        Attribute.FileVersion changelog.LatestEntry.AssemblyVersion]
)

Target.create "Promote Unreleased to new version" (fun _ ->
    let newChangelog = 
        changelogFile 
        |> ChangeLog.load
        |> ChangeLog.promoteUnreleased newVersion
        |> ChangeLog.save changelogFile
)
val changelogFile : string
val newVersion : string

Nested types and modules

TypeDescription
Change
ChangeText
Changelog
ChangelogEntry
Unreleased

Functions and values

Function or valueDescription
Changelog.appendNewlines
Signature: string -> string
Changelog.assemblyVersionRegex
Signature: Regex
Changelog.betweenNewlines(x)
Signature: x:string -> string
Changelog.concat(strings)
Signature: strings:seq<string> -> string
Changelog.contains search line
Signature: search:string -> line:string -> bool
Changelog.containsUnreleasedHeader(line)
Signature: line:string -> bool
Changelog.create(...)
Signature: description:string option -> unreleased:Unreleased option -> entries:ChangelogEntry list -> Changelog
Changelog.createWithCustomHeader(...)
Signature: header:string -> description:string option -> unreleased:Unreleased option -> entries:ChangelogEntry list -> Changelog
Changelog.fixMultipleNewlines(x)
Signature: x:string -> string
Changelog.fromEntries(entries)
Signature: entries:ChangelogEntry list -> Changelog
Changelog.isAnyHeader(line)
Signature: line:string -> bool
Changelog.isBlockHeader(line)
Signature: line:string -> bool
Changelog.isCategoryHeader(line)
Signature: line:string -> bool
Changelog.isMainHeader(line)
Signature: line:string -> bool
Changelog.isNotNullOrWhitespace
Signature: string -> bool
Changelog.isUnreleasedHeader(line)
Signature: line:string -> bool
Changelog.isVersionHeader(line)
Signature: line:string -> bool
Changelog.joinLines(lines)
Signature: lines:seq<string> -> string
Changelog.load(filename)
Signature: filename:string -> Changelog

Parses a Changelog text file and returns the lastest changelog.

Parameters

  • filename - Changelog text file name

Returns

The loaded changelog (or throws an exception, if the changelog could not be parsed)

Changelog.makeChangesText(changes)
Signature: changes:Change list -> string
Changelog.makeDescriptionText(text)
Signature: text:string option -> string
Changelog.makeEntry(change)
Signature: change:Change -> string * string
Changelog.multiNewLineRegex
Signature: Regex
Changelog.nugetRegex
Signature: Regex
Changelog.parse(data)
Signature: data:seq<string> -> Changelog

Parses a change log text and returns the change log.

Parameters

  • data - change log text
Changelog.parseVersions(line)
Signature: line:string -> Match * Match
Changelog.promoteUnreleased(...)
Signature: version:string -> changelog:Changelog -> Changelog

Promotes the Unreleased section of a changelog to a new changelog entry with the given version

Parameters

  • version - The version (in NuGet-Version format, e.g. 3.13.4-alpha1.212
  • changelog - The changelog to promote

Returns

The promoted changelog

Changelog.save filename changelog
Signature: filename:string -> changelog:Changelog -> unit

Saves a Changelog to a text file.

Parameters

  • filename - Changelog text file name
  • changelog - the changelog data
Changelog.trimEnd
Signature: string -> string
Changelog.trimLine
Signature: string -> string
Changelog.trimLines(lines)
Signature: lines:seq<string> -> string list