diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 4a74930b..6270d494 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -13,6 +13,12 @@ "commands": [ "fake" ] + }, + "fsharp.formatting.commandtool": { + "version": "11.4.1", + "commands": [ + "fsdocs" + ] } } } \ No newline at end of file diff --git a/.gitignore b/.gitignore index d1b5bba8..28b1b3a1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ bin/ obj/ out/ +output/ +tmp/ # User-specific Files *.user @@ -59,22 +61,18 @@ Thumbs.db ehthumbs.db Desktop.ini -# NuGet Packages -# NOTE: we do NOT use package restore in the core projects, but do use it with FAKE builds. + packages/* !packages/.gitattributes !packages/TaskParallelLibrary !packages/FSharp.Core - -# FAKE & Paket packages paket-files .fake - -# Generated Doc Files -docs/content/License.md -docs/content/Contributing.md -docs/content/Contributors.md -docs/content/ReleaseNotes.md -docs/content/ReleaseNotes-*.md +.fsdocs /build.fsx.lock +docs/License.md +docs/Contributing.md +docs/Contributors.md +docs/ReleaseNotes.md +docs/ReleaseNotes-*.md diff --git a/src/Directory.Build.props b/Directory.Build.props similarity index 79% rename from src/Directory.Build.props rename to Directory.Build.props index 7c125e86..3273ce3b 100644 --- a/src/Directory.Build.props +++ b/Directory.Build.props @@ -18,7 +18,7 @@ true - $(MSBuildThisFileDirectory)MathNet.Numerics.snk + $(MSBuildThisFileDirectory)build/MathNet.Numerics.snk false STRONGNAME .Signed @@ -30,6 +30,11 @@ NATIVE;$(CommonConstants) - + + + /logo.png + https://numerics.mathdotnet.com/ + fixed-left + diff --git a/MathNet.Numerics.sln b/MathNet.Numerics.sln index a3ac4792..40270f61 100644 --- a/MathNet.Numerics.sln +++ b/MathNet.Numerics.sln @@ -27,48 +27,18 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{B54A0B40-DE22-49FB-B1C0-6E5BDA3B0B2F}" ProjectSection(SolutionItems) = preProject appveyor.yml = appveyor.yml - docs\tools\build-docs.fsx = docs\tools\build-docs.fsx build\build-framework.fsx = build\build-framework.fsx build.fsx = build.fsx - src\Directory.Build.props = src\Directory.Build.props global.json = global.json paket.dependencies = paket.dependencies paket.lock = paket.lock + Directory.Build.props = Directory.Build.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestData", "src\TestData\TestData.csproj", "{AF3253C9-4DB5-45A0-98CF-C105FDA9DA47}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmark", "src\Benchmark\Benchmark.csproj", "{82444930-9FD7-41B6-B476-CCE41A0C0A0B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{B890C1AF-E488-490F-B784-2C6F8C924693}" -ProjectSection(SolutionItems) = preProject - docs\content\Build.md = docs\content\Build.md - docs\content\Compatibility.md = docs\content\Compatibility.md - docs\content\Constants.md = docs\content\Constants.md - docs\content\CSV.md = docs\content\CSV.md - docs\content\DescriptiveStatistics.md = docs\content\DescriptiveStatistics.md - docs\content\Distance.md = docs\content\Distance.md - docs\content\Euclid.md = docs\content\Euclid.md - docs\content\Functions.md = docs\content\Functions.md - docs\content\Generate.md = docs\content\Generate.md - docs\content\IFsharpNotebook.md = docs\content\IFsharpNotebook.md - docs\content\index.md = docs\content\index.md - docs\content\IntegralTransforms.md = docs\content\IntegralTransforms.md - docs\content\Integration.md = docs\content\Integration.md - docs\content\Interpolation.md = docs\content\Interpolation.md - docs\content\LinearEquations.md = docs\content\LinearEquations.md - docs\content\MatlabFiles.md = docs\content\MatlabFiles.md - docs\content\Matrix.md = docs\content\Matrix.md - docs\content\MatrixMarket.md = docs\content\MatrixMarket.md - docs\content\MKL.md = docs\content\MKL.md - docs\content\Packages.md = docs\content\Packages.md - docs\content\Probability.md = docs\content\Probability.md - docs\content\Random.md = docs\content\Random.md - docs\content\Regression.md = docs\content\Regression.md - docs\content\Users.md = docs\content\Users.md - README.md = README.md -EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Providers.MKL", "src\Providers.MKL\Providers.MKL.csproj", "{0B5FAFAA-4286-4D92-B5AB-CBA75ADDA0BB}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Providers.CUDA", "src\Providers.CUDA\Providers.CUDA.csproj", "{3C0D4A87-CC89-43B6-B028-4122099D692F}" diff --git a/build.cmd b/build.cmd index 72da2752..082020e1 100644 --- a/build.cmd +++ b/build.cmd @@ -8,4 +8,4 @@ if errorlevel 1 ( exit /b %errorlevel% ) -packages\build\FAKE\tools\FAKE.exe build.fsx %* +dotnet fake run build.fsx -t %* diff --git a/build.fsx b/build.fsx index 6d78b463..65e4abd7 100644 --- a/build.fsx +++ b/build.fsx @@ -8,23 +8,502 @@ // Math.NET Numerics - https://numerics.mathdotnet.com // Copyright (c) Math.NET - Open Source MIT/X11 License // -// FAKE build script, see http://fsharp.github.io/FAKE +// FAKE build script, see https://fake.build/ // +#r "paket: +nuget Fake.Core.Context +nuget Fake.Core.Environment +nuget Fake.Core.ReleaseNotes +nuget Fake.Core.String +nuget Fake.Core.Target +nuget Fake.Core.Trace +nuget Fake.DotNet.Cli +nuget Fake.DotNet.NuGet +nuget Fake.IO.FileSystem +nuget Fake.IO.Zip +nuget Fake.Tools.Git" +#load "./.fake/build.fsx/intellisense.fsx" + +open FSharp.Core +open Fake.Core +open Fake.Core.TargetOperators +open Fake.DotNet +open Fake.DotNet.NuGet +open Fake.IO +open Fake.IO.FileSystemOperators +open Fake.IO.Globbing.Operators +open Fake.Tools.Git +open System +open System.IO + +let header = File.read (__SOURCE_DIRECTORY__ __SOURCE_FILE__) |> Seq.take 10 |> Seq.map (fun s -> s.Substring(2)) |> String.toLines +let rootDir = Path.getFullName __SOURCE_DIRECTORY__ +Environment.CurrentDirectory <- rootDir +Trace.log rootDir + +let args = Target.getArguments() +let isStrongname, isSign, isIncremental = + match args with + | Some args -> + args |> Seq.contains "--strongname", + args |> Seq.contains "--sign" && Environment.isWindows, + args |> Seq.contains "--incremental" + | None -> false, false, false + + // -------------------------------------------------------------------------------------- -// PRELUDE +// .Net SDK // -------------------------------------------------------------------------------------- -#I "packages/build/FAKE/tools" -#r "packages/build/FAKE/tools/FakeLib.dll" -open Fake -open Fake.DocuHelper -open System -open System.IO +let dotnet workingDir command = + DotNet.exec (fun c -> { c with WorkingDirectory = workingDir}) command "" |> ignore + +let dotnetWeak workingDir command = + let properties = [ ("StrongName", "False") ] + let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" + DotNet.exec (fun c -> { c with WorkingDirectory = workingDir }) command suffix |> ignore + +let dotnetStrong workingDir command = + let properties = [ ("StrongName", "True") ] + let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" + DotNet.exec (fun c -> { c with WorkingDirectory = workingDir}) command suffix |> ignore + + +// -------------------------------------------------------------------------------------- +// Model +// -------------------------------------------------------------------------------------- + +type Release = + { RepoKey: string + Title: string + AssemblyVersion: string + PackageVersion: string + ReleaseNotes: string + ReleaseNotesFile: string } + +type ZipPackage = + { Id: string + Release: Release + Title: string } + +type NuGetPackage = + { Id: string + Release: Release } + +type VisualStudioProject = + { AssemblyName: string + ProjectFile: string + OutputDir: string + Release: Release + NuGetPackages: NuGetPackage list } + +type NativeVisualStudioProject = + { BinaryName: string + ProjectFile: string + OutputDir: string + Release: Release + NuGetPackages: NuGetPackage list } + +type NativeBashScriptProject = + { BinaryName: string + BashScriptFile: string + OutputDir: string + Release: Release + NuGetPackages: NuGetPackage list } + +type Project = + | VisualStudio of VisualStudioProject + | NativeVisualStudio of NativeVisualStudioProject + | NativeBashScript of NativeBashScriptProject + +type Solution = + { Key: string + SolutionFile: string + Projects: Project list + Release: Release + ZipPackages: ZipPackage list + OutputDir: string + OutputLibDir: string + OutputLibStrongNameDir: string + OutputZipDir: string + OutputNuGetDir: string } + +type NuGetSpecification = + { NuGet: NuGetPackage + NuSpecFile: string + Title: string } + + +let release repoKey title releaseNotesFile : Release = + let info = ReleaseNotes.load releaseNotesFile + let buildPart = "0" + let assemblyVersion = info.AssemblyVersion + "." + buildPart + let packageVersion = info.NugetVersion + let notes = info.Notes |> List.map (fun l -> l.Replace("*","").Replace("`","")) |> String.toLines + { Release.RepoKey = repoKey + Title = title + AssemblyVersion = assemblyVersion + PackageVersion = packageVersion + ReleaseNotes = notes + ReleaseNotesFile = releaseNotesFile } + +let zipPackage packageId title release = + { ZipPackage.Id = packageId + Title = title + Release = release } + +let nugetPackage packageId release = + { NuGetPackage.Id = packageId + Release = release } + +let project assemblyName projectFile nuGetPackages = + { VisualStudioProject.AssemblyName = assemblyName + ProjectFile = projectFile + OutputDir = (Path.GetDirectoryName projectFile) "bin" "Release" + NuGetPackages = nuGetPackages + Release = nuGetPackages |> List.map (fun p -> p.Release) |> List.distinct |> List.exactlyOne } + |> Project.VisualStudio + +let nativeProject binaryName projectFile nuGetPackages = + { NativeVisualStudioProject.BinaryName = binaryName + ProjectFile = projectFile + OutputDir = (Path.GetDirectoryName projectFile) "bin" "Release" + NuGetPackages = nuGetPackages + Release = nuGetPackages |> List.map (fun p -> p.Release) |> List.distinct |> List.exactlyOne } + |> Project.NativeVisualStudio + +let nativeBashScriptProject binaryName bashScriptFile nuGetPackages = + { NativeBashScriptProject.BinaryName = binaryName + BashScriptFile = bashScriptFile + OutputDir = (Path.GetDirectoryName bashScriptFile) "bin" "Release" + NuGetPackages = nuGetPackages + Release = nuGetPackages |> List.map (fun p -> p.Release) |> List.distinct |> List.exactlyOne } + |> Project.NativeBashScript + + +let projectOutputDir = function + | VisualStudio p -> p.OutputDir + | NativeVisualStudio p -> p.OutputDir + | NativeBashScript p -> p.OutputDir + +let projectRelease = function + | VisualStudio p -> p.Release + | NativeVisualStudio p -> p.Release + | NativeBashScript p -> p.Release + +let projectNuGetPackages = function + | VisualStudio p -> p.NuGetPackages + | NativeVisualStudio p -> p.NuGetPackages + | NativeBashScript p -> p.NuGetPackages + +let solution key solutionFile projects zipPackages = + { Solution.Key = key + SolutionFile = solutionFile + Projects = projects + ZipPackages = zipPackages + Release = List.concat [ projects |> List.map projectRelease; zipPackages |> List.map (fun p -> p.Release) ] |> List.distinct |> List.exactlyOne + OutputDir = "out" key + OutputLibDir = "out" key "Lib" + OutputLibStrongNameDir = "out" key "Lib-StrongName" + OutputZipDir = "out" key "Zip" + OutputNuGetDir = "out" key "NuGet" } + +let traceHeader (releases:Release list) = + Trace.log header + let titleLength = releases |> List.map (fun r -> r.Title.Length) |> List.max + for release in releases do + Trace.log ([ " "; release.Title.PadRight titleLength; " v"; release.PackageVersion ] |> String.concat "") + Trace.log "" + dotnet rootDir "--info" + Trace.log "" + + +// -------------------------------------------------------------------------------------- +// PREPARE +// -------------------------------------------------------------------------------------- + +let private regexes_sl = new System.Collections.Generic.Dictionary() +let private getRegexSingleLine pattern = + match regexes_sl.TryGetValue pattern with + | true, regex -> regex + | _ -> (System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.Singleline)) +let regex_replace_singleline pattern (replacement : string) text = (getRegexSingleLine pattern).Replace(text, replacement) + +let patchVersionInResource path (release:Release) = + File.applyReplace + (String.regex_replace @"\d+\.\d+\.\d+\.\d+" release.AssemblyVersion + >> String.regex_replace @"\d+,\d+,\d+,\d+" (String.replace "." "," release.AssemblyVersion)) + path + +let patchVersionInProjectFile (project:Project) = + match project with + | VisualStudio p -> + let semverSplit = p.Release.PackageVersion.IndexOf('-') + let prefix = if semverSplit <= 0 then p.Release.PackageVersion else p.Release.PackageVersion.Substring(0, semverSplit) + let suffix = if semverSplit <= 0 then "" else p.Release.PackageVersion.Substring(semverSplit+1) + File.applyReplace + (String.regex_replace """\.*\""" (sprintf """%s""" p.Release.PackageVersion) + >> String.regex_replace """\.*\""" (sprintf """%s""" p.Release.PackageVersion) + >> String.regex_replace """\.*\""" (sprintf """%s""" p.Release.AssemblyVersion) + >> String.regex_replace """\.*\""" (sprintf """%s""" p.Release.AssemblyVersion) + >> String.regex_replace """\.*\""" (sprintf """%s""" prefix) + >> String.regex_replace """\.*\""" (sprintf """%s""" suffix) + >> regex_replace_singleline """\.*\""" (sprintf """%s""" (p.Release.ReleaseNotes.Replace("<","<").Replace(">",">")))) + p.ProjectFile + | NativeVisualStudio _ -> () + | NativeBashScript _ -> () + + +// -------------------------------------------------------------------------------------- +// BUILD +// -------------------------------------------------------------------------------------- + +let clean (solution:Solution) = dotnet rootDir (sprintf "clean %s --configuration Release --verbosity minimal" solution.SolutionFile) + +let restoreWeak (solution:Solution) = dotnetWeak rootDir (sprintf "restore %s --verbosity minimal" solution.SolutionFile) +let restoreStrong (solution:Solution) = dotnetStrong rootDir (sprintf "restore %s --verbosity minimal" solution.SolutionFile) + +let buildWeak (solution:Solution) = dotnetWeak rootDir (sprintf "build %s --configuration Release --no-incremental --no-restore --verbosity minimal" solution.SolutionFile) +let buildStrong (solution:Solution) = dotnetStrong rootDir (sprintf "build %s --configuration Release --no-incremental --no-restore --verbosity minimal" solution.SolutionFile) + +let packWeak (solution:Solution) = dotnetWeak rootDir (sprintf "pack %s --configuration Release --no-restore --verbosity minimal" solution.SolutionFile) +let packStrong (solution:Solution) = dotnetStrong rootDir (sprintf "pack %s --configuration Release --no-restore --verbosity minimal" solution.SolutionFile) + +let packProjectWeak = function + | VisualStudio p -> dotnetWeak rootDir (sprintf "pack %s --configuration Release --no-restore --no-build" p.ProjectFile) + | _ -> failwith "Project type not supported" +let packProjectStrong = function + | VisualStudio p -> dotnetStrong rootDir (sprintf "pack %s --configuration Release --no-restore --no-build" p.ProjectFile) + | _ -> failwith "Project type not supported" + +//let buildConfig config subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [ "Configuration", config ] subject |> ignore +//let build subject = buildConfig "Release" subject +//let buildSigned subject = buildConfig "Release-Signed" subject +let buildConfig32 config subject = MSBuild.run id "" (if isIncremental then "Build" else "Rebuild") [("Configuration", config); ("Platform","Win32")] subject |> ignore +let buildConfig64 config subject = MSBuild.run id "" (if isIncremental then "Build" else "Rebuild") [("Configuration", config); ("Platform","x64")] subject |> ignore + + +// -------------------------------------------------------------------------------------- +// COLLECT +// -------------------------------------------------------------------------------------- + +let collectBinaries (solution:Solution) = + solution.Projects |> List.iter (function + | VisualStudio project -> Shell.copyDir solution.OutputLibDir project.OutputDir (fun n -> n.Contains(project.AssemblyName + ".dll") || n.Contains(project.AssemblyName + ".pdb") || n.Contains(project.AssemblyName + ".xml")) + | _ -> failwith "Project type not supported") + +let collectBinariesSN (solution:Solution) = + solution.Projects |> List.iter (function + | VisualStudio project -> Shell.copyDir solution.OutputLibStrongNameDir project.OutputDir (fun n -> n.Contains(project.AssemblyName + ".dll") || n.Contains(project.AssemblyName + ".pdb") || n.Contains(project.AssemblyName + ".xml")) + | _ -> failwith "Project type not supported") + +let collectNuGetPackages (solution:Solution) = + solution.Projects |> List.iter (function + | VisualStudio project -> Shell.copyDir solution.OutputNuGetDir project.OutputDir (fun n -> n.EndsWith(".nupkg")) + | _ -> failwith "Project type not supported") + + +// -------------------------------------------------------------------------------------- +// TEST +// -------------------------------------------------------------------------------------- + +let test testsDir testsProj framework = + dotnet testsDir (sprintf "run -p %s --configuration Release --framework %s --no-restore --no-build" testsProj framework) + + +// -------------------------------------------------------------------------------------- +// PACKAGES +// -------------------------------------------------------------------------------------- + +let provideLicense path = + File.readAsString "LICENSE.md" + |> String.convertTextToWindowsLineBreaks + |> File.replaceContent (path "license.txt") + +let provideReadme title (release:Release) path = + String.concat Environment.NewLine [header; " " + title; ""; File.readAsString release.ReleaseNotesFile] + |> String.convertTextToWindowsLineBreaks + |> File.replaceContent (path "readme.txt") + + +// SIGN + +let sign fingerprint timeserver (solution: Solution) = + let files = solution.Projects |> Seq.collect (function + | VisualStudio project -> !! (project.OutputDir + "/**/" + project.AssemblyName + ".dll") + | _ -> failwith "Project type not supported") + let fileArgs = files |> Seq.map (sprintf "\"%s\"") |> String.concat " " + let optionsArgs = sprintf """/v /fd sha256 /sha1 "%s" /tr "%s" /td sha256""" fingerprint timeserver + let arguments = sprintf """sign %s %s""" optionsArgs fileArgs + let result = + CreateProcess.fromRawCommandLine (ProcessUtils.findLocalTool "SIGNTOOL" "signtool.exe" ["""C:\Program Files (x86)\Windows Kits\10\bin\x64"""]) arguments + |> CreateProcess.withTimeout (TimeSpan.FromMinutes 10.) + |> Proc.run + if result.ExitCode <> 0 then failwithf "Error during SignTool call " + +let signNuGet fingerprint timeserver (solutions: Solution list) = + Shell.cleanDir "obj/NuGet" + solutions + |> Seq.collect (fun solution -> !! (solution.OutputNuGetDir "*.nupkg")) + |> Seq.distinct + |> Seq.iter (fun file -> + let args = sprintf """sign "%s" -HashAlgorithm SHA256 -TimestampHashAlgorithm SHA256 -CertificateFingerprint "%s" -Timestamper "%s""" (Path.getFullName file) fingerprint timeserver + let result = + CreateProcess.fromRawCommandLine "packages/build/NuGet.CommandLine/tools/NuGet.exe" args + |> CreateProcess.withWorkingDirectory (Path.getFullName "obj/NuGet") + |> CreateProcess.withTimeout (TimeSpan.FromMinutes 10.) + |> Proc.run + if result.ExitCode <> 0 then failwith "Error during NuGet sign.") + Directory.delete "obj/NuGet" + + +// ZIP + +let zip (package:ZipPackage) zipDir filesDir filesFilter = + Shell.cleanDir "obj/Zip" + let workPath = "obj/Zip/" + package.Id + Shell.copyDir workPath filesDir filesFilter + provideLicense workPath + provideReadme (sprintf "%s v%s" package.Title package.Release.PackageVersion) package.Release workPath + Zip.zip "obj/Zip/" (zipDir sprintf "%s-%s.zip" package.Id package.Release.PackageVersion) !! (workPath + "/**/*.*") + Directory.delete "obj/Zip" + + +// NUGET + +let updateNuspec (nuget:NuGetPackage) outPath (spec:NuGet.NuGet.NuGetParams) = + { spec with ToolPath = "packages/build/NuGet.CommandLine/tools/NuGet.exe" + OutputPath = outPath + WorkingDir = "obj/NuGet" + Version = nuget.Release.PackageVersion + ReleaseNotes = nuget.Release.ReleaseNotes + Publish = false } + +let nugetPackManually (solution:Solution) (packages:NuGetSpecification list) = + Shell.cleanDir "obj/NuGet" + for pack in packages do + provideLicense "obj/NuGet" + provideReadme (sprintf "%s v%s" pack.Title pack.NuGet.Release.PackageVersion) pack.NuGet.Release "obj/NuGet" + NuGet.NuGet (updateNuspec pack.NuGet solution.OutputNuGetDir) pack.NuSpecFile + Shell.cleanDir "obj/NuGet" + Directory.delete "obj/NuGet" + + +// -------------------------------------------------------------------------------------- +// Documentation +// -------------------------------------------------------------------------------------- + +let provideDocExtraFiles extraDocs (releases:Release list) = + for (fileName, docName) in extraDocs do Shell.copyFile ("docs" docName) fileName + let menu = releases |> List.map (fun r -> sprintf "[%s](%s)" r.Title (r.ReleaseNotesFile |> String.replace "RELEASENOTES" "ReleaseNotes" |> String.replace ".md" ".html")) |> String.concat " | " + for release in releases do + String.concat Environment.NewLine + [ "# " + release.Title + " Release Notes" + menu + "" + File.readAsString release.ReleaseNotesFile ] + |> File.replaceContent ("docs" (release.ReleaseNotesFile |> String.replace "RELEASENOTES" "ReleaseNotes")) + + +// -------------------------------------------------------------------------------------- +// Publishing +// Requires permissions; intended only for maintainers +// -------------------------------------------------------------------------------------- + +let publishReleaseTag title prefix (release:Release) = + // inspired by Deedle/tpetricek + let tagName = prefix + "v" + release.PackageVersion + let tagMessage = String.concat Environment.NewLine [title + " v" + release.PackageVersion; ""; release.ReleaseNotes ] + let cmd = sprintf """tag -a %s -m "%s" """ tagName tagMessage + CommandHelper.runSimpleGitCommand "." cmd |> printfn "%s" + let _, remotes, _ = CommandHelper.runGitCommand "." "remote -v" + let main = remotes |> Seq.find (fun s -> s.Contains("(push)") && s.Contains("mathnet/mathnet-" + release.RepoKey)) + let remoteName = main.Split('\t').[0] + Branches.pushTag "." remoteName tagName + +let publishNuGet (solutions: Solution list) = + Shell.cleanDir "obj/NuGet" + let rec impl trials (file:string) = + Trace.log ("NuGet Push: " + System.IO.Path.GetFileName(file) + ".") + try + let result = + CreateProcess.fromRawCommandLine + "packages/build/NuGet.CommandLine/tools/NuGet.exe" + (sprintf """push "%s" -Source https://api.nuget.org/v3/index.json -T 900""" (Path.getFullName file)) + |> CreateProcess.withWorkingDirectory (Path.getFullName "obj/NuGet") + |> CreateProcess.withTimeout (TimeSpan.FromMinutes 10.) + |> Proc.run + if result.ExitCode <> 0 then failwith "Error during NuGet push." + with exn -> + if trials > 0 then impl (trials-1) file + else () + solutions + |> Seq.collect (fun solution -> !! (solution.OutputNuGetDir "*.nupkg")) + |> Seq.distinct + |> Seq.iter (impl 3) + Directory.delete "obj/NuGet" + +let publishDocs (release:Release) = + let repo = "../web-mathnet-" + release.RepoKey + Branches.pull repo "origin" "gh-pages" + Shell.copyRecursive "out/docs" repo true |> printfn "%A" + Staging.stageAll repo + Commit.exec repo (sprintf "%s: %s docs update" release.Title release.PackageVersion) + Branches.pushBranch repo "origin" "gh-pages" + +let publishApi (release:Release) = + let repo = "../web-mathnet-" + release.RepoKey + Branches.pull repo "origin" "gh-pages" + Shell.cleanDir (repo + "/api") + Shell.copyRecursive "out/api" (repo + "/api") true |> printfn "%A" + Staging.stageAll repo + Commit.exec repo (sprintf "%s: %s api update" release.Title release.PackageVersion) + Branches.pushBranch repo "origin" "gh-pages" + +let publishNuGetToArchive (package:NuGetPackage) archivePath nupkgFile = + let tempDir = Path.GetTempPath() Path.GetRandomFileName() + let archiveDir = archivePath package.Id package.Release.PackageVersion + Shell.cleanDirs [tempDir; archiveDir] + nupkgFile |> Shell.copyFile archiveDir + use sha512 = System.Security.Cryptography.SHA512.Create() + let hash = File.ReadAllBytes nupkgFile |> sha512.ComputeHash |> Convert.ToBase64String + File.WriteAllText ((archiveDir (Path.GetFileName(nupkgFile) + ".sha512")), hash) + Zip.unzip tempDir nupkgFile + !! (tempDir "*.nuspec") |> Shell.copy archiveDir + Directory.delete tempDir + +let publishArchiveManual title zipOutPath nugetOutPath (zipPackages:ZipPackage list) (nugetPackages:NuGetPackage list) = + let archivePath = (Environment.environVarOrFail "MathNetReleaseArchive") title + if Directory.Exists archivePath |> not then failwith "Release archive directory does not exists. Safety Check failed." + for zipPackage in zipPackages do + let zipFile = zipOutPath sprintf "%s-%s.zip" zipPackage.Id zipPackage.Release.PackageVersion + if File.exists zipFile then + zipFile |> Shell.copyFile (archivePath "Zip") + for nugetPackage in nugetPackages do + let nupkgFile = nugetOutPath sprintf "%s.%s.nupkg" nugetPackage.Id nugetPackage.Release.PackageVersion + if File.exists nupkgFile then + Trace.trace nupkgFile + publishNuGetToArchive nugetPackage (archivePath "NuGet") nupkgFile + let symbolsFile = nugetOutPath sprintf "%s.%s.symbols.nupkg" nugetPackage.Id nugetPackage.Release.PackageVersion + if File.exists symbolsFile then + symbolsFile |> Shell.copyFile (archivePath "Symbols") + +let publishArchive (solution:Solution) = + let zipOutPath = solution.OutputZipDir + let nugetOutPath = solution.OutputNuGetDir + let zipPackages = solution.ZipPackages + let nugetPackages = solution.Projects |> List.collect projectNuGetPackages |> List.distinct + publishArchiveManual solution.Release.Title zipOutPath nugetOutPath zipPackages nugetPackages + +let publishArchives (solutions: Solution list) = solutions |> List.iter publishArchive + + + + + -#load "build/build-framework.fsx" -open BuildFramework // -------------------------------------------------------------------------------------- @@ -157,33 +636,28 @@ let allProjects = allSolutions |> List.collect (fun s -> s.Projects) |> List.dis // PREPARE // -------------------------------------------------------------------------------------- -Target "Start" DoNothing +Target.create "Start" ignore -Target "Clean" (fun _ -> - DeleteDirs (!! "src/**/obj/" ++ "src/**/bin/" ) - CleanDirs [ "out/api"; "out/docs" ] - CleanDirs [ "out/MKL"; "out/ATLAS"; "out/CUDA"; "out/OpenBLAS" ] // Native Providers - allSolutions |> List.iter (fun solution -> CleanDirs [ solution.OutputZipDir; solution.OutputNuGetDir; solution.OutputLibDir; solution.OutputLibStrongNameDir ])) +Target.create "Clean" (fun _ -> + Shell.deleteDirs (!! "src/**/obj/" ++ "src/**/bin/" ) + Shell.cleanDirs [ "out/api"; "out/docs" ] + Shell.cleanDirs [ "out/MKL"; "out/ATLAS"; "out/CUDA"; "out/OpenBLAS" ] // Native Providers + allSolutions |> List.iter (fun solution -> Shell.cleanDirs [ solution.OutputZipDir; solution.OutputNuGetDir; solution.OutputLibDir; solution.OutputLibStrongNameDir ])) -Target "ApplyVersion" (fun _ -> +Target.create "ApplyVersion" (fun _ -> allProjects |> List.iter patchVersionInProjectFile - patchVersionInAssemblyInfo "src/FSharp" numericsRelease - patchVersionInAssemblyInfo "src/TestData" numericsRelease - patchVersionInAssemblyInfo "src/Numerics.Tests" numericsRelease - patchVersionInAssemblyInfo "src/FSharp.Tests" numericsRelease - patchVersionInAssemblyInfo "src/Data.Tests" numericsRelease patchVersionInResource "src/NativeProviders/MKL/resource.rc" mklRelease patchVersionInResource "src/NativeProviders/CUDA/resource.rc" cudaRelease patchVersionInResource "src/NativeProviders/OpenBLAS/resource.rc" openBlasRelease) -Target "Restore" (fun _ -> allSolutions |> List.iter restoreWeak) +Target.create "Restore" (fun _ -> allSolutions |> List.iter restoreWeak) "Start" - =?> ("Clean", not (hasBuildParam "incremental")) + =?> ("Clean", not isIncremental) ==> "Restore" -Target "Prepare" DoNothing +Target.create "Prepare" ignore "Start" - =?> ("Clean", not (hasBuildParam "incremental")) + =?> ("Clean", not isIncremental) ==> "ApplyVersion" ==> "Prepare" @@ -195,80 +669,78 @@ Target "Prepare" DoNothing let fingerprint = "490408de3618bed0a28e68dc5face46e5a3a97dd" let timeserver = "http://time.certum.pl/" -Target "Build" (fun _ -> +Target.create "Build" (fun _ -> // Strong Name Build (with strong name, without certificate signature) - if hasBuildParam "strongname" then - CleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) + if isStrongname then + Shell.cleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) restoreStrong numericsSolution buildStrong numericsSolution - if isWindows && hasBuildParam "sign" then sign fingerprint timeserver numericsSolution + if isSign then sign fingerprint timeserver numericsSolution collectBinariesSN numericsSolution zip numericsStrongNameZipPackage numericsSolution.OutputZipDir numericsSolution.OutputLibStrongNameDir (fun f -> f.Contains("MathNet.Numerics.") || f.Contains("System.Threading.") || f.Contains("FSharp.Core.")) - if isWindows then - packStrong numericsSolution - collectNuGetPackages numericsSolution + packStrong numericsSolution + collectNuGetPackages numericsSolution // Normal Build (without strong name, with certificate signature) - CleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) + Shell.cleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) restoreWeak numericsSolution buildWeak numericsSolution - if isWindows && hasBuildParam "sign" then sign fingerprint timeserver numericsSolution + if isSign then sign fingerprint timeserver numericsSolution collectBinaries numericsSolution zip numericsZipPackage numericsSolution.OutputZipDir numericsSolution.OutputLibDir (fun f -> f.Contains("MathNet.Numerics.") || f.Contains("System.Threading.") || f.Contains("FSharp.Core.")) - if isWindows then - packWeak numericsSolution - collectNuGetPackages numericsSolution + packWeak numericsSolution + collectNuGetPackages numericsSolution // NuGet Sign (all or nothing) - if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [numericsSolution] + if isSign then signNuGet fingerprint timeserver [numericsSolution] ) "Prepare" ==> "Build" -Target "MklWinBuild" (fun _ -> +Target.create "MklWinBuild" (fun _ -> restoreWeak mklSolution buildConfig32 "Release-MKL" !! "MathNet.Numerics.MKL.sln" buildConfig64 "Release-MKL" !! "MathNet.Numerics.MKL.sln" - CreateDir mklSolution.OutputZipDir + Directory.create mklSolution.OutputZipDir zip mklWinZipPackage mklSolution.OutputZipDir "out/MKL/Windows" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5md.dll")) - CreateDir mklSolution.OutputNuGetDir + Directory.create mklSolution.OutputNuGetDir nugetPackManually mklSolution [ mklWinPack; mklWin32Pack; mklWin64Pack ] // NuGet Sign (all or nothing) - if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [mklSolution] + if isSign then signNuGet fingerprint timeserver [mklSolution] ) "Prepare" ==> "MklWinBuild" -Target "CudaWinBuild" (fun _ -> +Target.create "CudaWinBuild" (fun _ -> restoreWeak cudaSolution buildConfig64 "Release-CUDA" !! "MathNet.Numerics.CUDA.sln" - CreateDir cudaSolution.OutputZipDir + Directory.create cudaSolution.OutputZipDir zip cudaWinZipPackage cudaSolution.OutputZipDir "out/CUDA/Windows" (fun f -> f.Contains("MathNet.Numerics.CUDA.") || f.Contains("cublas") || f.Contains("cudart") || f.Contains("cusolver")) - CreateDir cudaSolution.OutputNuGetDir + Directory.create cudaSolution.OutputNuGetDir nugetPackManually cudaSolution [ cudaWinPack ] // NuGet Sign (all or nothing) - if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [cudaSolution] + if isSign then signNuGet fingerprint timeserver [cudaSolution] ) "Prepare" ==> "CudaWinBuild" -Target "OpenBlasWinBuild" (fun _ -> +Target.create "OpenBlasWinBuild" (fun _ -> restoreWeak openBlasSolution buildConfig32 "Release-OpenBLAS" !! "MathNet.Numerics.OpenBLAS.sln" buildConfig64 "Release-OpenBLAS" !! "MathNet.Numerics.OpenBLAS.sln" - CreateDir openBlasSolution.OutputZipDir + Directory.create openBlasSolution.OutputZipDir zip openBlasWinZipPackage openBlasSolution.OutputZipDir "out/OpenBLAS/Windows" (fun f -> f.Contains("MathNet.Numerics.OpenBLAS.") || f.Contains("libgcc") || f.Contains("libgfortran") || f.Contains("libopenblas") || f.Contains("libquadmath")) - CreateDir openBlasSolution.OutputNuGetDir + Directory.create openBlasSolution.OutputNuGetDir nugetPackManually openBlasSolution [ openBlasWinPack ] // NuGet Sign (all or nothing) - if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [openBlasSolution] + if isSign then signNuGet fingerprint timeserver [openBlasSolution] ) "Prepare" ==> "OpenBlasWinBuild" @@ -279,63 +751,63 @@ Target "OpenBlasWinBuild" (fun _ -> // -------------------------------------------------------------------------------------- let testNumerics framework = test "src/Numerics.Tests" "Numerics.Tests.csproj" framework -Target "TestNumerics" DoNothing -Target "TestNumericsNET50" (fun _ -> testNumerics "net5.0") -Target "TestNumericsNET48" (fun _ -> testNumerics "net48") +Target.create "TestNumerics" ignore +Target.create "TestNumericsNET50" (fun _ -> testNumerics "net5.0") +Target.create "TestNumericsNET48" (fun _ -> testNumerics "net48") "Build" ==> "TestNumericsNET50" ==> "TestNumerics" -"Build" =?> ("TestNumericsNET48", isWindows) ==> "TestNumerics" +"Build" =?> ("TestNumericsNET48", Environment.isWindows) ==> "TestNumerics" let testFsharp framework = test "src/FSharp.Tests" "FSharp.Tests.fsproj" framework -Target "TestFsharp" DoNothing -Target "TestFsharpNET50" (fun _ -> testFsharp "net5.0") -Target "TestFsharpNET48" (fun _ -> testFsharp "net48") +Target.create "TestFsharp" ignore +Target.create "TestFsharpNET50" (fun _ -> testFsharp "net5.0") +Target.create "TestFsharpNET48" (fun _ -> testFsharp "net48") "Build" ==> "TestFsharpNET50" ==> "TestFsharp" -"Build" =?> ("TestFsharpNET48", isWindows) ==> "TestFsharp" +"Build" =?> ("TestFsharpNET48", Environment.isWindows) ==> "TestFsharp" let testData framework = test "src/Data.Tests" "Data.Tests.csproj" framework -Target "TestData" DoNothing -Target "TestDataNET50" (fun _ -> testData "net5.0") -Target "TestDataNET48" (fun _ -> testData "net48") +Target.create "TestData" ignore +Target.create "TestDataNET50" (fun _ -> testData "net5.0") +Target.create "TestDataNET48" (fun _ -> testData "net48") "Build" ==> "TestDataNET50" ==> "TestData" -"Build" =?> ("TestDataNET48", isWindows) ==> "TestData" -Target "Test" DoNothing +"Build" =?> ("TestDataNET48", Environment.isWindows) ==> "TestData" +Target.create "Test" ignore "TestNumerics" ==> "Test" "TestFsharp" ==> "Test" "TestData" ==> "Test" let testMKL framework = test "src/Numerics.Tests" "Numerics.Tests.MKL.csproj" framework -Target "MklTest" DoNothing -Target "MklTestNET50" (fun _ -> testMKL "net5.0") -Target "MklTestNET48" (fun _ -> testMKL "net48") +Target.create "MklTest" ignore +Target.create "MklTestNET50" (fun _ -> testMKL "net5.0") +Target.create "MklTestNET48" (fun _ -> testMKL "net48") "MklWinBuild" ==> "MklTestNET50" ==> "MklTest" -"MklWinBuild" =?> ("MklTestNET48", isWindows) ==> "MklTest" +"MklWinBuild" =?> ("MklTestNET48", Environment.isWindows) ==> "MklTest" let testOpenBLAS framework = test "src/Numerics.Tests" "Numerics.Tests.OpenBLAS.csproj" framework -Target "OpenBlasTest" DoNothing -Target "OpenBlasTestNET50" (fun _ -> testOpenBLAS "net5.0") -Target "OpenBlasTestNET48" (fun _ -> testOpenBLAS "net48") +Target.create "OpenBlasTest" ignore +Target.create "OpenBlasTestNET50" (fun _ -> testOpenBLAS "net5.0") +Target.create "OpenBlasTestNET48" (fun _ -> testOpenBLAS "net48") "OpenBlasWinBuild" ==> "OpenBlasTestNET50" ==> "OpenBlasTest" -"OpenBlasWinBuild" =?> ("OpenBlasTestNET48", isWindows) ==> "OpenBlasTest" +"OpenBlasWinBuild" =?> ("OpenBlasTestNET48", Environment.isWindows) ==> "OpenBlasTest" let testCUDA framework = test "src/Numerics.Tests" "Numerics.Tests.CUDA.csproj" framework -Target "CudaTest" DoNothing -Target "CudaTestNET50" (fun _ -> testCUDA "net5.0") -Target "CudaTestNET48" (fun _ -> testCUDA "net48") +Target.create "CudaTest" ignore +Target.create "CudaTestNET50" (fun _ -> testCUDA "net5.0") +Target.create "CudaTestNET48" (fun _ -> testCUDA "net48") "CudaWinBuild" ==> "CudaTestNET50" ==> "CudaTest" -"CudaWinBuild" =?> ("CudaTestNET48", isWindows) ==> "CudaTest" +"CudaWinBuild" =?> ("CudaTestNET48", Environment.isWindows) ==> "CudaTest" // -------------------------------------------------------------------------------------- // LINUX PACKAGES // -------------------------------------------------------------------------------------- -Target "MklLinuxPack" DoNothing +Target.create "MklLinuxPack" ignore -Target "MklLinuxZip" (fun _ -> - CreateDir mklSolution.OutputZipDir +Target.create "MklLinuxZip" (fun _ -> + Directory.create mklSolution.OutputZipDir zip mklLinuxZipPackage mklSolution.OutputZipDir "out/MKL/Linux" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5.so"))) "MklLinuxZip" ==> "MklLinuxPack" -Target "MklLinuxNuGet" (fun _ -> - CreateDir mklSolution.OutputNuGetDir +Target.create "MklLinuxNuGet" (fun _ -> + Directory.create mklSolution.OutputNuGetDir nugetPackManually mklSolution [ mklLinuxPack; mklLinux32Pack; mklLinux64Pack ]) "MklLinuxNuGet" ==> "MklLinuxPack" @@ -346,52 +818,49 @@ Target "MklLinuxNuGet" (fun _ -> // DOCS -Target "CleanDocs" (fun _ -> CleanDirs ["out/docs"]) +Target.create "CleanDocs" (fun _ -> Shell.cleanDirs ["out/docs"]) let extraDocs = [ "LICENSE.md", "License.md" "CONTRIBUTING.md", "Contributing.md" "CONTRIBUTORS.md", "Contributors.md" ] -Target "Docs" (fun _ -> +Target.create "Docs" (fun _ -> + provideDocExtraFiles extraDocs releases + dotnet rootDir "fsdocs build --noapidocs --output out/docs") +Target.create "DocsDev" (fun _ -> provideDocExtraFiles extraDocs releases - generateDocs true false) -Target "DocsDev" (fun _ -> - provideDocExtraFiles extraDocs releases - generateDocs true true) -Target "DocsWatch" (fun _ -> - provideDocExtraFiles extraDocs releases - use watcher = new FileSystemWatcher(DirectoryInfo("docs/content").FullName, "*.*") - watcher.EnableRaisingEvents <- true - watcher.Changed.Add(fun e -> generateDocs false true) - watcher.Created.Add(fun e -> generateDocs false true) - watcher.Renamed.Add(fun e -> generateDocs false true) - watcher.Deleted.Add(fun e -> generateDocs false true) - traceImportant "Waiting for docs edits. Press any key to stop." - System.Console.ReadKey() |> ignore - watcher.EnableRaisingEvents <- false - watcher.Dispose()) + dotnet rootDir "fsdocs build --noapidocs --output out/docs") +Target.create "DocsWatch" (fun _ -> + provideDocExtraFiles extraDocs releases + dotnet rootDir "fsdocs build --noapidocs --output out/docs" + dotnet rootDir "fsdocs watch --noapidocs --output out/docs") "Build" ==> "CleanDocs" ==> "Docs" "Start" - =?> ("CleanDocs", not (hasBuildParam "incremental")) + =?> ("CleanDocs", not isIncremental) ==> "DocsDev" ==> "DocsWatch" // API REFERENCE -Target "CleanApi" (fun _ -> CleanDirs ["out/api"]) - -Target "Api" (fun _ -> - !! "src/Numerics/bin/Release/net461/MathNet.Numerics.dll" - |> Docu (fun p -> - { p with - ToolPath = "tools/docu/docu.exe" - TemplatesPath = "tools/docu/templates/" - TimeOut = TimeSpan.FromMinutes 10. - OutputPath = "out/api/" })) +Target.create "CleanApi" (fun _ -> Shell.cleanDirs ["out/api"]) + +Target.create "Api" (fun _ -> + let result = + CreateProcess.fromRawCommandLine + "tools/docu/docu.exe" + ([ + rootDir "src/Numerics/bin/Release/net461/MathNet.Numerics.dll" |> Path.getFullName + "--output=" + (rootDir "out/api/" |> Path.getFullName) + "--templates=" + (rootDir "tools/docu/templates/" |> Path.getFullName) + ] |> String.concat " ") + |> CreateProcess.withWorkingDirectory rootDir + |> CreateProcess.withTimeout (TimeSpan.FromMinutes 10.) + |> Proc.run + if result.ExitCode <> 0 then failwith "Error during API reference generation." ) "Build" ==> "CleanApi" ==> "Api" @@ -401,51 +870,51 @@ Target "Api" (fun _ -> // Requires permissions; intended only for maintainers // -------------------------------------------------------------------------------------- -Target "PublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics" "" numericsRelease) -Target "MklPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics MKL Provider" "mkl-" mklRelease) -Target "CudaPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics CUDA Provider" "cuda-" cudaRelease) -Target "OpenBlasPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics OpenBLAS Provider" "openblas-" openBlasRelease) +Target.create "PublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics" "" numericsRelease) +Target.create "MklPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics MKL Provider" "mkl-" mklRelease) +Target.create "CudaPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics CUDA Provider" "cuda-" cudaRelease) +Target.create "OpenBlasPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics OpenBLAS Provider" "openblas-" openBlasRelease) -Target "PublishDocs" (fun _ -> publishDocs numericsRelease) -Target "PublishApi" (fun _ -> publishApi numericsRelease) +Target.create "PublishDocs" (fun _ -> publishDocs numericsRelease) +Target.create "PublishApi" (fun _ -> publishApi numericsRelease) -Target "PublishArchive" (fun _ -> publishArchives [numericsSolution]) -Target "MklPublishArchive" (fun _ -> publishArchives [mklSolution]) -Target "CudaPublishArchive" (fun _ -> publishArchives [cudaSolution]) -Target "OpenBlasPublishArchive" (fun _ -> publishArchives [openBlasSolution]) +Target.create "PublishArchive" (fun _ -> publishArchives [numericsSolution]) +Target.create "MklPublishArchive" (fun _ -> publishArchives [mklSolution]) +Target.create "CudaPublishArchive" (fun _ -> publishArchives [cudaSolution]) +Target.create "OpenBlasPublishArchive" (fun _ -> publishArchives [openBlasSolution]) -Target "PublishNuGet" (fun _ -> publishNuGet [numericsSolution]) -Target "MklPublishNuGet" (fun _ -> publishNuGet [mklSolution]) -Target "CudaPublishNuGet" (fun _ -> publishNuGet [cudaSolution]) -Target "OpenBlasPublishNuGet" (fun _ -> publishNuGet [openBlasSolution]) +Target.create "PublishNuGet" (fun _ -> publishNuGet [numericsSolution]) +Target.create "MklPublishNuGet" (fun _ -> publishNuGet [mklSolution]) +Target.create "CudaPublishNuGet" (fun _ -> publishNuGet [cudaSolution]) +Target.create "OpenBlasPublishNuGet" (fun _ -> publishNuGet [openBlasSolution]) -Target "Publish" DoNothing -Dependencies "Publish" [ "PublishTag"; "PublishDocs"; "PublishApi"; "PublishArchive"; "PublishNuGet" ] +Target.create "Publish" ignore +"Publish" <== [ "PublishTag"; "PublishDocs"; "PublishApi"; "PublishArchive"; "PublishNuGet" ] -Target "MklPublish" DoNothing -Dependencies "MklPublish" [ "MklPublishTag"; "PublishDocs"; "MklPublishArchive"; "MklPublishNuGet" ] +Target.create "MklPublish" ignore +"MklPublish" <== [ "MklPublishTag"; "PublishDocs"; "MklPublishArchive"; "MklPublishNuGet" ] -Target "CudaPublish" DoNothing -Dependencies "CudaPublish" [ "CudaPublishTag"; "PublishDocs"; "CudaPublishArchive"; "CudaPublishNuGet" ] +Target.create "CudaPublish" ignore +"CudaPublish" <== [ "CudaPublishTag"; "PublishDocs"; "CudaPublishArchive"; "CudaPublishNuGet" ] -Target "OpenBlasPublish" DoNothing -Dependencies "OpenBlasPublish" [ "OpenBlasPublishTag"; "PublishDocs"; "OpenBlasPublishArchive"; "OpenBlasPublishNuGet" ] +Target.create "OpenBlasPublish" ignore +"OpenBlasPublish" <== [ "OpenBlasPublishTag"; "PublishDocs"; "OpenBlasPublishArchive"; "OpenBlasPublishNuGet" ] // -------------------------------------------------------------------------------------- // Default Targets // -------------------------------------------------------------------------------------- -Target "All" DoNothing -Dependencies "All" [ "Build"; "Docs"; "Api"; "Test" ] +Target.create "All" ignore +"All" <== [ "Build"; "Docs"; "Api"; "Test" ] -Target "MklWinAll" DoNothing -Dependencies "MklWinAll" [ "MklWinBuild"; "MklTest" ] +Target.create "MklWinAll" ignore +"MklWinAll" <== [ "MklWinBuild"; "MklTest" ] -Target "CudaWinAll" DoNothing -Dependencies "CudaWinAll" [ "CudaWinBuild"; "CudaTest" ] +Target.create "CudaWinAll" ignore +"CudaWinAll" <== [ "CudaWinBuild"; "CudaTest" ] -Target "OpenBlasWinAll" DoNothing -Dependencies "OpenBlasWinAll" [ "OpenBlasWinBuild"; "OpenBlasTest" ] +Target.create "OpenBlasWinAll" ignore +"OpenBlasWinAll" <== [ "OpenBlasWinBuild"; "OpenBlasTest" ] -RunTargetOrDefault "Test" +Target.runOrDefaultWithArguments "Test" diff --git a/build.sh b/build.sh index f1309f92..7f49b94e 100755 --- a/build.sh +++ b/build.sh @@ -7,33 +7,4 @@ cd "$(dirname "$0")" dotnet tool restore dotnet paket restore - -FAKE_EXE=packages/build/FAKE/tools/FAKE.exe - -FSIARGS="" -FSIARGS2="" -OS=${OS:-"unknown"} -if [[ "$OS" != "Windows_NT" ]] -then - FSIARGS="--fsiargs" - FSIARGS2="-d:MONO" - - # Allows NETFramework like net45 to be built using dotnet core tooling with mono - export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ -fi - -function run() { - if [[ "$OS" != "Windows_NT" ]] - then - mono "$@" - else - "$@" - fi -} - -if [[ "$OS" != "Windows_NT" ]] && [ ! -e ~/.config/.mono/certs ] -then - mozroots --import --sync --quiet -fi - -run $FAKE_EXE "$@" $FSIARGS $FSIARGS2 build.fsx +dotnet fake run build.fsx -t "$@" diff --git a/src/MathNet.Numerics.snk b/build/MathNet.Numerics.snk similarity index 100% rename from src/MathNet.Numerics.snk rename to build/MathNet.Numerics.snk diff --git a/build/build-framework.fsx b/build/build-framework.fsx deleted file mode 100644 index bfe43d90..00000000 --- a/build/build-framework.fsx +++ /dev/null @@ -1,536 +0,0 @@ -// __ __ _ _ _ _ ______ _______ -// | \/ | | | | | | \ | | ____|__ __| -// | \ / | __ _| |_| |__ | \| | |__ | | -// | |\/| |/ _` | __| '_ \ | . ` | __| | | -// | | | | (_| | |_| | | |_| |\ | |____ | | -// |_| |_|\__,_|\__|_| |_(_)_| \_|______| |_| -// -// Math.NET Numerics - https://numerics.mathdotnet.com -// Copyright (c) Math.NET - Open Source MIT/X11 License -// -// Build Framework using FAKE (http://fsharp.github.io/FAKE) -// - -module BuildFramework - -#I "../packages/build/FAKE/tools" -#r "../packages/build/FAKE/tools/FakeLib.dll" - -open FSharp.Core -open Fake -open Fake.ReleaseNotesHelper -open System -open System.IO - -let rootDir = Path.GetFullPath (Path.Combine (__SOURCE_DIRECTORY__ + "/../")) -Environment.CurrentDirectory <- rootDir -trace rootDir - - -// -------------------------------------------------------------------------------------- -// .Net SDK -// -------------------------------------------------------------------------------------- - - -let dotnet workingDir command = - let properties = - [ - ] - let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" - DotNetCli.RunCommand - (fun c -> { c with WorkingDir = workingDir}) - (command + suffix) - -let dotnetWeak workingDir command = - let properties = - [ - yield "StrongName", "False" - ] - let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" - DotNetCli.RunCommand - (fun c -> { c with WorkingDir = workingDir }) - (command + suffix) - -let dotnetStrong workingDir command = - let properties = - [ - yield "StrongName", "True" - ] - let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" - DotNetCli.RunCommand - (fun c -> { c with WorkingDir = workingDir}) - (command + suffix) - - -// -------------------------------------------------------------------------------------- -// Header -// -------------------------------------------------------------------------------------- - -let header = ReadFile(__SOURCE_DIRECTORY__ __SOURCE_FILE__) |> Seq.take 10 |> Seq.map (fun s -> s.Substring(2)) |> toLines - -type Release = - { RepoKey: string - Title: string - AssemblyVersion: string - PackageVersion: string - ReleaseNotes: string - ReleaseNotesFile: string } - -type ZipPackage = - { Id: string - Release: Release - Title: string } - -type NuGetPackage = - { Id: string - Release: Release } - -type VisualStudioProject = - { AssemblyName: string - ProjectFile: string - OutputDir: string - Release: Release - NuGetPackages: NuGetPackage list } - -type NativeVisualStudioProject = - { BinaryName: string - ProjectFile: string - OutputDir: string - Release: Release - NuGetPackages: NuGetPackage list } - -type NativeBashScriptProject = - { BinaryName: string - BashScriptFile: string - OutputDir: string - Release: Release - NuGetPackages: NuGetPackage list } - -type Project = - | VisualStudio of VisualStudioProject - | NativeVisualStudio of NativeVisualStudioProject - | NativeBashScript of NativeBashScriptProject - -type Solution = - { Key: string - SolutionFile: string - Projects: Project list - Release: Release - ZipPackages: ZipPackage list - OutputDir: string - OutputLibDir: string - OutputLibStrongNameDir: string - OutputZipDir: string - OutputNuGetDir: string } - -type NuGetSpecification = - { NuGet: NuGetPackage - NuSpecFile: string - Title: string } - - -let release repoKey title releaseNotesFile : Release = - let info = LoadReleaseNotes releaseNotesFile - let buildPart = "0" - let assemblyVersion = info.AssemblyVersion + "." + buildPart - let packageVersion = info.NugetVersion - let notes = info.Notes |> List.map (fun l -> l.Replace("*","").Replace("`","")) |> toLines - { Release.RepoKey = repoKey - Title = title - AssemblyVersion = assemblyVersion - PackageVersion = packageVersion - ReleaseNotes = notes - ReleaseNotesFile = releaseNotesFile } - -let zipPackage packageId title release = - { ZipPackage.Id = packageId - Title = title - Release = release } - -let nugetPackage packageId release = - { NuGetPackage.Id = packageId - Release = release } - -let project assemblyName projectFile nuGetPackages = - { VisualStudioProject.AssemblyName = assemblyName - ProjectFile = projectFile - OutputDir = (Path.GetDirectoryName projectFile) "bin" "Release" - NuGetPackages = nuGetPackages - Release = nuGetPackages |> List.map (fun p -> p.Release) |> List.distinct |> List.exactlyOne } - |> Project.VisualStudio - -let nativeProject binaryName projectFile nuGetPackages = - { NativeVisualStudioProject.BinaryName = binaryName - ProjectFile = projectFile - OutputDir = (Path.GetDirectoryName projectFile) "bin" "Release" - NuGetPackages = nuGetPackages - Release = nuGetPackages |> List.map (fun p -> p.Release) |> List.distinct |> List.exactlyOne } - |> Project.NativeVisualStudio - -let nativeBashScriptProject binaryName bashScriptFile nuGetPackages = - { NativeBashScriptProject.BinaryName = binaryName - BashScriptFile = bashScriptFile - OutputDir = (Path.GetDirectoryName bashScriptFile) "bin" "Release" - NuGetPackages = nuGetPackages - Release = nuGetPackages |> List.map (fun p -> p.Release) |> List.distinct |> List.exactlyOne } - |> Project.NativeBashScript - - -let projectOutputDir = function - | VisualStudio p -> p.OutputDir - | NativeVisualStudio p -> p.OutputDir - | NativeBashScript p -> p.OutputDir - -let projectRelease = function - | VisualStudio p -> p.Release - | NativeVisualStudio p -> p.Release - | NativeBashScript p -> p.Release - -let projectNuGetPackages = function - | VisualStudio p -> p.NuGetPackages - | NativeVisualStudio p -> p.NuGetPackages - | NativeBashScript p -> p.NuGetPackages - -let solution key solutionFile projects zipPackages = - { Solution.Key = key - SolutionFile = solutionFile - Projects = projects - ZipPackages = zipPackages - Release = List.concat [ projects |> List.map projectRelease; zipPackages |> List.map (fun p -> p.Release) ] |> List.distinct |> List.exactlyOne - OutputDir = "out" key - OutputLibDir = "out" key "Lib" - OutputLibStrongNameDir = "out" key "Lib-StrongName" - OutputZipDir = "out" key "Zip" - OutputNuGetDir = "out" key "NuGet" } - -let traceHeader (releases:Release list) = - trace header - let titleLength = releases |> List.map (fun r -> r.Title.Length) |> List.max - for release in releases do - trace ([ " "; release.Title.PadRight titleLength; " v"; release.PackageVersion ] |> String.concat "") - trace "" - dotnet rootDir "--info" - trace "" - - -// -------------------------------------------------------------------------------------- -// PREPARE -// -------------------------------------------------------------------------------------- - -let patchVersionInAssemblyInfo path (release:Release) = - BulkReplaceAssemblyInfoVersions path (fun f -> - { f with - AssemblyVersion = release.AssemblyVersion - AssemblyFileVersion = release.AssemblyVersion - AssemblyInformationalVersion = release.PackageVersion }) - -let private regexes_sl = new System.Collections.Generic.Dictionary() -let private getRegexSingleLine pattern = - match regexes_sl.TryGetValue pattern with - | true, regex -> regex - | _ -> (new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.Singleline)) -let regex_replace_singleline pattern (replacement : string) text = (getRegexSingleLine pattern).Replace(text, replacement) - -let patchVersionInResource path (release:Release) = - ReplaceInFile - (regex_replace @"\d+\.\d+\.\d+\.\d+" release.AssemblyVersion - >> regex_replace @"\d+,\d+,\d+,\d+" (replace "." "," release.AssemblyVersion)) - path - -let patchVersionInProjectFile (project:Project) = - match project with - | VisualStudio p -> - let semverSplit = p.Release.PackageVersion.IndexOf('-') - let prefix = if semverSplit <= 0 then p.Release.PackageVersion else p.Release.PackageVersion.Substring(0, semverSplit) - let suffix = if semverSplit <= 0 then "" else p.Release.PackageVersion.Substring(semverSplit+1) - ReplaceInFile - (regex_replace """\.*\""" (sprintf """%s""" p.Release.PackageVersion) - >> regex_replace """\.*\""" (sprintf """%s""" p.Release.PackageVersion) - >> regex_replace """\.*\""" (sprintf """%s""" p.Release.AssemblyVersion) - >> regex_replace """\.*\""" (sprintf """%s""" p.Release.AssemblyVersion) - >> regex_replace """\.*\""" (sprintf """%s""" prefix) - >> regex_replace """\.*\""" (sprintf """%s""" suffix) - >> regex_replace_singleline """\.*\""" (sprintf """%s""" (p.Release.ReleaseNotes.Replace("<","<").Replace(">",">")))) - p.ProjectFile - | NativeVisualStudio _ -> () - | NativeBashScript _ -> () - - -// -------------------------------------------------------------------------------------- -// BUILD -// -------------------------------------------------------------------------------------- - -let clean (solution:Solution) = dotnet rootDir (sprintf "clean %s --configuration Release --verbosity minimal" solution.SolutionFile) - -let restoreWeak (solution:Solution) = dotnetWeak rootDir (sprintf "restore %s --verbosity minimal" solution.SolutionFile) -let restoreStrong (solution:Solution) = dotnetStrong rootDir (sprintf "restore %s --verbosity minimal" solution.SolutionFile) - -let buildWeak (solution:Solution) = dotnetWeak rootDir (sprintf "build %s --configuration Release --no-incremental --no-restore --verbosity minimal" solution.SolutionFile) -let buildStrong (solution:Solution) = dotnetStrong rootDir (sprintf "build %s --configuration Release --no-incremental --no-restore --verbosity minimal" solution.SolutionFile) - -let packWeak (solution:Solution) = dotnetWeak rootDir (sprintf "pack %s --configuration Release --no-restore --verbosity minimal" solution.SolutionFile) -let packStrong (solution:Solution) = dotnetStrong rootDir (sprintf "pack %s --configuration Release --no-restore --verbosity minimal" solution.SolutionFile) - -let packProjectWeak = function - | VisualStudio p -> dotnetWeak rootDir (sprintf "pack %s --configuration Release --no-restore --no-build" p.ProjectFile) - | _ -> failwith "Project type not supported" -let packProjectStrong = function - | VisualStudio p -> dotnetStrong rootDir (sprintf "pack %s --configuration Release --no-restore --no-build" p.ProjectFile) - | _ -> failwith "Project type not supported" - -//let buildConfig config subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [ "Configuration", config ] subject |> ignore -//let build subject = buildConfig "Release" subject -//let buildSigned subject = buildConfig "Release-Signed" subject -let buildConfig32 config subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [("Configuration", config); ("Platform","Win32")] subject |> ignore -let buildConfig64 config subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [("Configuration", config); ("Platform","x64")] subject |> ignore - - -// -------------------------------------------------------------------------------------- -// COLLECT -// -------------------------------------------------------------------------------------- - -let collectBinaries (solution:Solution) = - solution.Projects |> List.iter (function - | VisualStudio project -> CopyDir solution.OutputLibDir project.OutputDir (fun n -> n.Contains(project.AssemblyName + ".dll") || n.Contains(project.AssemblyName + ".pdb") || n.Contains(project.AssemblyName + ".xml")) - | _ -> failwith "Project type not supported") - -let collectBinariesSN (solution:Solution) = - solution.Projects |> List.iter (function - | VisualStudio project -> CopyDir solution.OutputLibStrongNameDir project.OutputDir (fun n -> n.Contains(project.AssemblyName + ".dll") || n.Contains(project.AssemblyName + ".pdb") || n.Contains(project.AssemblyName + ".xml")) - | _ -> failwith "Project type not supported") - -let collectNuGetPackages (solution:Solution) = - solution.Projects |> List.iter (function - | VisualStudio project -> CopyDir solution.OutputNuGetDir project.OutputDir (fun n -> n.EndsWith(".nupkg")) - | _ -> failwith "Project type not supported") - - -// -------------------------------------------------------------------------------------- -// TEST -// -------------------------------------------------------------------------------------- - -let test testsDir testsProj framework = - dotnet testsDir (sprintf "run -p %s --configuration Release --framework %s --no-restore --no-build" testsProj framework) - - -// -------------------------------------------------------------------------------------- -// PACKAGES -// -------------------------------------------------------------------------------------- - -let provideLicense path = - ReadFileAsString "LICENSE.md" - |> ConvertTextToWindowsLineBreaks - |> ReplaceFile (path "license.txt") - -let provideReadme title (release:Release) path = - String.concat Environment.NewLine [header; " " + title; ""; ReadFileAsString release.ReleaseNotesFile] - |> ConvertTextToWindowsLineBreaks - |> ReplaceFile (path "readme.txt") - - -// SIGN - -let sign fingerprint timeserver (solution: Solution) = - let files = solution.Projects |> Seq.collect (function - | VisualStudio project -> !! (project.OutputDir + "/**/" + project.AssemblyName + ".dll") - | _ -> failwith "Project type not supported") - let fileArgs = files |> Seq.map (sprintf "\"%s\"") |> String.concat " " - let optionsArgs = sprintf """/v /fd sha256 /sha1 "%s" /tr "%s" /td sha256""" fingerprint timeserver - let arguments = sprintf """sign %s %s""" optionsArgs fileArgs - let result = - ExecProcess (fun info -> - info.FileName <- findToolInSubPath "signtool.exe" """C:\Program Files (x86)\Windows Kits\10\bin\x64""" - info.Arguments <- arguments) TimeSpan.MaxValue - if result <> 0 then - failwithf "Error during SignTool call " - -let signNuGet fingerprint timeserver (solutions: Solution list) = - CleanDir "obj/NuGet" - solutions - |> Seq.collect (fun solution -> !! (solution.OutputNuGetDir "*.nupkg")) - |> Seq.distinct - |> Seq.iter (fun file -> - let args = sprintf """sign "%s" -HashAlgorithm SHA256 -TimestampHashAlgorithm SHA256 -CertificateFingerprint "%s" -Timestamper "%s""" (FullName file) fingerprint timeserver - let result = - ExecProcess (fun info -> - info.FileName <- "packages/build/NuGet.CommandLine/tools/NuGet.exe" - info.WorkingDirectory <- FullName "obj/NuGet" - info.Arguments <- args) (TimeSpan.FromMinutes 10.) - if result <> 0 then failwith "Error during NuGet sign.") - DeleteDir "obj/NuGet" - - -// ZIP - -let zip (package:ZipPackage) zipDir filesDir filesFilter = - CleanDir "obj/Zip" - let workPath = "obj/Zip/" + package.Id - CopyDir workPath filesDir filesFilter - provideLicense workPath - provideReadme (sprintf "%s v%s" package.Title package.Release.PackageVersion) package.Release workPath - Zip "obj/Zip/" (zipDir sprintf "%s-%s.zip" package.Id package.Release.PackageVersion) !! (workPath + "/**/*.*") - DeleteDir "obj/Zip" - - -// NUGET - -let updateNuspec (nuget:NuGetPackage) outPath spec = - { spec with ToolPath = "packages/build/NuGet.CommandLine/tools/NuGet.exe" - OutputPath = outPath - WorkingDir = "obj/NuGet" - Version = nuget.Release.PackageVersion - ReleaseNotes = nuget.Release.ReleaseNotes - Publish = false } - -let nugetPackManually (solution:Solution) (packages:NuGetSpecification list) = - CleanDir "obj/NuGet" - for pack in packages do - provideLicense "obj/NuGet" - provideReadme (sprintf "%s v%s" pack.Title pack.NuGet.Release.PackageVersion) pack.NuGet.Release "obj/NuGet" - NuGet (updateNuspec pack.NuGet solution.OutputNuGetDir) pack.NuSpecFile - CleanDir "obj/NuGet" - DeleteDir "obj/NuGet" - - -// -------------------------------------------------------------------------------------- -// Documentation -// -------------------------------------------------------------------------------------- - -let provideDocExtraFiles extraDocs (releases:Release list) = - for (fileName, docName) in extraDocs do CopyFile ("docs/content" docName) fileName - 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 - [ "# " + release.Title + " Release Notes" - menu - "" - ReadFileAsString release.ReleaseNotesFile ] - |> ReplaceFile ("docs/content" (release.ReleaseNotesFile |> replace "RELEASENOTES" "ReleaseNotes")) - -let buildDocumentationTarget fsiargs target = - trace (sprintf "Building documentation (%s), this could take some time, please wait..." target) - let fakePath = "packages" "build" "FAKE" "tools" "FAKE.exe" - let fakeStartInfo script workingDirectory args fsiargs environmentVars = - (fun (info: System.Diagnostics.ProcessStartInfo) -> - info.FileName <- System.IO.Path.GetFullPath fakePath - info.Arguments <- sprintf "%s --fsiargs -d:FAKE %s \"%s\"" args fsiargs script - info.WorkingDirectory <- workingDirectory - let setVar k v = - info.EnvironmentVariables.[k] <- v - for (k, v) in environmentVars do - setVar k v - setVar "MSBuild" msBuildExe - setVar "GIT" Git.CommandHelper.gitPath - setVar "FSI" fsiPath) - let executeFAKEWithOutput workingDirectory script fsiargs envArgs = - let exitCode = - ExecProcessWithLambdas - (fakeStartInfo script workingDirectory "" fsiargs envArgs) - TimeSpan.MaxValue false ignore ignore - System.Threading.Thread.Sleep 1000 - exitCode - let exit = executeFAKEWithOutput "docs/tools" "build-docs.fsx" fsiargs ["target", target] - if exit <> 0 then - failwith "Generating documentation failed" - () - -let generateDocs fail local = - let args = if local then "" else "--define:RELEASE" - try - buildDocumentationTarget args "Default" - traceImportant "Documentation generated" - with - | e when not fail -> - failwith "Generating documentation failed" - - -// -------------------------------------------------------------------------------------- -// Publishing -// Requires permissions; intended only for maintainers -// -------------------------------------------------------------------------------------- - -let publishReleaseTag title prefix (release:Release) = - // inspired by Deedle/tpetricek - let tagName = prefix + "v" + release.PackageVersion - let tagMessage = String.concat Environment.NewLine [title + " v" + release.PackageVersion; ""; release.ReleaseNotes ] - let cmd = sprintf """tag -a %s -m "%s" """ tagName tagMessage - Git.CommandHelper.runSimpleGitCommand "." cmd |> printfn "%s" - let _, remotes, _ = Git.CommandHelper.runGitCommand "." "remote -v" - let main = remotes |> Seq.find (fun s -> s.Contains("(push)") && s.Contains("mathnet/mathnet-" + release.RepoKey)) - let remoteName = main.Split('\t').[0] - Git.Branches.pushTag "." remoteName tagName - -let publishNuGet (solutions: Solution list) = - CleanDir "obj/NuGet" - let rec impl trials (file:string) = - trace ("NuGet Push: " + System.IO.Path.GetFileName(file) + ".") - try - let args = sprintf """push "%s" -Source https://api.nuget.org/v3/index.json -T 900""" (FullName file) - let result = - ExecProcess (fun info -> - info.FileName <- "packages/build/NuGet.CommandLine/tools/NuGet.exe" - info.WorkingDirectory <- FullName "obj/NuGet" - info.Arguments <- args) (TimeSpan.FromMinutes 10.) - if result <> 0 then failwith "Error during NuGet push." - with exn -> - if trials > 0 then impl (trials-1) file - else () - solutions - |> Seq.collect (fun solution -> !! (solution.OutputNuGetDir "*.nupkg")) - |> Seq.distinct - |> Seq.iter (impl 3) - DeleteDir "obj/NuGet" - -let publishDocs (release:Release) = - let repo = "../web-mathnet-" + release.RepoKey - Git.Branches.pull repo "origin" "gh-pages" - CopyRecursive "out/docs" repo true |> printfn "%A" - Git.Staging.StageAll repo - Git.Commit.Commit repo (sprintf "%s: %s docs update" release.Title release.PackageVersion) - Git.Branches.pushBranch repo "origin" "gh-pages" - -let publishApi (release:Release) = - let repo = "../web-mathnet-" + release.RepoKey - Git.Branches.pull repo "origin" "gh-pages" - CleanDir (repo + "/api") - CopyRecursive "out/api" (repo + "/api") true |> printfn "%A" - Git.Staging.StageAll repo - Git.Commit.Commit repo (sprintf "%s: %s api update" release.Title release.PackageVersion) - Git.Branches.pushBranch repo "origin" "gh-pages" - -let publishNuGetToArchive (package:NuGetPackage) archivePath nupkgFile = - let tempDir = Path.GetTempPath() Path.GetRandomFileName() - let archiveDir = archivePath package.Id package.Release.PackageVersion - CleanDirs [tempDir; archiveDir] - nupkgFile |> CopyFile archiveDir - use sha512 = System.Security.Cryptography.SHA512.Create() - let hash = File.ReadAllBytes nupkgFile |> sha512.ComputeHash |> Convert.ToBase64String - File.WriteAllText ((archiveDir (Path.GetFileName(nupkgFile) + ".sha512")), hash) - ZipHelper.Unzip tempDir nupkgFile - !! (tempDir "*.nuspec") |> Copy archiveDir - DeleteDir tempDir - -let publishArchiveManual title zipOutPath nugetOutPath (zipPackages:ZipPackage list) (nugetPackages:NuGetPackage list) = - let archivePath = (environVarOrFail "MathNetReleaseArchive") title - if directoryExists archivePath |> not then failwith "Release archive directory does not exists. Safety Check failed." - for zipPackage in zipPackages do - let zipFile = zipOutPath sprintf "%s-%s.zip" zipPackage.Id zipPackage.Release.PackageVersion - if FileSystemHelper.fileExists zipFile then - zipFile |> CopyFile (archivePath "Zip") - for nugetPackage in nugetPackages do - let nupkgFile = nugetOutPath sprintf "%s.%s.nupkg" nugetPackage.Id nugetPackage.Release.PackageVersion - if FileSystemHelper.fileExists nupkgFile then - trace nupkgFile - publishNuGetToArchive nugetPackage (archivePath "NuGet") nupkgFile - let symbolsFile = nugetOutPath sprintf "%s.%s.symbols.nupkg" nugetPackage.Id nugetPackage.Release.PackageVersion - if FileSystemHelper.fileExists symbolsFile then - symbolsFile |> CopyFile (archivePath "Symbols") - -let publishArchive (solution:Solution) = - let zipOutPath = solution.OutputZipDir - let nugetOutPath = solution.OutputNuGetDir - let zipPackages = solution.ZipPackages - let nugetPackages = solution.Projects |> List.collect projectNuGetPackages |> List.distinct - publishArchiveManual solution.Release.Title zipOutPath nugetOutPath zipPackages nugetPackages - -let publishArchives (solutions: Solution list) = solutions |> List.iter publishArchive diff --git a/src/icon.png b/build/icon.png similarity index 100% rename from src/icon.png rename to build/icon.png diff --git a/docs/content/Build.md b/docs/Build.md similarity index 100% rename from docs/content/Build.md rename to docs/Build.md diff --git a/docs/content/CSV.md b/docs/CSV.md similarity index 100% rename from docs/content/CSV.md rename to docs/CSV.md diff --git a/docs/content/Compatibility.md b/docs/Compatibility.md similarity index 100% rename from docs/content/Compatibility.md rename to docs/Compatibility.md diff --git a/docs/content/Constants.md b/docs/Constants.md similarity index 100% rename from docs/content/Constants.md rename to docs/Constants.md diff --git a/docs/content/DescriptiveStatistics.md b/docs/DescriptiveStatistics.md similarity index 100% rename from docs/content/DescriptiveStatistics.md rename to docs/DescriptiveStatistics.md diff --git a/docs/content/Distance.md b/docs/Distance.md similarity index 84% rename from docs/content/Distance.md rename to docs/Distance.md index 1285b39e..34d5f75d 100644 --- a/docs/content/Distance.md +++ b/docs/Distance.md @@ -17,7 +17,7 @@ Math.NET Numerics provides the following distance functions on vectors and array Sum of Absolute Difference (SAD) -------------------------------- - + The sum of absolute difference is equivalent to the $L_1$-norm of the difference, also known as Manhattan- or Taxicab-norm. The `abs` function makes this metric a bit complicated to deal with analytically, but it is more robust than SSD. @@ -32,7 +32,7 @@ d_{\mathbf{SAD}} : (x, y) \mapsto \|x-y\|_1 = \sum_{i=1}^{n} |x_i-y_i| Sum of Squared Difference (SSD) ------------------------------- - + The sum of squared difference is equivalent to the squared $L_2$-norm, also known as Euclidean norm. It is therefore also known as Squared Euclidean distance. @@ -50,7 +50,7 @@ d_{\mathbf{SSD}} : (x, y) \mapsto \|x-y\|_2^2 = \langle x-y, x-y\rangle = \sum_{ Mean-Absolute Error (MAE) ------------------------- - + The mean absolute error is a normalized version of the sum of absolute difference. @@ -64,7 +64,7 @@ d_{\mathbf{MAE}} : (x, y) \mapsto \frac{d_{\mathbf{SAD}}}{n} = \frac{\|x-y\|_1}{ Mean-Squared Error (MSE) ------------------------ - + The mean squared error is a normalized version of the sum of squared difference. @@ -78,7 +78,7 @@ d_{\mathbf{MSE}} : (x, y) \mapsto \frac{d_{\mathbf{SSD}}}{n} = \frac{\|x-y\|_2^2 Euclidean Distance ------------------ - + The euclidean distance is the $L_2$-norm of the difference, a special case of the Minkowski distance with p=2. It is the natural distance in a geometric interpretation. @@ -93,7 +93,7 @@ d_{\mathbf{2}} : (x, y) \mapsto \|x-y\|_2 = \sqrt{d_{\mathbf{SSD}}} = \sqrt{\sum Manhattan Distance ------------------ - + The Manhattan distance is the $L_1$-norm of the difference, a special case of the Minkowski distance with p=1 and equivalent to the sum of absolute difference. @@ -108,7 +108,7 @@ d_{\mathbf{1}} \equiv d_{\mathbf{SAD}} : (x, y) \mapsto \|x-y\|_1 = \sum_{i=1}^{ Chebyshev Distance ------------------ - + The Chebyshev distance is the $L_\infty$-norm of the difference, a special case of the Minkowski distance where p goes to infinity. It is also known as Chessboard distance. @@ -123,7 +123,7 @@ d_{\mathbf{\infty}} : (x, y) \mapsto \|x-y\|_\infty = \lim_{p \rightarrow \infty Minkowski Distance ------------------ - + The Minkowski distance is the generalized $L_p$-norm of the difference. The contour plot on the left demonstrates the case of p=3. @@ -138,7 +138,7 @@ d_{\mathbf{p}} : (x, y) \mapsto \|x-y\|_p = \bigg(\sum_{i=1}^{n} |x_i-y_i|^p\big Canberra Distance ----------------- - + The Canberra distance is a weighted version of the Manhattan distance, introduced and refined 1967 by Lance, Williams and Adkins. It is often used for data scattered around an origin, as it is biased for measures around the origin and very sensitive for values close to zero. @@ -153,7 +153,7 @@ d_{\mathbf{CAD}} : (x, y) \mapsto \sum_{i=1}^{n} \frac{|x_i-y_i|}{|x_i|+|y_i|} Cosine Distance --------------- - + The cosine distance contains the dot product scaled by the product of the Euclidean distances from the origin. It represents the angular distance of two vectors while ignoring their scale. @@ -168,7 +168,7 @@ d_{\mathbf{cos}} : (x, y) \mapsto 1-\frac{\langle x, y\rangle}{\|x\|_2\|y\|_2} = Pearson's Distance ------------------ - + The Pearson distance is a correlation distance based on Pearson's product-momentum correlation coefficient of the two sample vectors. Since the correlation coefficient falls between [-1, 1], the Pearson distance diff --git a/docs/files/img/DistanceCanberra.png b/docs/DistanceCanberra.png similarity index 100% rename from docs/files/img/DistanceCanberra.png rename to docs/DistanceCanberra.png diff --git a/docs/files/img/DistanceChebyshev.png b/docs/DistanceChebyshev.png similarity index 100% rename from docs/files/img/DistanceChebyshev.png rename to docs/DistanceChebyshev.png diff --git a/docs/files/img/DistanceCosine.png b/docs/DistanceCosine.png similarity index 100% rename from docs/files/img/DistanceCosine.png rename to docs/DistanceCosine.png diff --git a/docs/files/img/DistanceEuclidean.png b/docs/DistanceEuclidean.png similarity index 100% rename from docs/files/img/DistanceEuclidean.png rename to docs/DistanceEuclidean.png diff --git a/docs/files/img/DistanceMAE.png b/docs/DistanceMAE.png similarity index 100% rename from docs/files/img/DistanceMAE.png rename to docs/DistanceMAE.png diff --git a/docs/files/img/DistanceMSE.png b/docs/DistanceMSE.png similarity index 100% rename from docs/files/img/DistanceMSE.png rename to docs/DistanceMSE.png diff --git a/docs/files/img/DistanceManhattan.png b/docs/DistanceManhattan.png similarity index 100% rename from docs/files/img/DistanceManhattan.png rename to docs/DistanceManhattan.png diff --git a/docs/files/img/DistanceMinkowski3.png b/docs/DistanceMinkowski3.png similarity index 100% rename from docs/files/img/DistanceMinkowski3.png rename to docs/DistanceMinkowski3.png diff --git a/docs/files/img/DistancePearson.png b/docs/DistancePearson.png similarity index 100% rename from docs/files/img/DistancePearson.png rename to docs/DistancePearson.png diff --git a/docs/files/img/DistanceSAD.png b/docs/DistanceSAD.png similarity index 100% rename from docs/files/img/DistanceSAD.png rename to docs/DistanceSAD.png diff --git a/docs/files/img/DistanceSSD.png b/docs/DistanceSSD.png similarity index 100% rename from docs/files/img/DistanceSSD.png rename to docs/DistanceSSD.png diff --git a/docs/content/Euclid.md b/docs/Euclid.md similarity index 100% rename from docs/content/Euclid.md rename to docs/Euclid.md diff --git a/docs/content/Functions.md b/docs/Functions.md similarity index 100% rename from docs/content/Functions.md rename to docs/Functions.md diff --git a/docs/content/Generate.md b/docs/Generate.md similarity index 100% rename from docs/content/Generate.md rename to docs/Generate.md diff --git a/docs/content/IFsharpNotebook.md b/docs/IFsharpNotebook.md similarity index 100% rename from docs/content/IFsharpNotebook.md rename to docs/IFsharpNotebook.md diff --git a/docs/files/img/IfSharp-GenerateIS.png b/docs/IfSharp-GenerateIS.png similarity index 100% rename from docs/files/img/IfSharp-GenerateIS.png rename to docs/IfSharp-GenerateIS.png diff --git a/docs/files/img/IfSharp-MatrixVector.png b/docs/IfSharp-MatrixVector.png similarity index 100% rename from docs/files/img/IfSharp-MatrixVector.png rename to docs/IfSharp-MatrixVector.png diff --git a/docs/content/IntegralTransforms.md b/docs/IntegralTransforms.md similarity index 100% rename from docs/content/IntegralTransforms.md rename to docs/IntegralTransforms.md diff --git a/docs/content/Integration.md b/docs/Integration.md similarity index 100% rename from docs/content/Integration.md rename to docs/Integration.md diff --git a/docs/content/Interpolation.md b/docs/Interpolation.md similarity index 100% rename from docs/content/Interpolation.md rename to docs/Interpolation.md diff --git a/docs/content/LinearEquations.md b/docs/LinearEquations.md similarity index 100% rename from docs/content/LinearEquations.md rename to docs/LinearEquations.md diff --git a/docs/content/MKL.md b/docs/MKL.md similarity index 100% rename from docs/content/MKL.md rename to docs/MKL.md diff --git a/docs/content/MatlabFiles.md b/docs/MatlabFiles.md similarity index 100% rename from docs/content/MatlabFiles.md rename to docs/MatlabFiles.md diff --git a/docs/content/Matrix.md b/docs/Matrix.md similarity index 100% rename from docs/content/Matrix.md rename to docs/Matrix.md diff --git a/docs/content/MatrixMarket.md b/docs/MatrixMarket.md similarity index 100% rename from docs/content/MatrixMarket.md rename to docs/MatrixMarket.md diff --git a/docs/content/Packages.md b/docs/Packages.md similarity index 100% rename from docs/content/Packages.md rename to docs/Packages.md diff --git a/docs/content/Probability.md b/docs/Probability.md similarity index 100% rename from docs/content/Probability.md rename to docs/Probability.md diff --git a/docs/content/Random.md b/docs/Random.md similarity index 100% rename from docs/content/Random.md rename to docs/Random.md diff --git a/docs/content/Regression.md b/docs/Regression.md similarity index 100% rename from docs/content/Regression.md rename to docs/Regression.md diff --git a/docs/content/Users.md b/docs/Users.md similarity index 100% rename from docs/content/Users.md rename to docs/Users.md diff --git a/docs/_template.html b/docs/_template.html new file mode 100644 index 00000000..b62fd883 --- /dev/null +++ b/docs/_template.html @@ -0,0 +1,133 @@ + + + + + + {{fsdocs-page-title}} + + + + + + + + + + + + + + + + + + + + {{fsdocs-watch-script}} + + + + +
+ +
+
+ {{fsdocs-content}} + {{fsdocs-tooltips}} +
+ + + + + + + +
+ + + diff --git a/docs/content/fsdocs-custom.css b/docs/content/fsdocs-custom.css new file mode 100644 index 00000000..54358680 --- /dev/null +++ b/docs/content/fsdocs-custom.css @@ -0,0 +1,16 @@ +.navbar-nav .nav-link { + padding-top: 0.1rem; + padding-bottom: 0.1rem; +} + +#fsdocs-content li { + margin: 0px 0px 10px 0px; +} + +.masthead h3 { + margin-top: 15px; + margin-bottom: 5px; + font-size: 130%; + text-align: right; + color: #999999; +} diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 00000000..e216f691 Binary files /dev/null and b/docs/favicon.ico differ diff --git a/docs/content/index.md b/docs/index.md similarity index 100% rename from docs/content/index.md rename to docs/index.md diff --git a/docs/files/img/logo.png b/docs/logo.png similarity index 100% rename from docs/files/img/logo.png rename to docs/logo.png diff --git a/docs/tools/build-docs.fsx b/docs/tools/build-docs.fsx deleted file mode 100644 index fe6f6c37..00000000 --- a/docs/tools/build-docs.fsx +++ /dev/null @@ -1,95 +0,0 @@ -// -------------------------------------------------------------------------------------- -// Builds the documentation from `.fsx` and `.md` files in the 'docs/content' directory -// (the generated documentation is stored in the 'docs/output' directory) -// -------------------------------------------------------------------------------------- - -// Binaries that have XML documentation (in a corresponding generated XML file) -let referenceBinaries = [ "MathNet.Numerics.dll"; "MathNet.Numerics.FSharp.dll" ] -// Web site location for the generated documentation -let website = "https://numerics.mathdotnet.com" -let githubLink = "https://github.com/mathnet/mathnet-numerics" - -// Specify more information about your project -let info = - [ "project-name", "Math.NET Numerics" - "project-author", "Christoph Ruegg, Marcus Cuda, Jurgen Van Gael" - "project-summary", "Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS." - "project-github", githubLink - "project-nuget", "https://nuget.org/packages/MathNet.Numerics" ] - -// -------------------------------------------------------------------------------------- -// For typical project, no changes are needed below -// -------------------------------------------------------------------------------------- - -#load "../../packages/build/FSharp.Formatting/FSharp.Formatting.fsx" -#r "../../packages/build/FAKE/tools/NuGet.Core.dll" -#r "../../packages/build/FAKE/tools/FakeLib.dll" - -open Fake -open System -open System.IO -open Fake.FileHelper -open FSharp.Literate -open FSharp.MetadataFormat - -// When called from 'build.fsx', use the public project URL as -// otherwise, use the current 'output' directory. -#if RELEASE -let root = website -#else -let root = "file://" + (__SOURCE_DIRECTORY__ @@ "../../out/docs") -#endif - -// Paths with template/source/output locations -let top = __SOURCE_DIRECTORY__ @@ "../../" -let bin = __SOURCE_DIRECTORY__ @@ "../../out/lib/Net40" -let content = __SOURCE_DIRECTORY__ @@ "../content" -let output = __SOURCE_DIRECTORY__ @@ "../../out/docs" -let files = __SOURCE_DIRECTORY__ @@ "../files" -let templates = __SOURCE_DIRECTORY__ @@ "templates" -let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/build/FSharp.Formatting/" -let docTemplate = formatting @@ "templates/docpage.cshtml" - -// Where to look for *.csproj templates (in this order) -let layoutRoots = - [ templates - formatting @@ "templates" - formatting @@ "templates/reference" ] - -// Copy static files and CSS + JS from F# Formatting -let copyFiles() = - CopyRecursive files output true |> Log "Copying file: " - ensureDirectory (output @@ "content") - CopyRecursive (formatting @@ "styles") (output @@ "content") true - |> Log "Copying styles and scripts: " - -// Build API reference from XML comments -let buildReference () = - CleanDir (output @@ "reference") - let binaries = - referenceBinaries - |> List.map (fun lib-> bin @@ lib) - MetadataFormat.Generate - ( binaries, output @@ "reference", layoutRoots, - parameters = ("root", root)::info, - sourceRepo = githubLink @@ "tree/master", - sourceFolder = __SOURCE_DIRECTORY__ @@ ".." @@ "..", - publicOnly = true, libDirs = [bin] ) - - -// Build documentation from `fsx` and `md` files in `docs/content` -let buildDocumentation() = - let subdirs = Directory.EnumerateDirectories(content, "*", SearchOption.AllDirectories) - for dir in Seq.append [content] subdirs do - let sub = if dir.Length > content.Length then dir.Substring(content.Length + 1) else "." - Literate.ProcessDirectory - ( dir, docTemplate, output @@ sub, replacements = ("root", root)::info, - layoutRoots = layoutRoots, - references = false, - lineNumbers = true, - generateAnchors = true ) - - -// Generate -copyFiles() -buildDocumentation() diff --git a/docs/tools/paket.references b/docs/tools/paket.references deleted file mode 100644 index a5be1eb2..00000000 --- a/docs/tools/paket.references +++ /dev/null @@ -1,5 +0,0 @@ -group Build - FSharp.Formatting - Microsoft.AspNet.Razor - RazorEngine - FSharp.Compiler.Service diff --git a/docs/tools/templates/template.cshtml b/docs/tools/templates/template.cshtml deleted file mode 100644 index c1109d76..00000000 --- a/docs/tools/templates/template.cshtml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - @Title - - - - - - - - - - - - - - - - - - -
-
- -

