Skip to content

Commit

Permalink
Port to Ionide.KeepAChangelog (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof-Cieslak authored Feb 14, 2022
1 parent 356aeaf commit 921703b
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 35 deletions.
32 changes: 1 addition & 31 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@

open Fake.Core
open Fake.DotNet
open Fake.Tools
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
open Fake.Api

// --------------------------------------------------------------------------------------
// Information about the project to be used at NuGet and in AssemblyInfo files
Expand All @@ -39,31 +36,6 @@ let nugetDir = "./out/"


System.Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let changelogFilename = "CHANGELOG.md"
let changelog = Changelog.load changelogFilename
let latestEntry = changelog.LatestEntry

// Helper function to remove blank lines
let isEmptyChange =
function
| Changelog.Change.Added s
| Changelog.Change.Changed s
| Changelog.Change.Deprecated s
| Changelog.Change.Fixed s
| Changelog.Change.Removed s
| Changelog.Change.Security s
| Changelog.Change.Custom (_, s) -> String.isNullOrWhiteSpace s.CleanedText

let nugetVersion = latestEntry.NuGetVersion

let packageReleaseNotes =
sprintf "%s/blob/v%s/CHANGELOG.md" gitUrl latestEntry.NuGetVersion

let releaseNotes =
latestEntry.Changes
|> List.filter (isEmptyChange >> not)
|> List.map (fun c -> " * " + c.ToString())
|> String.concat "\n"

// --------------------------------------------------------------------------------------
// Helpers
Expand Down Expand Up @@ -126,14 +98,12 @@ Target.create
"Pack"
(fun _ ->
let properties =
[ ("Version", nugetVersion)
("Authors", authors)
[ ("Authors", authors)
("PackageProjectUrl", gitUrl)
("PackageTags", tags)
("RepositoryType", "git")
("RepositoryUrl", gitUrl)
("PackageLicenseExpression", "MIT")
("PackageReleaseNotes", packageReleaseNotes)
("PackageDescription", summary)
("EnableSourceLink", "true") ]

Expand Down
1 change: 1 addition & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ nuget Argu

# copy_local: true because this is a build-time dependency only
nuget Dotnet.ReproducibleBuilds copy_local: true
nuget Ionide.KeepAChangelog.Tasks copy_local:true

nuget Expecto
nuget Expecto.Diff
Expand Down
3 changes: 2 additions & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ NUGET
FSharp.Core (>= 4.7.2)
System.Reactive (>= 5.0)
FSharp.Core (6.0.1)
Ionide.KeepAChangelog.Tasks (0.1.2) - copy_local: true
MedallionShell (1.5.1)
NETStandard.Library (>= 1.6)
System.Diagnostics.Process (>= 4.1)
Expand Down Expand Up @@ -581,7 +582,7 @@ NUGET
System.Drawing.Common (>= 5.0)
GITHUB
remote: TheAngryByrd/FsLibLog
src/FsLibLog/FsLibLog.fs (e9272a8f7783f6863f5e7b2e1ccdd92004993c6a)
src/FsLibLog/FsLibLog.fs (a21347ab09d76059da324cb3e6f3e3e6a93f4ac2)
GROUP Build
STORAGE: NONE
RESTRICTION: == netstandard2.0
Expand Down
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<DebugType>embedded</DebugType>
<OtherFlags>$(OtherFlags) --warnon:3390</OtherFlags>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.xml</AllowedOutputExtensionsInPackageBuildOutputFolder>
<ChangelogFile>$(MSBuildThisFileDirectory)../CHANGELOG.md</ChangelogFile>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion src/Ionide.ProjInfo.FCS/paket.references
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FSharp.Core
FSharp.Compiler.Service
Dotnet.ReproducibleBuilds
Dotnet.ReproducibleBuilds
Ionide.KeepAChangelog.Tasks
1 change: 1 addition & 0 deletions src/Ionide.ProjInfo.ProjectSystem/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ FSharp.Core
FSharp.Compiler.Service
Newtonsoft.Json
Dotnet.ReproducibleBuilds
Ionide.KeepAChangelog.Tasks
Fsharp.Control.Reactive
2 changes: 1 addition & 1 deletion src/Ionide.ProjInfo.Sln/Ionide.ProjInfo.Sln.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
2 changes: 2 additions & 0 deletions src/Ionide.ProjInfo.Sln/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dotnet.ReproducibleBuilds
Ionide.KeepAChangelog.Tasks
3 changes: 2 additions & 1 deletion src/Ionide.ProjInfo.Tool/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ FSharp.Core
Argu
Microsoft.Build copy_local: true
Microsoft.Build.Framework copy_local: true
Dotnet.ReproducibleBuilds
Dotnet.ReproducibleBuilds
Ionide.KeepAChangelog.Tasks
1 change: 1 addition & 0 deletions src/Ionide.ProjInfo/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ Microsoft.Build copy_local: false
Microsoft.Build.Framework copy_local: false
FSharp.Core
Dotnet.ReproducibleBuilds
Ionide.KeepAChangelog.Tasks
SemanticVersioning
File: FsLibLog.fs

0 comments on commit 921703b

Please sign in to comment.