Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Ionide.KeepAChangelog #132

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this project url as well - it defaults to the repo git url that sourcelink derives from the origin uri

("PackageTags", tags)
("RepositoryType", "git")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these source control properties can be removed - sourcelink/dotnet.reproducible builds infer them correctly for you.

("RepositoryUrl", gitUrl)
("PackageLicenseExpression", "MIT")
("PackageReleaseNotes", packageReleaseNotes)
("PackageDescription", summary)
("EnableSourceLink", "true") ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one can be removed as well - sourcelink is just auto-on with the dotnet.reproduciblebuild package.


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