Math.NET Numerics

-
-
-
-
- @RenderBody() -
-
- -
-
-
- - diff --git a/paket.dependencies b/paket.dependencies index 30abe47f..6ffaf0ce 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -6,7 +6,4 @@ framework: net5.0,net48,net461,netstandard2.0 group Build source https://api.nuget.org/v3/index.json storage: packages - nuget FAKE ~> 4.1 - nuget NUnit.ConsoleRunner - nuget FSharp.Formatting !~> 2.4 nuget NuGet.CommandLine diff --git a/paket.lock b/paket.lock index 345715b7..96d10819 100644 --- a/paket.lock +++ b/paket.lock @@ -5,12 +5,4 @@ GROUP Build STORAGE: PACKAGES NUGET remote: https://api.nuget.org/v3/index.json - FAKE (4.64.18) - FSharp.Compiler.Service (2.0.0.6) - FSharp.Formatting (2.14.4) - FSharp.Compiler.Service (2.0.0.6) - FSharpVSPowerTools.Core (>= 2.3 < 2.4) - FSharpVSPowerTools.Core (2.3) - FSharp.Compiler.Service (>= 2.0.0.3) NuGet.CommandLine (5.9.1) - NUnit.ConsoleRunner (3.12) diff --git a/src/Benchmark/Benchmark.csproj b/src/Benchmark/Benchmark.csproj index ba6e18c0..a61898bf 100644 --- a/src/Benchmark/Benchmark.csproj +++ b/src/Benchmark/Benchmark.csproj @@ -3,10 +3,11 @@ Exe net5.0;net48 - false Benchmark Benchmark false + 5.0.0 + alpha02 true diff --git a/src/Data.Matlab/Data.Matlab.csproj b/src/Data.Matlab/Data.Matlab.csproj index 6b25af0d..ce54df55 100644 --- a/src/Data.Matlab/Data.Matlab.csproj +++ b/src/Data.Matlab/Data.Matlab.csproj @@ -37,7 +37,6 @@ Control.Describe now includes CPU architecture and family identifier if knowgit en false - true false true true diff --git a/src/Data.Tests/Data.Tests.csproj b/src/Data.Tests/Data.Tests.csproj index 114b5bbc..483c4c7b 100644 --- a/src/Data.Tests/Data.Tests.csproj +++ b/src/Data.Tests/Data.Tests.csproj @@ -4,10 +4,11 @@ Exe false net5.0;net48 - false MathNet.Numerics.Data.Tests MathNet.Numerics.Data.Tests false + 5.0.0 + alpha02 true diff --git a/src/Data.Tests/Properties/AssemblyInfo.cs b/src/Data.Tests/Properties/AssemblyInfo.cs index 5a3b4dad..b8d68c67 100644 --- a/src/Data.Tests/Properties/AssemblyInfo.cs +++ b/src/Data.Tests/Properties/AssemblyInfo.cs @@ -1,19 +1,4 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("NUnitTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NUnitTests")] -[assembly: AssemblyCopyright("Copyright (c) Math.NET Project")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - +using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: Guid("bb41bee6-eb4c-48c9-8edd-7a5ae2422567")] - -[assembly: AssemblyVersion("5.0.0.0")] -[assembly: AssemblyFileVersion("5.0.0.0")] -[assembly: AssemblyInformationalVersion("5.0.0-alpha02")] diff --git a/src/Data.Text/Data.Text.csproj b/src/Data.Text/Data.Text.csproj index fac506eb..895e5cd7 100644 --- a/src/Data.Text/Data.Text.csproj +++ b/src/Data.Text/Data.Text.csproj @@ -37,7 +37,6 @@ Control.Describe now includes CPU architecture and family identifier if knowgit en false - true false true true diff --git a/src/FSharp.Tests/AssemblyInfo.fs b/src/FSharp.Tests/AssemblyInfo.fs index d166a525..d1436ff6 100644 --- a/src/FSharp.Tests/AssemblyInfo.fs +++ b/src/FSharp.Tests/AssemblyInfo.fs @@ -1,19 +1,7 @@ namespace MathNet.Numerics -open System.Reflection -open System.Resources; -open System.Runtime.CompilerServices open System.Runtime.InteropServices -[] -[] -[] -[] - -[] -[] -[] - [] [] diff --git a/src/FSharp.Tests/FSharp.Tests.fsproj b/src/FSharp.Tests/FSharp.Tests.fsproj index 824cbf25..248ee8ed 100644 --- a/src/FSharp.Tests/FSharp.Tests.fsproj +++ b/src/FSharp.Tests/FSharp.Tests.fsproj @@ -4,10 +4,11 @@ Exe false net5.0;net48 - false MathNet.Numerics.FSharp.Tests MathNet.Numerics.Tests false + 5.0.0 + alpha02 44;2003 true diff --git a/src/FSharp/AssemblyInfo.fs b/src/FSharp/AssemblyInfo.fs index 2b87ca5d..2524d8fd 100644 --- a/src/FSharp/AssemblyInfo.fs +++ b/src/FSharp/AssemblyInfo.fs @@ -29,25 +29,8 @@ namespace MathNet.Numerics -open System.Reflection -open System.Resources; -open System.Runtime.CompilerServices open System.Runtime.InteropServices -[] -[] -[] -[] -[] -[] -[] -[] -[] - -[] -[] -[] - [] [] diff --git a/src/FSharp/FSharp.fsproj b/src/FSharp/FSharp.fsproj index f676c65c..4dec8cf3 100644 --- a/src/FSharp/FSharp.fsproj +++ b/src/FSharp/FSharp.fsproj @@ -32,7 +32,6 @@ Lots of internal cleanup, leveraging newer language features Data: now released always together with Numerics (no longer separate versioning) Control.Describe now includes CPU architecture and family identifier if know fsharp F# math numeric statistics probability integration interpolation regression solve fit linear algebra matrix fft - false false true false diff --git a/src/NativeProviders/Windows/MKL/MKLWrapper.vcxproj.filters b/src/NativeProviders/Windows/MKL/MKLWrapper.vcxproj.filters index ac9baa12..b8b8fa8e 100644 --- a/src/NativeProviders/Windows/MKL/MKLWrapper.vcxproj.filters +++ b/src/NativeProviders/Windows/MKL/MKLWrapper.vcxproj.filters @@ -63,7 +63,7 @@ - + Source Files\Resource Files diff --git a/src/Numerics.Tests/Numerics.Tests.CUDA.csproj b/src/Numerics.Tests/Numerics.Tests.CUDA.csproj index 830552df..c73ed548 100644 --- a/src/Numerics.Tests/Numerics.Tests.CUDA.csproj +++ b/src/Numerics.Tests/Numerics.Tests.CUDA.csproj @@ -4,10 +4,11 @@ Exe false net5.0;net48 - false MathNet.Numerics.Tests.CUDA MathNet.Numerics.Tests false + 5.0.0 + alpha02 NATIVE;CUDA;$(CommonConstants) diff --git a/src/Numerics.Tests/Numerics.Tests.MKL.csproj b/src/Numerics.Tests/Numerics.Tests.MKL.csproj index 637fb05b..bddf68d9 100644 --- a/src/Numerics.Tests/Numerics.Tests.MKL.csproj +++ b/src/Numerics.Tests/Numerics.Tests.MKL.csproj @@ -4,10 +4,11 @@ Exe false net5.0;net48 - false MathNet.Numerics.Tests.MKL MathNet.Numerics.Tests false + 5.0.0 + alpha02 NATIVE;MKL;$(CommonConstants) diff --git a/src/Numerics.Tests/Numerics.Tests.OpenBLAS.csproj b/src/Numerics.Tests/Numerics.Tests.OpenBLAS.csproj index d3d7c884..2998743e 100644 --- a/src/Numerics.Tests/Numerics.Tests.OpenBLAS.csproj +++ b/src/Numerics.Tests/Numerics.Tests.OpenBLAS.csproj @@ -4,10 +4,11 @@ Exe false net5.0;net48 - false MathNet.Numerics.Tests.OpenBLAS MathNet.Numerics.Tests false + 5.0.0 + alpha02 NATIVE;OPENBLAS;$(CommonConstants) diff --git a/src/Numerics.Tests/Numerics.Tests.csproj b/src/Numerics.Tests/Numerics.Tests.csproj index 36df84ee..7da647cb 100644 --- a/src/Numerics.Tests/Numerics.Tests.csproj +++ b/src/Numerics.Tests/Numerics.Tests.csproj @@ -4,10 +4,11 @@ Exe false net5.0;net48 - false MathNet.Numerics.Tests MathNet.Numerics.Tests false + 5.0.0 + alpha02 true diff --git a/src/Numerics.Tests/Properties/AssemblyInfo.cs b/src/Numerics.Tests/Properties/AssemblyInfo.cs index c5062017..f4d90ec5 100644 --- a/src/Numerics.Tests/Properties/AssemblyInfo.cs +++ b/src/Numerics.Tests/Properties/AssemblyInfo.cs @@ -1,16 +1,7 @@ -using System.Reflection; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using MathNet.Numerics.UnitTests; -[assembly: AssemblyTitle("Math.NET Numerics Unit Tests")] -[assembly: AssemblyCompany("Math.NET Project")] -[assembly: AssemblyProduct("Math.NET Numerics")] -[assembly: AssemblyCopyright("Copyright (c) Math.NET Project")] [assembly: ComVisible(false)] [assembly: Guid("04157581-63f3-447b-a277-83c6e69126a4")] -[assembly: AssemblyVersion("5.0.0.0")] -[assembly: AssemblyFileVersion("5.0.0.0")] -[assembly: AssemblyInformationalVersion("5.0.0-alpha02")] - [assembly: UseLinearAlgebraProvider] diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj index 97f18e54..5b641a16 100644 --- a/src/Numerics/Numerics.csproj +++ b/src/Numerics/Numerics.csproj @@ -32,7 +32,6 @@ Lots of internal cleanup, leveraging newer language features Data: now released always together with Numerics (no longer separate versioning) Control.Describe now includes CPU architecture and family identifier if know math numeric statistics probability integration interpolation regression solve fit linear algebra matrix fft - true false true true diff --git a/src/Providers.CUDA/Providers.CUDA.csproj b/src/Providers.CUDA/Providers.CUDA.csproj index 50f7381f..860e8eff 100644 --- a/src/Providers.CUDA/Providers.CUDA.csproj +++ b/src/Providers.CUDA/Providers.CUDA.csproj @@ -31,7 +31,6 @@ Better support for System.Text.Json: Polynomial, DescriptiveStatistics ~Joseph P Lots of internal cleanup, leveraging newer language features Data: now released always together with Numerics (no longer separate versioning) Control.Describe now includes CPU architecture and family identifier if know - true false true true diff --git a/src/Providers.MKL/Providers.MKL.csproj b/src/Providers.MKL/Providers.MKL.csproj index 2a7b557b..c7539c86 100644 --- a/src/Providers.MKL/Providers.MKL.csproj +++ b/src/Providers.MKL/Providers.MKL.csproj @@ -31,7 +31,6 @@ Better support for System.Text.Json: Polynomial, DescriptiveStatistics ~Joseph P Lots of internal cleanup, leveraging newer language features Data: now released always together with Numerics (no longer separate versioning) Control.Describe now includes CPU architecture and family identifier if know - true false true true diff --git a/src/Providers.OpenBLAS/Providers.OpenBLAS.csproj b/src/Providers.OpenBLAS/Providers.OpenBLAS.csproj index d769e5db..6a453ec0 100644 --- a/src/Providers.OpenBLAS/Providers.OpenBLAS.csproj +++ b/src/Providers.OpenBLAS/Providers.OpenBLAS.csproj @@ -31,7 +31,6 @@ Better support for System.Text.Json: Polynomial, DescriptiveStatistics ~Joseph P Lots of internal cleanup, leveraging newer language features Data: now released always together with Numerics (no longer separate versioning) Control.Describe now includes CPU architecture and family identifier if know - true false true true diff --git a/src/TestData/Properties/AssemblyInfo.cs b/src/TestData/Properties/AssemblyInfo.cs index 4903d7db..9f46b988 100644 --- a/src/TestData/Properties/AssemblyInfo.cs +++ b/src/TestData/Properties/AssemblyInfo.cs @@ -1,18 +1,4 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Math.NET Numerics Test Data")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Math.NET Project")] -[assembly: AssemblyProduct("Math.NET Numerics")] -[assembly: AssemblyCopyright("Copyright (c) Math.NET Project")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +using System.Runtime.InteropServices; [assembly: ComVisible(false)] - [assembly: Guid("a4a6a08e-5265-4608-a43d-e4f2e210ba2d")] - -[assembly: AssemblyVersion("5.0.0.0")] -[assembly: AssemblyFileVersion("5.0.0.0")] diff --git a/src/TestData/TestData.csproj b/src/TestData/TestData.csproj index f61ce594..f81b4df4 100644 --- a/src/TestData/TestData.csproj +++ b/src/TestData/TestData.csproj @@ -3,10 +3,11 @@ Library net5.0;net461;net48;netstandard2.0 - false MathNet.Numerics.TestData MathNet.Numerics.TestData false + 5.0.0 + alpha02