Skip to content

Commit 188387e

Browse files
committed
fix packaging to allow for versions and release notes to be passed in via the command line
1 parent 0a29fbf commit 188387e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

fcs/RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Moving on from net46 targeting
88
* Fixes for anonymous record generation
99
* Dependency updates
10-
* Checking for constructors in FSharpMemberOrFunctionOrValue..ctor(cenv, minfo)
10+
* Checking for constructors in FSharpMemberOrFunctionOrValue
1111
* Fix unused opens false positive for record fields
1212

1313
#### 28.0.0

fcs/build.fsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,19 @@ Target "Test" (fun _ ->
103103
runDotnet __SOURCE_DIRECTORY__ (sprintf "test FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj --no-restore --no-build -v n -c Release --test-adapter-path . --logger \"nunit;LogFilePath=%s\"" logFilePath)
104104
)
105105

106+
// escape a string's content so that it can be passed on the command line
107+
let escapeString (s: string) =
108+
let replaced = s.Replace("\"", "\\\"")
109+
sprintf "\"%s\"" replaced
110+
106111
Target "NuGet" (fun _ ->
107-
runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.sln -v n -c Release"
112+
let props =
113+
[ "PackageVersion", (string release.NugetVersion)
114+
"PackageReleaseNotes", release.Notes |> String.concat "\n"]
115+
|> Seq.map (fun (prop, value) -> sprintf "-p:%s=%s" prop (escapeString value))
116+
|> String.concat " "
117+
118+
runDotnet __SOURCE_DIRECTORY__ (sprintf "pack FSharp.Compiler.Service.sln -v n -c Release %s" props)
108119
)
109120

110121
Target "GenerateDocsEn" (fun _ ->

0 commit comments

Comments
 (0)