Skip to content

Commit 5ab2244

Browse files
authored
Merge pull request #298 from plotly/update-build-pipeline
2 parents 3219e44 + c74043f commit 5ab2244

26 files changed

+341
-120
lines changed

Plotly.NET.sln

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60
88
.editorconfig = .editorconfig
99
.config\dotnet-tools.json = .config\dotnet-tools.json
1010
global.json = global.json
11+
key.snk = key.snk
1112
LICENSE = LICENSE
1213
README.md = README.md
1314
RELEASE_NOTES.md = RELEASE_NOTES.md
@@ -107,12 +108,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7B09CC0A-F
107108
docs\11_1_carpet_line_scatter_plots.fsx = docs\11_1_carpet_line_scatter_plots.fsx
108109
docs\11_2_contourcarpet_plots.fsx = docs\11_2_contourcarpet_plots.fsx
109110
docs\12_1_smith_line_scatter_plots.fsx = docs\12_1_smith_line_scatter_plots.fsx
110-
docs\_template.fsx = docs\_template.fsx
111-
docs\_template.html = docs\_template.html
112-
docs\_template.ipynb = docs\_template.ipynb
113111
docs\Dockerfile = docs\Dockerfile
114112
docs\index.fsx = docs\index.fsx
115113
docs\NuGet.config = docs\NuGet.config
114+
docs\_template.fsx = docs\_template.fsx
115+
docs\_template.html = docs\_template.html
116+
docs\_template.ipynb = docs\_template.ipynb
116117
EndProjectSection
117118
EndProject
118119
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "reference", "reference", "{5219BAC7-ACE6-435F-A983-BC63DD7B745E}"
@@ -144,8 +145,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.Tests.FSharpCons
144145
EndProject
145146
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.Tests.CSharpConsole", "tests\Plotly.NET.Tests.CSharpConsole\Plotly.NET.Tests.CSharpConsole.csproj", "{1BC73DA0-586F-45C2-BC5B-A70C452A00F0}"
146147
EndProject
147-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.Tests.CSharp", "tests\Plotly.NET.Tests.CSharp\Plotly.NET.Tests.CSharp.csproj", "{26539796-0C9D-4856-8584-B58BE32CC495}"
148-
EndProject
149148
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.ImageExport.Tests", "tests\Plotly.NET.ImageExport.Tests\Plotly.NET.ImageExport.Tests.fsproj", "{55A461C3-8018-4020-B16E-D6005BDFCAED}"
150149
EndProject
151150
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "build", "build\build.fsproj", "{403785C9-B5B1-4BA4-9944-A0F9D5D1B3CD}"
@@ -154,6 +153,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.CSharp", "src\Pl
154153
EndProject
155154
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.CSharp.Tests", "tests\Plotly.NET.CSharp.Tests\Plotly.NET.CSharp.Tests.csproj", "{4C24BA53-F41C-4110-AD7A-28143DCF671E}"
156155
EndProject
156+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.Tests.CSharpInteroperability", "tests\Plotly.NET.Tests.CSharpInteroperability\Plotly.NET.Tests.CSharpInteroperability.csproj", "{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}"
157+
EndProject
157158
Global
158159
GlobalSection(SolutionConfigurationPlatforms) = preSolution
159160
Debug|Any CPU = Debug|Any CPU
@@ -197,12 +198,6 @@ Global
197198
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
198199
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
199200
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0}.Release|Any CPU.Build.0 = Release|Any CPU
200-
{26539796-0C9D-4856-8584-B58BE32CC495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
201-
{26539796-0C9D-4856-8584-B58BE32CC495}.Debug|Any CPU.Build.0 = Debug|Any CPU
202-
{26539796-0C9D-4856-8584-B58BE32CC495}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
203-
{26539796-0C9D-4856-8584-B58BE32CC495}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
204-
{26539796-0C9D-4856-8584-B58BE32CC495}.Release|Any CPU.ActiveCfg = Release|Any CPU
205-
{26539796-0C9D-4856-8584-B58BE32CC495}.Release|Any CPU.Build.0 = Release|Any CPU
206201
{55A461C3-8018-4020-B16E-D6005BDFCAED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
207202
{55A461C3-8018-4020-B16E-D6005BDFCAED}.Debug|Any CPU.Build.0 = Debug|Any CPU
208203
{55A461C3-8018-4020-B16E-D6005BDFCAED}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
@@ -227,6 +222,12 @@ Global
227222
{4C24BA53-F41C-4110-AD7A-28143DCF671E}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
228223
{4C24BA53-F41C-4110-AD7A-28143DCF671E}.Release|Any CPU.ActiveCfg = Release|Any CPU
229224
{4C24BA53-F41C-4110-AD7A-28143DCF671E}.Release|Any CPU.Build.0 = Release|Any CPU
225+
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
226+
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
227+
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
228+
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
229+
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
230+
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Release|Any CPU.Build.0 = Release|Any CPU
230231
EndGlobalSection
231232
GlobalSection(SolutionProperties) = preSolution
232233
HideSolutionNode = FALSE
@@ -241,11 +242,11 @@ Global
241242
{6CFC629E-1A0C-4EF3-8495-BA00A356A381} = {0E87E47E-9EDC-4525-AF72-F0E139D54236}
242243
{60114ACE-77E6-4A19-9A2F-CB64084174AF} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
243244
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
244-
{26539796-0C9D-4856-8584-B58BE32CC495} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
245245
{55A461C3-8018-4020-B16E-D6005BDFCAED} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
246246
{403785C9-B5B1-4BA4-9944-A0F9D5D1B3CD} = {7C6D08E7-3EAC-4335-8F4B-252C193C27C9}
247247
{F944FE69-F4A5-4B48-8E4D-BE4B61E92B26} = {0E87E47E-9EDC-4525-AF72-F0E139D54236}
248248
{4C24BA53-F41C-4110-AD7A-28143DCF671E} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
249+
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
249250
EndGlobalSection
250251
GlobalSection(ExtensibilityGlobals) = postSolution
251252
SolutionGuid = {7177F1E1-341C-48AB-9864-6B525FFF7633}

build/BasicTasks.fs

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,56 @@ open Fake.IO.Globbing.Operators
77

88
open ProjectInfo
99

10+
/// Buildtask for setting a prerelease tag (also sets the mutable isPrerelease to true, and the PackagePrereleaseTag of all project infos accordingly.)
1011
let setPrereleaseTag =
1112
BuildTask.create "SetPrereleaseTag" [] {
1213
printfn "Please enter pre-release package suffix"
1314
let suffix = System.Console.ReadLine()
1415
prereleaseSuffix <- suffix
15-
prereleaseTag <- (sprintf "%s-%s" release.NugetVersion suffix)
1616
isPrerelease <- true
17+
projects
18+
|> List.iter (fun p ->
19+
p.PackagePrereleaseTag <- (sprintf "%s-%s" p.PackageVersionTag suffix)
20+
)
21+
//
22+
prereleaseTag <- (sprintf "%s-%s" CoreProject.PackageVersionTag suffix)
1723
}
1824

25+
/// cleans the bin, obj/obj dir of all projects and test projects, as well as the pkg dir.
1926
let clean =
2027
BuildTask.create "Clean" [] {
2128
!! "src/**/bin" ++ "src/**/obj" ++ "tests/**/bin" ++ "tests/**/obj" ++ "pkg" |> Shell.cleanDirs
2229
}
2330

24-
let build =
25-
BuildTask.create "Build" [ clean ] { solutionFile |> DotNet.build id }
31+
/// builds the solution file (dotnet build solution.sln)
32+
let buildSolution =
33+
BuildTask.create "BuildSolution" [ clean ] { solutionFile |> DotNet.build id }
34+
35+
/// builds the individual project files (dotnet build project.*proj)
36+
///
37+
/// The following MSBuild params are set for each project accordingly to the respective ProjectInfo:
38+
///
39+
/// - AssemblyVersion
40+
///
41+
/// - AssemblyInformationalVersion
42+
let build = BuildTask.create "Build" [clean] {
43+
projects
44+
|> List.iter (fun pInfo ->
45+
let proj = pInfo.ProjFile
46+
proj
47+
|> DotNet.build (fun p ->
48+
let msBuildParams =
49+
{p.MSBuildParams with
50+
Properties = ([
51+
"AssemblyVersion", pInfo.AssemblyVersion
52+
"InformationalVersion", pInfo.AssemblyInformationalVersion
53+
])
54+
}
55+
{
56+
p with
57+
MSBuildParams = msBuildParams
58+
}
59+
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
60+
)
61+
)
62+
}

build/DocumentationTasks.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ open BlackFox.Fake
88

99
let buildDocs =
1010
BuildTask.create "BuildDocs" [ build ] {
11-
printfn "building docs with stable version %s" stableVersionTag
11+
printfn "building docs with stable version %s" stableDocsVersionTag
1212

1313
runDotNet
1414
(sprintf
1515
"fsdocs build --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
16-
stableVersionTag)
16+
stableDocsVersionTag)
1717
"./"
1818
}
1919

@@ -30,12 +30,12 @@ let buildDocsPrerelease =
3030

3131
let watchDocs =
3232
BuildTask.create "WatchDocs" [ build ] {
33-
printfn "watching docs with stable version %s" stableVersionTag
33+
printfn "watching docs with stable version %s" stableDocsVersionTag
3434

3535
runDotNet
3636
(sprintf
3737
"fsdocs watch --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
38-
stableVersionTag)
38+
stableDocsVersionTag)
3939
"./"
4040
}
4141

