Browse Source

Build: refactoring

v3
Christoph Ruegg 10 years ago
parent
commit
9a0f9680a6
  1. 65
      build.fsx
  2. 64
      build/build-framework.fsx

65
build.fsx

@ -33,11 +33,12 @@ open BuildFramework
// VERSION OVERVIEW // VERSION OVERVIEW
let numericsRelease = release "RELEASENOTES.md" let numericsRelease = release "Math.NET Numerics" "RELEASENOTES.md"
let mklRelease = release "RELEASENOTES-MKL.md" let mklRelease = release "MKL Provider" "RELEASENOTES-MKL.md"
let cudaRelease = release "RELEASENOTES-CUDA.md" let cudaRelease = release "CUDA Provider" "RELEASENOTES-CUDA.md"
let openBlasRelease = release "RELEASENOTES-OpenBLAS.md" let openBlasRelease = release "OpenBLAS Provider" "RELEASENOTES-OpenBLAS.md"
let dataRelease = release "RELEASENOTES-Data.md" let dataRelease = release "Data Extensions" "RELEASENOTES-Data.md"
let releases = [ numericsRelease; mklRelease; openBlasRelease; dataRelease ] // skip cuda
trace (sprintf " Math.NET Numerics v%s" numericsRelease.PackageVersion) trace (sprintf " Math.NET Numerics v%s" numericsRelease.PackageVersion)
trace (sprintf " Math.NET Numerics MKL Provider v%s" mklRelease.PackageVersion) trace (sprintf " Math.NET Numerics MKL Provider v%s" mklRelease.PackageVersion)
@ -58,11 +59,10 @@ let tags = "math numeric statistics probability integration interpolation regres
let numericsPack = let numericsPack =
{ Id = "MathNet.Numerics" { Id = "MathNet.Numerics"
Version = numericsRelease.PackageVersion Release = numericsRelease
Title = "Math.NET Numerics" Title = "Math.NET Numerics"
Summary = summary Summary = summary
Description = description + support Description = description + support
ReleaseNotes = numericsRelease.ReleaseNotes
Tags = tags Tags = tags
Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ] Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ]
FsLoader = false FsLoader = false
@ -130,16 +130,14 @@ let fsharpSignedPack =
let coreBundle = let coreBundle =
{ Id = numericsPack.Id { Id = numericsPack.Id
Version = numericsRelease.PackageVersion Release = numericsRelease
Title = numericsPack.Title Title = numericsPack.Title
ReleaseNotesFile = "RELEASENOTES.md"
Packages = [ numericsPack; fsharpPack ] } Packages = [ numericsPack; fsharpPack ] }
let coreSignedBundle = let coreSignedBundle =
{ Id = numericsSignedPack.Id { Id = numericsSignedPack.Id
Version = numericsRelease.PackageVersion Release = numericsRelease
Title = numericsSignedPack.Title Title = numericsSignedPack.Title
ReleaseNotesFile = "RELEASENOTES.md"
Packages = [ numericsSignedPack; fsharpSignedPack ] } Packages = [ numericsSignedPack; fsharpSignedPack ] }
@ -147,11 +145,10 @@ let coreSignedBundle =
let mklWinPack = let mklWinPack =
{ Id = "MathNet.Numerics.MKL.Win" { Id = "MathNet.Numerics.MKL.Win"
Version = mklRelease.PackageVersion Release = mklRelease
Title = "Math.NET Numerics - MKL Native Provider for Windows (x64 and x86)" Title = "Math.NET Numerics - MKL Native Provider for Windows (x64 and x86)"
Summary = "" Summary = ""
Description = "Intel MKL native libraries for Math.NET Numerics on Windows." Description = "Intel MKL native libraries for Math.NET Numerics on Windows."
ReleaseNotes = mklRelease.ReleaseNotes
Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native mkl" Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native mkl"
Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ] Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ]
FsLoader = false FsLoader = false
@ -183,11 +180,10 @@ let mklWin64Pack =
let mklLinuxPack = let mklLinuxPack =
{ Id = "MathNet.Numerics.MKL.Linux" { Id = "MathNet.Numerics.MKL.Linux"
Version = mklRelease.PackageVersion Release = mklRelease
Title = "Math.NET Numerics - MKL Native Provider for Linux (x64 and x86)" Title = "Math.NET Numerics - MKL Native Provider for Linux (x64 and x86)"
Summary = "" Summary = ""
Description = "Intel MKL native libraries for Math.NET Numerics on Linux." Description = "Intel MKL native libraries for Math.NET Numerics on Linux."
ReleaseNotes = mklRelease.ReleaseNotes
Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native mkl" Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native mkl"
Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ] Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ]
FsLoader = false FsLoader = false
@ -219,16 +215,14 @@ let mklLinux64Pack =
let mklWinBundle = let mklWinBundle =
{ Id = "MathNet.Numerics.MKL.Win" { Id = "MathNet.Numerics.MKL.Win"
Version = mklRelease.PackageVersion Release = mklRelease
Title = "Math.NET Numerics MKL Native Provider for Windows" Title = "Math.NET Numerics MKL Native Provider for Windows"
ReleaseNotesFile = "RELEASENOTES-MKL.md"
Packages = [ mklWinPack; mklWin32Pack; mklWin64Pack ] } Packages = [ mklWinPack; mklWin32Pack; mklWin64Pack ] }
let mklLinuxBundle = let mklLinuxBundle =
{ Id = "MathNet.Numerics.MKL.Linux" { Id = "MathNet.Numerics.MKL.Linux"
Version = mklRelease.PackageVersion Release = mklRelease
Title = "Math.NET Numerics MKL Native Provider for Linux" Title = "Math.NET Numerics MKL Native Provider for Linux"
ReleaseNotesFile = "RELEASENOTES-MKL.md"
Packages = [ mklLinuxPack; mklLinux32Pack; mklLinux64Pack ] } Packages = [ mklLinuxPack; mklLinux32Pack; mklLinux64Pack ] }
@ -236,11 +230,10 @@ let mklLinuxBundle =
let cudaWinPack = let cudaWinPack =
{ Id = "MathNet.Numerics.CUDA.Win" { Id = "MathNet.Numerics.CUDA.Win"
Version = cudaRelease.PackageVersion Release = cudaRelease
Title = "Math.NET Numerics - CUDA Native Provider for Windows (x64)" Title = "Math.NET Numerics - CUDA Native Provider for Windows (x64)"
Summary = "" Summary = ""
Description = "Nvidia CUDA native libraries for Math.NET Numerics." Description = "Nvidia CUDA native libraries for Math.NET Numerics."
ReleaseNotes = cudaRelease.ReleaseNotes
Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native cuda gpu" Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native cuda gpu"
Authors = [ "Matthew A Johnson"; "Christoph Ruegg" ] Authors = [ "Matthew A Johnson"; "Christoph Ruegg" ]
FsLoader = false FsLoader = false
@ -254,9 +247,8 @@ let cudaWinPack =
let cudaWinBundle = let cudaWinBundle =
{ Id = "MathNet.Numerics.CUDA.Win" { Id = "MathNet.Numerics.CUDA.Win"
Version = cudaRelease.PackageVersion Release = cudaRelease
Title = "Math.NET Numerics CUDA Native Provider for Windows" Title = "Math.NET Numerics CUDA Native Provider for Windows"
ReleaseNotesFile = "RELEASENOTES-CUDA.md"
Packages = [ cudaWinPack ] } Packages = [ cudaWinPack ] }
@ -264,11 +256,10 @@ let cudaWinBundle =
let openBlasWinPack = let openBlasWinPack =
{ Id = "MathNet.Numerics.OpenBLAS.Win" { Id = "MathNet.Numerics.OpenBLAS.Win"
Version = openBlasRelease.PackageVersion Release = openBlasRelease
Title = "Math.NET Numerics - OpenBLAS Native Provider for Windows (x64 and x86)" Title = "Math.NET Numerics - OpenBLAS Native Provider for Windows (x64 and x86)"
Summary = "" Summary = ""
Description = "OpenBLAS native libraries for Math.NET Numerics." Description = "OpenBLAS native libraries for Math.NET Numerics."
ReleaseNotes = openBlasRelease.ReleaseNotes
Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native openblas" Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native openblas"
Authors = [ "Kuan Bartel"; "Christoph Ruegg"; "Marcus Cuda" ] Authors = [ "Kuan Bartel"; "Christoph Ruegg"; "Marcus Cuda" ]
FsLoader = false FsLoader = false
@ -288,9 +279,8 @@ let openBlasWinPack =
let openBlasWinBundle = let openBlasWinBundle =
{ Id = "MathNet.Numerics.OpenBLAS.Win" { Id = "MathNet.Numerics.OpenBLAS.Win"
Version = openBlasRelease.PackageVersion Release = openBlasRelease
Title = "Math.NET Numerics OpenBLAS Native Provider for Windows" Title = "Math.NET Numerics OpenBLAS Native Provider for Windows"
ReleaseNotesFile = "RELEASENOTES-OpenBLAS.md"
Packages = [ openBlasWinPack ] } Packages = [ openBlasWinPack ] }
@ -298,11 +288,10 @@ let openBlasWinBundle =
let dataTextPack = let dataTextPack =
{ Id = "MathNet.Numerics.Data.Text" { Id = "MathNet.Numerics.Data.Text"
Version = dataRelease.PackageVersion Release = dataRelease
Title = "Math.NET Numerics - Text Data I/O Extensions" Title = "Math.NET Numerics - Text Data I/O Extensions"
Summary = "" Summary = ""
Description = "Text Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use." Description = "Text Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use."
ReleaseNotes = dataRelease.ReleaseNotes
Tags = "math numeric data text csv tsv json xml" Tags = "math numeric data text csv tsv json xml"
Authors = [ "Christoph Ruegg"; "Marcus Cuda" ] Authors = [ "Christoph Ruegg"; "Marcus Cuda" ]
FsLoader = false FsLoader = false
@ -315,11 +304,10 @@ let dataTextPack =
let dataMatlabPack = let dataMatlabPack =
{ Id = "MathNet.Numerics.Data.Matlab" { Id = "MathNet.Numerics.Data.Matlab"
Version = dataRelease.PackageVersion Release = dataRelease
Title = "Math.NET Numerics - MATLAB Data I/O Extensions" Title = "Math.NET Numerics - MATLAB Data I/O Extensions"
Summary = "" Summary = ""
Description = "MathWorks MATLAB Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use." Description = "MathWorks MATLAB Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use."
ReleaseNotes = dataRelease.ReleaseNotes
Tags = "math numeric data matlab" Tags = "math numeric data matlab"
Authors = [ "Christoph Ruegg"; "Marcus Cuda" ] Authors = [ "Christoph Ruegg"; "Marcus Cuda" ]
FsLoader = false FsLoader = false
@ -332,9 +320,8 @@ let dataMatlabPack =
let dataBundle = let dataBundle =
{ Id = "MathNet.Numerics.Data" { Id = "MathNet.Numerics.Data"
Version = dataRelease.PackageVersion Release = dataRelease
Title = "Math.NET Numerics Data Extensions" Title = "Math.NET Numerics Data Extensions"
ReleaseNotesFile = "RELEASENOTES-Data.md"
Packages = [ dataTextPack; dataMatlabPack ] } Packages = [ dataTextPack; dataMatlabPack ] }
@ -530,20 +517,14 @@ let extraDocs =
"CONTRIBUTING.md", "Contributing.md" "CONTRIBUTING.md", "Contributing.md"
"CONTRIBUTORS.md", "Contributors.md" ] "CONTRIBUTORS.md", "Contributors.md" ]
let releaseNotesDocs =
[ "RELEASENOTES.md", "ReleaseNotes.md", "Release Notes"
"RELEASENOTES-Data.md", "ReleaseNotes-Data.md", "Data Extensions Release Notes"
"RELEASENOTES-MKL.md", "ReleaseNotes-MKL.md", "MKL Native Provider Release Notes"
"RELEASENOTES-OpenBLAS.md", "ReleaseNotes-OpenBLAS.md", "OpenBLAS Native Provider Release Notes" ]
Target "Docs" (fun _ -> Target "Docs" (fun _ ->
provideDocExtraFiles extraDocs releaseNotesDocs provideDocExtraFiles extraDocs releases
generateDocs true false) generateDocs true false)
Target "DocsDev" (fun _ -> Target "DocsDev" (fun _ ->
provideDocExtraFiles extraDocs releaseNotesDocs provideDocExtraFiles extraDocs releases
generateDocs true true) generateDocs true true)
Target "DocsWatch" (fun _ -> Target "DocsWatch" (fun _ ->
provideDocExtraFiles extraDocs releaseNotesDocs provideDocExtraFiles extraDocs releases
use watcher = new FileSystemWatcher(DirectoryInfo("docs/content").FullName, "*.*") use watcher = new FileSystemWatcher(DirectoryInfo("docs/content").FullName, "*.*")
watcher.EnableRaisingEvents <- true watcher.EnableRaisingEvents <- true
watcher.Changed.Add(fun e -> generateDocs false true) watcher.Changed.Add(fun e -> generateDocs false true)

64
build/build-framework.fsx

@ -16,6 +16,7 @@ module BuildFramework
#I "../packages/build/FAKE/tools" #I "../packages/build/FAKE/tools"
#r "../packages/build/FAKE/tools/FakeLib.dll" #r "../packages/build/FAKE/tools/FakeLib.dll"
open FSharp.Core
open Fake open Fake
open Fake.DocuHelper open Fake.DocuHelper
open Fake.AssemblyInfoFile open Fake.AssemblyInfoFile
@ -31,19 +32,19 @@ trace Environment.CurrentDirectory
let header = ReadFile(__SOURCE_DIRECTORY__ </> __SOURCE_FILE__) |> Seq.take 10 |> Seq.map (fun s -> s.Substring(2)) |> toLines let header = ReadFile(__SOURCE_DIRECTORY__ </> __SOURCE_FILE__) |> Seq.take 10 |> Seq.map (fun s -> s.Substring(2)) |> toLines
trace header trace header
type BundleRelease = type Release =
{ ReleaseNotesFile: string { Title: string
AssemblyVersion: string AssemblyVersion: string
PackageVersion: string PackageVersion: string
ReleaseNotes: string } ReleaseNotes: string
ReleaseNotesFile: string }
type Package = type Package =
{ Id: string { Id: string
Version: string Release: Release
Title: string Title: string
Summary: string Summary: string
Description: string Description: string
ReleaseNotes: string
Tags: string Tags: string
FsLoader: bool FsLoader: bool
Authors: string list Authors: string list
@ -52,21 +53,21 @@ type Package =
type Bundle = type Bundle =
{ Id: string { Id: string
Version: string Release: Release
Title: string Title: string
ReleaseNotesFile: string
Packages: Package list } Packages: Package list }
let release releaseNotesFile : BundleRelease = let release title releaseNotesFile : Release =
let info = LoadReleaseNotes releaseNotesFile let info = LoadReleaseNotes releaseNotesFile
let buildPart = "0" let buildPart = "0"
let assemblyVersion = info.AssemblyVersion + "." + buildPart let assemblyVersion = info.AssemblyVersion + "." + buildPart
let packageVersion = info.NugetVersion let packageVersion = info.NugetVersion
let notes = info.Notes |> List.map (fun l -> l.Replace("*","").Replace("`","")) |> toLines let notes = info.Notes |> List.map (fun l -> l.Replace("*","").Replace("`","")) |> toLines
{ ReleaseNotesFile = releaseNotesFile { Title = title
AssemblyVersion = assemblyVersion AssemblyVersion = assemblyVersion
PackageVersion = packageVersion PackageVersion = packageVersion
ReleaseNotes = notes } ReleaseNotes = notes
ReleaseNotesFile = releaseNotesFile }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
@ -87,14 +88,14 @@ let libpcl328 = "lib/portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouc
// PREPARE // PREPARE
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
let patchVersionInAssemblyInfo path (release:BundleRelease) = let patchVersionInAssemblyInfo path (release:Release) =
BulkReplaceAssemblyInfoVersions path (fun f -> BulkReplaceAssemblyInfoVersions path (fun f ->
{ f with { f with
AssemblyVersion = release.AssemblyVersion AssemblyVersion = release.AssemblyVersion
AssemblyFileVersion = release.AssemblyVersion AssemblyFileVersion = release.AssemblyVersion
AssemblyInformationalVersion = release.PackageVersion }) AssemblyInformationalVersion = release.PackageVersion })
let patchVersionInResource path (release:BundleRelease) = let patchVersionInResource path (release:Release) =
ReplaceInFile ReplaceInFile
(regex_replace @"\d+\.\d+\.\d+\.\d+" release.AssemblyVersion (regex_replace @"\d+\.\d+\.\d+\.\d+" release.AssemblyVersion
>> regex_replace @"\d+,\d+,\d+,\d+" (replace "." "," release.AssemblyVersion)) >> regex_replace @"\d+,\d+,\d+,\d+" (replace "." "," release.AssemblyVersion))
@ -143,8 +144,8 @@ let provideLicense path =
|> ConvertTextToWindowsLineBreaks |> ConvertTextToWindowsLineBreaks
|> ReplaceFile (path </> "license.txt") |> ReplaceFile (path </> "license.txt")
let provideReadme title releasenotes path = let provideReadme title (release:Release) path =
String.concat Environment.NewLine [header; " " + title; ""; ReadFileAsString releasenotes] String.concat Environment.NewLine [header; " " + title; ""; ReadFileAsString release.ReleaseNotesFile]
|> ConvertTextToWindowsLineBreaks |> ConvertTextToWindowsLineBreaks
|> ReplaceFile (path </> "readme.txt") |> ReplaceFile (path </> "readme.txt")
@ -165,7 +166,7 @@ let provideFsIfSharpLoader path =
let provideZipExtraFiles path (bundle:Bundle) = let provideZipExtraFiles path (bundle:Bundle) =
provideLicense path provideLicense path
provideReadme (sprintf "%s v%s" bundle.Title bundle.Version) bundle.ReleaseNotesFile path provideReadme (sprintf "%s v%s" bundle.Title bundle.Release.PackageVersion) bundle.Release path
if bundle.Packages |> List.exists (fun p -> p.FsLoader) then if bundle.Packages |> List.exists (fun p -> p.FsLoader) then
let includes = [ for root in [ ""; "../"; "../../" ] -> sprintf "#I \"%sNet40\"" root ] let includes = [ for root in [ ""; "../"; "../../" ] -> sprintf "#I \"%sNet40\"" root ]
provideFsLoader includes path provideFsLoader includes path
@ -173,12 +174,12 @@ let provideZipExtraFiles path (bundle:Bundle) =
let provideNuGetExtraFiles path (bundle:Bundle) (pack:Package) = let provideNuGetExtraFiles path (bundle:Bundle) (pack:Package) =
provideLicense path provideLicense path
provideReadme (sprintf "%s v%s" pack.Title pack.Version) bundle.ReleaseNotesFile path provideReadme (sprintf "%s v%s" pack.Title pack.Release.PackageVersion) bundle.Release path
if pack.FsLoader then if pack.FsLoader then
let includes = [ for root in [ ""; "../"; "../../"; "../../../" ] do let includes = [ for root in [ ""; "../"; "../../"; "../../../" ] do
for package in bundle.Packages do for package in bundle.Packages do
yield sprintf "#I \"%spackages/%s/lib/net40/\"" root package.Id yield sprintf "#I \"%spackages/%s/lib/net40/\"" root package.Id
yield sprintf "#I \"%spackages/%s.%s/lib/net40/\"" root package.Id package.Version ] yield sprintf "#I \"%spackages/%s.%s/lib/net40/\"" root package.Id package.Release.PackageVersion ]
provideFsLoader includes path provideFsLoader includes path
provideFsIfSharpLoader path provideFsIfSharpLoader path
@ -189,7 +190,7 @@ let zip zipDir filesDir filesFilter (bundle:Bundle) =
let workPath = "obj/Zip/" + bundle.Id let workPath = "obj/Zip/" + bundle.Id
CopyDir workPath filesDir filesFilter CopyDir workPath filesDir filesFilter
provideZipExtraFiles workPath bundle provideZipExtraFiles workPath bundle
Zip "obj/Zip/" (zipDir </> sprintf "%s-%s.zip" bundle.Id bundle.Version) !! (workPath + "/**/*.*") Zip "obj/Zip/" (zipDir </> sprintf "%s-%s.zip" bundle.Id bundle.Release.PackageVersion) !! (workPath + "/**/*.*")
CleanDir "obj/Zip" CleanDir "obj/Zip"
// NUGET // NUGET
@ -198,8 +199,8 @@ let updateNuspec (pack:Package) outPath symbols updateFiles spec =
{ spec with ToolPath = "packages/build/NuGet.CommandLine/tools/NuGet.exe" { spec with ToolPath = "packages/build/NuGet.CommandLine/tools/NuGet.exe"
OutputPath = outPath OutputPath = outPath
WorkingDir = "obj/NuGet" WorkingDir = "obj/NuGet"
Version = pack.Version Version = pack.Release.PackageVersion
ReleaseNotes = pack.ReleaseNotes ReleaseNotes = pack.Release.ReleaseNotes
Project = pack.Id Project = pack.Id
Title = pack.Title Title = pack.Title
Summary = pack.Summary Summary = pack.Summary
@ -211,7 +212,7 @@ let updateNuspec (pack:Package) outPath symbols updateFiles spec =
Files = updateFiles pack.Files Files = updateFiles pack.Files
Publish = false } Publish = false }
let nugetPack bundle outPath = let nugetPack (bundle:Bundle) outPath =
CleanDir "obj/NuGet" CleanDir "obj/NuGet"
for pack in bundle.Packages do for pack in bundle.Packages do
provideNuGetExtraFiles "obj/NuGet" bundle pack provideNuGetExtraFiles "obj/NuGet" bundle pack
@ -226,7 +227,7 @@ let nugetPack bundle outPath =
NuGet (updateNuspec pack outPath NugetSymbolPackage.None (withLicenseReadme >> withoutSymbolsSources)) "build/MathNet.Numerics.nuspec" NuGet (updateNuspec pack outPath NugetSymbolPackage.None (withLicenseReadme >> withoutSymbolsSources)) "build/MathNet.Numerics.nuspec"
CleanDir "obj/NuGet" CleanDir "obj/NuGet"
let nugetPackExtension bundle outPath = let nugetPackExtension (bundle:Bundle) outPath =
CleanDir "obj/NuGet" CleanDir "obj/NuGet"
for pack in bundle.Packages do for pack in bundle.Packages do
provideNuGetExtraFiles "obj/NuGet" bundle pack provideNuGetExtraFiles "obj/NuGet" bundle pack
@ -239,15 +240,16 @@ let nugetPackExtension bundle outPath =
// Documentation // Documentation
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
let provideDocExtraFiles extraDocs releaseNotesDocs = let provideDocExtraFiles extraDocs (releases:Release list) =
for (fileName, docName) in extraDocs do CopyFile ("docs/content" </> docName) fileName for (fileName, docName) in extraDocs do CopyFile ("docs/content" </> docName) fileName
for (fileName, docName, title) in releaseNotesDocs do let menu = releases |> List.map (fun r -> sprintf "[%s](%s)" r.Title (r.ReleaseNotesFile |> replace "RELEASENOTES" "ReleaseNotes" |> replace ".md" ".html")) |> String.concat " | "
for release in releases do
String.concat Environment.NewLine String.concat Environment.NewLine
[ "# " + title [ "# " + release.Title + " Release Notes"
"[Math.NET Numerics](ReleaseNotes.html) | [Data Extensions](ReleaseNotes-Data.html) | [MKL Native Provider](ReleaseNotes-MKL.html) | [OpenBLAS Native Provider](ReleaseNotes-OpenBLAS.html)" menu
"" ""
ReadFileAsString fileName ] ReadFileAsString release.ReleaseNotesFile ]
|> ReplaceFile ("docs/content" </> docName) |> ReplaceFile ("docs/content" </> (release.ReleaseNotesFile |> replace "RELEASENOTES" "ReleaseNotes"))
let buildDocumentationTarget fsiargs target = let buildDocumentationTarget fsiargs target =
trace (sprintf "Building documentation (%s), this could take some time, please wait..." target) trace (sprintf "Building documentation (%s), this could take some time, please wait..." target)
@ -291,7 +293,7 @@ let generateDocs fail local =
// Requires permissions; intended only for maintainers // Requires permissions; intended only for maintainers
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
let publishReleaseTag title prefix (release:BundleRelease) = let publishReleaseTag title prefix (release:Release) =
// inspired by Deedle/tpetricek // inspired by Deedle/tpetricek
let tagName = prefix + "v" + release.PackageVersion let tagName = prefix + "v" + release.PackageVersion
let tagMessage = String.concat Environment.NewLine [title + " v" + release.PackageVersion; ""; release.ReleaseNotes ] let tagMessage = String.concat Environment.NewLine [title + " v" + release.PackageVersion; ""; release.ReleaseNotes ]
@ -324,7 +326,7 @@ let publishMirrors () =
Git.CommandHelper.runSimpleGitCommand repo "remote update" |> printfn "%s" Git.CommandHelper.runSimpleGitCommand repo "remote update" |> printfn "%s"
Git.CommandHelper.runSimpleGitCommand repo "push mirrors" |> printfn "%s" Git.CommandHelper.runSimpleGitCommand repo "push mirrors" |> printfn "%s"
let publishDocs (release:BundleRelease) = let publishDocs (release:Release) =
let repo = "../mathnet-websites" let repo = "../mathnet-websites"
Git.Branches.pull repo "origin" "master" Git.Branches.pull repo "origin" "master"
CopyRecursive "out/docs" "../mathnet-websites/numerics" true |> printfn "%A" CopyRecursive "out/docs" "../mathnet-websites/numerics" true |> printfn "%A"
@ -332,7 +334,7 @@ let publishDocs (release:BundleRelease) =
Git.Commit.Commit repo (sprintf "Numerics: %s docs update" release.PackageVersion) Git.Commit.Commit repo (sprintf "Numerics: %s docs update" release.PackageVersion)
Git.Branches.pushBranch repo "origin" "master" Git.Branches.pushBranch repo "origin" "master"
let publishApi (release:BundleRelease) = let publishApi (release:Release) =
let repo = "../mathnet-websites" let repo = "../mathnet-websites"
Git.Branches.pull repo "origin" "master" Git.Branches.pull repo "origin" "master"
CleanDir "../mathnet-websites/numerics/api" CleanDir "../mathnet-websites/numerics/api"

Loading…
Cancel
Save