Skip to content

Update build pipeline #298

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

Merged
merged 4 commits into from
Jun 15, 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
25 changes: 13 additions & 12 deletions Plotly.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60
.editorconfig = .editorconfig
.config\dotnet-tools.json = .config\dotnet-tools.json
global.json = global.json
key.snk = key.snk
LICENSE = LICENSE
README.md = README.md
RELEASE_NOTES.md = RELEASE_NOTES.md
Expand Down Expand Up @@ -107,12 +108,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7B09CC0A-F
docs\11_1_carpet_line_scatter_plots.fsx = docs\11_1_carpet_line_scatter_plots.fsx
docs\11_2_contourcarpet_plots.fsx = docs\11_2_contourcarpet_plots.fsx
docs\12_1_smith_line_scatter_plots.fsx = docs\12_1_smith_line_scatter_plots.fsx
docs\_template.fsx = docs\_template.fsx
docs\_template.html = docs\_template.html
docs\_template.ipynb = docs\_template.ipynb
docs\Dockerfile = docs\Dockerfile
docs\index.fsx = docs\index.fsx
docs\NuGet.config = docs\NuGet.config
docs\_template.fsx = docs\_template.fsx
docs\_template.html = docs\_template.html
docs\_template.ipynb = docs\_template.ipynb
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "reference", "reference", "{5219BAC7-ACE6-435F-A983-BC63DD7B745E}"
Expand Down Expand Up @@ -144,8 +145,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.Tests.FSharpCons
EndProject
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}"
EndProject
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}"
EndProject
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}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "build", "build\build.fsproj", "{403785C9-B5B1-4BA4-9944-A0F9D5D1B3CD}"
Expand All @@ -154,6 +153,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.CSharp", "src\Pl
EndProject
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}"
EndProject
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -197,12 +198,6 @@ Global
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0}.Release|Any CPU.Build.0 = Release|Any CPU
{26539796-0C9D-4856-8584-B58BE32CC495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26539796-0C9D-4856-8584-B58BE32CC495}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26539796-0C9D-4856-8584-B58BE32CC495}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
{26539796-0C9D-4856-8584-B58BE32CC495}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
{26539796-0C9D-4856-8584-B58BE32CC495}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26539796-0C9D-4856-8584-B58BE32CC495}.Release|Any CPU.Build.0 = Release|Any CPU
{55A461C3-8018-4020-B16E-D6005BDFCAED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55A461C3-8018-4020-B16E-D6005BDFCAED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55A461C3-8018-4020-B16E-D6005BDFCAED}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -227,6 +222,12 @@ Global
{4C24BA53-F41C-4110-AD7A-28143DCF671E}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
{4C24BA53-F41C-4110-AD7A-28143DCF671E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C24BA53-F41C-4110-AD7A-28143DCF671E}.Release|Any CPU.Build.0 = Release|Any CPU
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -241,11 +242,11 @@ Global
{6CFC629E-1A0C-4EF3-8495-BA00A356A381} = {0E87E47E-9EDC-4525-AF72-F0E139D54236}
{60114ACE-77E6-4A19-9A2F-CB64084174AF} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
{1BC73DA0-586F-45C2-BC5B-A70C452A00F0} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
{26539796-0C9D-4856-8584-B58BE32CC495} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
{55A461C3-8018-4020-B16E-D6005BDFCAED} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
{403785C9-B5B1-4BA4-9944-A0F9D5D1B3CD} = {7C6D08E7-3EAC-4335-8F4B-252C193C27C9}
{F944FE69-F4A5-4B48-8E4D-BE4B61E92B26} = {0E87E47E-9EDC-4525-AF72-F0E139D54236}
{4C24BA53-F41C-4110-AD7A-28143DCF671E} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7177F1E1-341C-48AB-9864-6B525FFF7633}
Expand Down
43 changes: 40 additions & 3 deletions build/BasicTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,56 @@ open Fake.IO.Globbing.Operators

open ProjectInfo

/// Buildtask for setting a prerelease tag (also sets the mutable isPrerelease to true, and the PackagePrereleaseTag of all project infos accordingly.)
let setPrereleaseTag =
BuildTask.create "SetPrereleaseTag" [] {
printfn "Please enter pre-release package suffix"
let suffix = System.Console.ReadLine()
prereleaseSuffix <- suffix
prereleaseTag <- (sprintf "%s-%s" release.NugetVersion suffix)
isPrerelease <- true
projects
|> List.iter (fun p ->
p.PackagePrereleaseTag <- (sprintf "%s-%s" p.PackageVersionTag suffix)
)
//
prereleaseTag <- (sprintf "%s-%s" CoreProject.PackageVersionTag suffix)
}

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

let build =
BuildTask.create "Build" [ clean ] { solutionFile |> DotNet.build id }
/// builds the solution file (dotnet build solution.sln)
let buildSolution =
BuildTask.create "BuildSolution" [ clean ] { solutionFile |> DotNet.build id }