build/PackageTasks.fs

Lines changed: 70 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,52 @@ open TestTasks
88

99
open BlackFox.Fake
1010
open Fake.Core
11+
open Fake.DotNet
1112
open Fake.IO.Globbing.Operators
1213

13-
let pack =
14-
BuildTask.create "Pack" [ clean; build; runTests ] {
15-
if promptYesNo (sprintf "creating stable package with version %s OK?" stableVersionTag) then
16-
!! "src/**/*.*proj" -- "src/bin/*"
17-
|> Seq.iter (
18-
Fake.DotNet.DotNet.pack (fun p ->
19-
let msBuildParams =
14+
let pack = BuildTask.create "Pack" [ clean; build; runTests ] {
15+
projects
16+
|> List.iter (fun pInfo ->
17+
if promptYesNo $"creating stable package for {pInfo.Name}{System.Environment.NewLine}\tpackage version: {pInfo.PackageVersionTag}{System.Environment.NewLine}\tassembly version: {pInfo.AssemblyVersion}{System.Environment.NewLine}\tassembly informational version: {pInfo.AssemblyInformationalVersion}{System.Environment.NewLine} OK?" then
18+
pInfo.ProjFile
19+
|> Fake.DotNet.DotNet.pack (fun p ->
20+
let msBuildParams =
21+
match pInfo.ReleaseNotes with
22+
| Some r ->
23+
{ p.MSBuildParams with
24+
Properties =
25+
([
26+
"Version",pInfo.PackageVersionTag
27+
"AssemblyVersion", pInfo.AssemblyVersion
28+
"AssemblyInformationalVersion", pInfo.AssemblyVersion
29+
"PackageReleaseNotes", (r.Notes |> String.concat "\r\n")
30+
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
31+
]
32+
@ p.MSBuildParams.Properties)
33+
}
34+
| _ ->
2035
{ p.MSBuildParams with
2136
Properties =
2237
([
23-
"Version", stableVersionTag
24-
"PackageReleaseNotes", (release.Notes |> String.concat "\r\n")
25-
]
26-
@ p.MSBuildParams.Properties)
38+
"Version",pInfo.PackageVersionTag
39+
"AssemblyVersion", pInfo.AssemblyVersion
40+
"AssemblyInformationalVersion", pInfo.AssemblyVersion
41+
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
42+
]
43+
@ p.MSBuildParams.Properties)
2744
}
45+
2846

29-
{ p with
30-
MSBuildParams = msBuildParams
31-
OutputPath = Some pkgDir
32-
})
47+
{ p with
48+
MSBuildParams = msBuildParams
49+
OutputPath = Some pkgDir
50+
NoBuild = true
51+
}
52+
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
3353
)
3454
else
3555
failwith "aborted"
56+
)
3657
}
3758

3859
let packPrerelease =
@@ -44,26 +65,44 @@ let packPrerelease =
4465
build
4566
runTests
4667
] {
47-
if promptYesNo (sprintf "package tag will be %s OK?" prereleaseTag) then
48-
!! "src/**/*.*proj" -- "src/bin/*"
49-
|> Seq.iter (
50-
Fake.DotNet.DotNet.pack (fun p ->
68+
projects
69+
|> List.iter (fun pInfo ->
70+
if promptYesNo $"creating prerelease package for {pInfo.Name}{System.Environment.NewLine}\tpackage version: {pInfo.PackagePrereleaseTag}{System.Environment.NewLine}\tassembly version: {pInfo.AssemblyVersion}{System.Environment.NewLine}\tassembly informational version: {pInfo.AssemblyInformationalVersion}{System.Environment.NewLine} OK?" then
71+
pInfo.ProjFile
72+
|> Fake.DotNet.DotNet.pack (fun p ->
5173
let msBuildParams =
52-
{ p.MSBuildParams with
53-
Properties =
54-
([
55-
"Version", prereleaseTag
56-
"PackageReleaseNotes", (release.Notes |> String.toLines)
57-
]
58-
@ p.MSBuildParams.Properties)
59-
}
74+
match pInfo.ReleaseNotes with
75+
| Some r ->
76+
{ p.MSBuildParams with
77+
Properties =
78+
([
79+
"Version",pInfo.PackagePrereleaseTag
80+
"AssemblyVersion", pInfo.AssemblyVersion
81+
"InformationalVersion", pInfo.AssemblyInformationalVersion
82+
"PackageReleaseNotes", (r.Notes |> String.concat "\r\n")
83+
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
84+
])
85+
}
86+
| _ ->
87+
{ p.MSBuildParams with
88+
Properties =
89+
([
90+
"Version",pInfo.PackagePrereleaseTag
91+
"AssemblyVersion", pInfo.AssemblyVersion
92+
"InformationalVersion", pInfo.AssemblyInformationalVersion
93+
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
94+
])
95+
}
6096

6197
{ p with
6298
VersionSuffix = Some prereleaseSuffix
6399
OutputPath = Some pkgDir
64100
MSBuildParams = msBuildParams
65-
})
66-
)
67-
else
68-
failwith "aborted"
101+
NoBuild = true
102+
}
103+
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
104+
)
105+
else
106+
failwith "aborted"
107+
)
69108
}

0 commit comments

Comments
 (0)