/// builds the individual project files (dotnet build project.*proj)
///
/// The following MSBuild params are set for each project accordingly to the respective ProjectInfo:
///
/// - AssemblyVersion
///
/// - AssemblyInformationalVersion
let build = BuildTask.create "Build" [clean] {
projects
|> List.iter (fun pInfo ->
let proj = pInfo.ProjFile
proj
|> DotNet.build (fun p ->
let msBuildParams =
{p.MSBuildParams with
Properties = ([
"AssemblyVersion", pInfo.AssemblyVersion
"InformationalVersion", pInfo.AssemblyInformationalVersion
])
}
{
p with
MSBuildParams = msBuildParams
}
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
)
)
}
8 changes: 4 additions & 4 deletions build/DocumentationTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ open BlackFox.Fake

let buildDocs =
BuildTask.create "BuildDocs" [ build ] {
printfn "building docs with stable version %s" stableVersionTag
printfn "building docs with stable version %s" stableDocsVersionTag

runDotNet
(sprintf
"fsdocs build --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
stableVersionTag)
stableDocsVersionTag)
"./"
}

Expand All @@ -30,12 +30,12 @@ let buildDocsPrerelease =

let watchDocs =
BuildTask.create "WatchDocs" [ build ] {
printfn "watching docs with stable version %s" stableVersionTag
printfn "watching docs with stable version %s" stableDocsVersionTag

runDotNet
(sprintf
"fsdocs watch --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
stableVersionTag)
stableDocsVersionTag)
"./"
}

Expand Down
101 changes: 70 additions & 31 deletions build/PackageTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,52 @@ open TestTasks

open BlackFox.Fake
open Fake.Core
open Fake.DotNet
open Fake.IO.Globbing.Operators

let pack =
BuildTask.create "Pack" [ clean; build; runTests ] {
if promptYesNo (sprintf "creating stable package with version %s OK?" stableVersionTag) then
!! "src/**/*.*proj" -- "src/bin/*"
|> Seq.iter (
Fake.DotNet.DotNet.pack (fun p ->
let msBuildParams =
let pack = BuildTask.create "Pack" [ clean; build; runTests ] {
projects
|> List.iter (fun pInfo ->
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
pInfo.ProjFile
|> Fake.DotNet.DotNet.pack (fun p ->
let msBuildParams =
match pInfo.ReleaseNotes with
| Some r ->
{ p.MSBuildParams with
Properties =
([
"Version",pInfo.PackageVersionTag
"AssemblyVersion", pInfo.AssemblyVersion
"AssemblyInformationalVersion", pInfo.AssemblyVersion
"PackageReleaseNotes", (r.Notes |> String.concat "\r\n")
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
]
@ p.MSBuildParams.Properties)
}
| _ ->
{ p.MSBuildParams with
Properties =
([
"Version", stableVersionTag
"PackageReleaseNotes", (release.Notes |> String.concat "\r\n")
]
@ p.MSBuildParams.Properties)
"Version",pInfo.PackageVersionTag
"AssemblyVersion", pInfo.AssemblyVersion
"AssemblyInformationalVersion", pInfo.AssemblyVersion
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
]
@ p.MSBuildParams.Properties)
}


{ p with
MSBuildParams = msBuildParams
OutputPath = Some pkgDir
})
{ p with
MSBuildParams = msBuildParams
OutputPath = Some pkgDir
NoBuild = true
}
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
)
else
failwith "aborted"
)
}

let packPrerelease =
Expand All @@ -44,26 +65,44 @@ let packPrerelease =
build
runTests
] {
if promptYesNo (sprintf "package tag will be %s OK?" prereleaseTag) then
!! "src/**/*.*proj" -- "src/bin/*"
|> Seq.iter (
Fake.DotNet.DotNet.pack (fun p ->
projects
|> List.iter (fun pInfo ->
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
pInfo.ProjFile
|> Fake.DotNet.DotNet.pack (fun p ->
let msBuildParams =
{ p.MSBuildParams with
Properties =
([
"Version", prereleaseTag
"PackageReleaseNotes", (release.Notes |> String.toLines)
]
@ p.MSBuildParams.Properties)
}
match pInfo.ReleaseNotes with
| Some r ->
{ p.MSBuildParams with
Properties =
([
"Version",pInfo.PackagePrereleaseTag
"AssemblyVersion", pInfo.AssemblyVersion
"InformationalVersion", pInfo.AssemblyInformationalVersion
"PackageReleaseNotes", (r.Notes |> String.concat "\r\n")
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
])
}
| _ ->
{ p.MSBuildParams with
Properties =
([
"Version",pInfo.PackagePrereleaseTag
"AssemblyVersion", pInfo.AssemblyVersion
"InformationalVersion", pInfo.AssemblyInformationalVersion
"TargetsForTfmSpecificContentInPackage", "" //https://github.com/dotnet/fsharp/issues/12320
])
}

{ p with
VersionSuffix = Some prereleaseSuffix
OutputPath = Some pkgDir
MSBuildParams = msBuildParams
})
)
else
failwith "aborted"
NoBuild = true
}
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
)
else
failwith "aborted"
)
}
Loading