Browse Source

Build: simplify bundle definitions since we leverage the dotnet sdk now

spatial
Christoph Ruegg 8 years ago
parent
commit
fdff25afc1
  1. 224
      build.fsx
  2. 42
      build/build-framework.fsx

224
build.fsx

@ -42,87 +42,40 @@ let releases = [ numericsRelease; mklRelease; openBlasRelease; dataRelease ] //
traceHeader releases traceHeader releases
// CORE PACKAGES // NUMERICS PACKAGES
let summary = "Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use." let numericsZipPackage =
let description = "Math.NET Numerics is the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. "
let support = "Supports .Net 4.0, .Net 3.5 and Mono on Windows, Linux and Mac; Silverlight 5, WindowsPhone/SL 8, WindowsPhone 8.1 and Windows 8 with PCL portable profiles 7, 47, 78, 259 and 328; Android/iOS with Xamarin."
let supportFsharp = "Supports F# 3.0 on .Net 4.0, .Net 3.5 and Mono on Windows, Linux and Mac; Silverlight 5 and Windows 8 with PCL portable profile 47; Android/iOS with Xamarin."
let supportSigned = "Supports .Net 4.0. This package contains strong-named assemblies for legacy use cases."
let tags = "math numeric statistics probability integration interpolation regression solve fit linear algebra matrix fft"
let numericsPack =
{ Id = "MathNet.Numerics" { Id = "MathNet.Numerics"
Release = numericsRelease Release = numericsRelease
Title = "Math.NET Numerics" Title = "Math.NET Numerics"
Summary = summary FsLoader = true }
Description = description + support
Tags = tags
Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ]
FsLoader = false
Dependencies =
[ { FrameworkVersion="net40"
Dependencies=[] } ]
Files =
[ @"..\..\out\lib\Net40\MathNet.Numerics.*", Some libnet40, Some @"**\MathNet.Numerics.FSharp.*";
@"..\..\src\Numerics\**\*.cs", Some "src/Common", None ] }
let fsharpPack =
{ numericsPack with
Id = "MathNet.Numerics.FSharp"
Title = "Math.NET Numerics for F#"
Summary = "F# Modules for " + summary
Description = description + supportFsharp
Tags = "fsharp F# " + tags
FsLoader = true
Dependencies =
[ { FrameworkVersion=""
Dependencies=[ "MathNet.Numerics", RequireExactly numericsRelease.PackageVersion
"FSharp.Core", GetPackageVersion "./packages/" "FSharp.Core" ] } ]
Files =
[ @"..\..\out\lib\Net40\MathNet.Numerics.FSharp.*", Some libnet40, None;
@"MathNet.Numerics.fsx", None, None;
@"MathNet.Numerics.IfSharp.fsx", None, None;
@"..\..\src\FSharp\**\*.fs", Some "src/Common", None ] }
let numericsSignedPack =
{ numericsPack with
Id = numericsPack.Id + ".Signed"
Title = numericsPack.Title + " - Signed Edition"
Description = description + supportSigned
Tags = numericsPack.Tags + " signed"
Dependencies = []
Files =
[ @"..\..\out\lib-signed\Net40\MathNet.Numerics.*", Some libnet40, Some @"**\MathNet.Numerics.FSharp.*";
@"..\..\src\Numerics\**\*.cs", Some "src/Common", None ] }
let fsharpSignedPack =
{ fsharpPack with
Id = fsharpPack.Id + ".Signed"
Title = fsharpPack.Title + " - Signed Edition"
Description = description + supportSigned
Tags = fsharpPack.Tags + " signed"
Dependencies =
[ { FrameworkVersion=""
Dependencies=[ "MathNet.Numerics.Signed", RequireExactly numericsRelease.PackageVersion
"FSharp.Core", GetPackageVersion "./packages/" "FSharp.Core" ] } ]
Files =
[ @"..\..\out\lib-signed\Net40\MathNet.Numerics.FSharp.*", Some libnet40, None;
@"MathNet.Numerics.fsx", None, None;
@"MathNet.Numerics.IfSharp.fsx", None, None;
@"..\..\src\FSharp\**\*.fs", Some "src/Common", None ] }
let coreBundle = let numericsStrongNameZipPackage =
{ Id = numericsPack.Id { numericsZipPackage with
Release = numericsRelease Id = "MathNet.Numerics.Signed" }
Title = numericsPack.Title
Packages = [ numericsPack; fsharpPack ] }
let coreSignedBundle = let numericsNuGetPackage = { Id = "MathNet.Numerics"; Release = numericsRelease }
{ Id = numericsSignedPack.Id let numericsFSharpNuGetPackage = { Id = "MathNet.Numerics.FSharp"; Release = numericsRelease }
Release = numericsRelease let numericsStrongNameNuGetPackage = { Id = "MathNet.Numerics.Signed"; Release = numericsRelease }
Title = numericsSignedPack.Title let numericsFSharpStrongNameNuGetPackage = { Id = "MathNet.Numerics.FSharp.Signed"; Release = numericsRelease }
Packages = [ numericsSignedPack; fsharpSignedPack ] }
// DATA EXTENSION PACKAGES
let dataZipPackage =
{ Id = "MathNet.Numerics.Data"
Release = dataRelease
Title = "Math.NET Numerics Data Extensions"
FsLoader = false }
let dataStrongNameZipPackage =
{ dataZipPackage with
Id = "MathNet.Numerics.Data.Signed" }
let dataTextNuGetPackage = { Id = "MathNet.Numerics.Data.Text"; Release = dataRelease }
let dataMatlabNuGetPackage = { Id = "MathNet.Numerics.Data.Matlab"; Release = dataRelease }
let dataTextStrongNameNuGetPackage = { Id = "MathNet.Numerics.Data.Text.Signed"; Release = dataRelease }
let dataMatlabStrongNameNuGetPackage = { Id = "MathNet.Numerics.Data.Matlab.Signed"; Release = dataRelease }
// MKL NATIVE PROVIDER PACKAGES // MKL NATIVE PROVIDER PACKAGES
@ -209,6 +162,26 @@ let mklLinuxBundle =
Title = "Math.NET Numerics MKL Native Provider for Linux" Title = "Math.NET Numerics MKL Native Provider for Linux"
Packages = [ mklLinuxPack; mklLinux32Pack; mklLinux64Pack ] } Packages = [ mklLinuxPack; mklLinux32Pack; mklLinux64Pack ] }
let mklWinZipPackage =
{ Id = "MathNet.Numerics.MKL.Win"
Release = mklRelease
Title = "Math.NET Numerics MKL Native Provider for Windows"
FsLoader = false }
let mklLinuxZipPackage =
{ Id = "MathNet.Numerics.MKL.Linux"
Release = mklRelease
Title = "Math.NET Numerics MKL Native Provider for Linux"
FsLoader = false }
let mklWinNuGetPackage = { Id = "MathNet.Numerics.MKL.Win"; Release = mklRelease }
let mklWin32NuGetPackage = { Id = "MathNet.Numerics.MKL.Win-x86"; Release = mklRelease }
let mklWin64NuGetPackage = { Id = "MathNet.Numerics.MKL.Win-x64"; Release = mklRelease }
let mklLinuxNuGetPackage = { Id = "MathNet.Numerics.MKL.Linux"; Release = mklRelease }
let mklLinux32NuGetPackage = { Id = "MathNet.Numerics.MKL.Linux-x86"; Release = mklRelease }
let mklLinux64NuGetPackage = { Id = "MathNet.Numerics.MKL.Linux-x64"; Release = mklRelease }
// CUDA NATIVE PROVIDER PACKAGES // CUDA NATIVE PROVIDER PACKAGES
@ -235,6 +208,14 @@ let cudaWinBundle =
Title = "Math.NET Numerics CUDA Native Provider for Windows" Title = "Math.NET Numerics CUDA Native Provider for Windows"
Packages = [ cudaWinPack ] } Packages = [ cudaWinPack ] }
let cudaWinZipPackage =
{ Id = "MathNet.Numerics.CUDA.Win"
Release = cudaRelease
Title = "Math.NET Numerics CUDA Native Provider for Windows"
FsLoader = false }
let cudaWinNuGetPackage = { Id = "MathNet.Numerics.CUDA.Win"; Release = cudaRelease }
// OpenBLAS NATIVE PROVIDER PACKAGES // OpenBLAS NATIVE PROVIDER PACKAGES
@ -267,52 +248,13 @@ let openBlasWinBundle =
Title = "Math.NET Numerics OpenBLAS Native Provider for Windows" Title = "Math.NET Numerics OpenBLAS Native Provider for Windows"
Packages = [ openBlasWinPack ] } Packages = [ openBlasWinPack ] }
let openBlasWinZipPackage =
{ Id = "MathNet.Numerics.OpenBLAS.Win"
Release = openBlasRelease
Title = "Math.NET Numerics OpenBLAS Native Provider for Windows"
FsLoader = false }
// DATA EXTENSION PACKAGES let openBlasWinNuGetPackage = { Id = "MathNet.Numerics.OpenBLAS.Win"; Release = openBlasRelease }
let dataTextPack =
{ Id = "MathNet.Numerics.Data.Text"
Release = dataRelease
Title = "Math.NET Numerics - Text Data I/O Extensions"
Summary = ""
Description = "Text Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use."
Tags = "math numeric data text csv tsv json xml"
Authors = [ "Christoph Ruegg"; "Marcus Cuda" ]
FsLoader = false
Dependencies =
[ { FrameworkVersion=""
Dependencies=[ "MathNet.Numerics", "4.0.0" ] } ]
Files =
[ @"..\..\out\Data\lib\Net40\MathNet.Numerics.Data.Text.dll", Some libnet40, None;
@"..\..\out\Data\lib\Net40\MathNet.Numerics.Data.Text.xml", Some libnet40, None ] }
let dataMatlabPack =
{ Id = "MathNet.Numerics.Data.Matlab"
Release = dataRelease
Title = "Math.NET Numerics - MATLAB Data I/O Extensions"
Summary = ""
Description = "MathWorks MATLAB Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use."
Tags = "math numeric data matlab"
Authors = [ "Christoph Ruegg"; "Marcus Cuda" ]
FsLoader = false
Dependencies =
[ { FrameworkVersion=""
Dependencies=[ "MathNet.Numerics", "4.0.0" ] } ]
Files =
[ @"..\..\out\Data\lib\Net40\MathNet.Numerics.Data.Matlab.dll", Some libnet40, None;
@"..\..\out\Data\lib\Net40\MathNet.Numerics.Data.Matlab.xml", Some libnet40, None ] }
let dataBundle =
{ Id = "MathNet.Numerics.Data"
Release = dataRelease
Title = "Math.NET Numerics Data Extensions"
Packages = [ dataTextPack; dataMatlabPack ] }
let dataSignedBundle =
{ Id = "MathNet.Numerics.Data.Signed"
Release = dataRelease
Title = "Math.NET Numerics Data Extensions"
Packages = [ dataTextPack; dataMatlabPack ] }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
@ -373,7 +315,7 @@ Target "Build" (fun _ ->
buildSN "MathNet.Numerics.sln" buildSN "MathNet.Numerics.sln"
CopyDir "out/Numerics/lib-strongname" "src/Numerics/bin/Release" (fun n -> n.Contains("MathNet.Numerics.dll") || n.Contains("MathNet.Numerics.pdb") || n.Contains("MathNet.Numerics.xml")) CopyDir "out/Numerics/lib-strongname" "src/Numerics/bin/Release" (fun n -> n.Contains("MathNet.Numerics.dll") || n.Contains("MathNet.Numerics.pdb") || n.Contains("MathNet.Numerics.xml"))
CopyDir "out/Numerics/lib-strongname" "src/FSharp/bin/Release" (fun n -> n.Contains("MathNet.Numerics.FSharp.dll") || n.Contains("MathNet.Numerics.FSharp.pdb") || n.Contains("MathNet.Numerics.FSharp.xml")) CopyDir "out/Numerics/lib-strongname" "src/FSharp/bin/Release" (fun n -> n.Contains("MathNet.Numerics.FSharp.dll") || n.Contains("MathNet.Numerics.FSharp.pdb") || n.Contains("MathNet.Numerics.FSharp.xml"))
coreSignedBundle |> zip "out/Numerics/packages/Zip" "out/Numerics/lib-strongname" (fun f -> f.Contains("MathNet.Numerics.") || f.Contains("System.Threading.") || f.Contains("FSharp.Core.")) zip numericsStrongNameZipPackage "out/Numerics/packages/Zip" "out/Numerics/lib-strongname" (fun f -> f.Contains("MathNet.Numerics.") || f.Contains("System.Threading.") || f.Contains("FSharp.Core."))
if isWindows then if isWindows then
packSN "MathNet.Numerics.sln" packSN "MathNet.Numerics.sln"
CopyDir "out/Numerics/packages/NuGet" "src/Numerics/bin/Release/" (fun n -> n.EndsWith(".nupkg")) CopyDir "out/Numerics/packages/NuGet" "src/Numerics/bin/Release/" (fun n -> n.EndsWith(".nupkg"))
@ -387,13 +329,15 @@ Target "Build" (fun _ ->
sign fingerprint timeserver (!! "src/Numerics/bin/Release/**/MathNet.Numerics.dll" ++ "src/FSharp/bin/Release/**/MathNet.Numerics.FSharp.dll" ) sign fingerprint timeserver (!! "src/Numerics/bin/Release/**/MathNet.Numerics.dll" ++ "src/FSharp/bin/Release/**/MathNet.Numerics.FSharp.dll" )
CopyDir "out/Numerics/lib" "src/Numerics/bin/Release" (fun n -> n.Contains("MathNet.Numerics.dll") || n.Contains("MathNet.Numerics.pdb") || n.Contains("MathNet.Numerics.xml")) CopyDir "out/Numerics/lib" "src/Numerics/bin/Release" (fun n -> n.Contains("MathNet.Numerics.dll") || n.Contains("MathNet.Numerics.pdb") || n.Contains("MathNet.Numerics.xml"))
CopyDir "out/Numerics/lib" "src/FSharp/bin/Release" (fun n -> n.Contains("MathNet.Numerics.FSharp.dll") || n.Contains("MathNet.Numerics.FSharp.pdb") || n.Contains("MathNet.Numerics.FSharp.xml")) CopyDir "out/Numerics/lib" "src/FSharp/bin/Release" (fun n -> n.Contains("MathNet.Numerics.FSharp.dll") || n.Contains("MathNet.Numerics.FSharp.pdb") || n.Contains("MathNet.Numerics.FSharp.xml"))
coreBundle |> zip "out/Numerics/packages/Zip" "out/Numerics/lib" (fun f -> f.Contains("MathNet.Numerics.") || f.Contains("System.Threading.") || f.Contains("FSharp.Core.")) zip numericsZipPackage "out/Numerics/packages/Zip" "out/Numerics/lib" (fun f -> f.Contains("MathNet.Numerics.") || f.Contains("System.Threading.") || f.Contains("FSharp.Core."))
if isWindows then if isWindows then
pack "MathNet.Numerics.sln" pack "MathNet.Numerics.sln"
CopyDir "out/Numerics/packages/NuGet" "src/Numerics/bin/Release/" (fun n -> n.EndsWith(".nupkg")) CopyDir "out/Numerics/packages/NuGet" "src/Numerics/bin/Release/" (fun n -> n.EndsWith(".nupkg"))
CopyDir "out/Numerics/packages/NuGet" "src/FSharp/bin/Release/" (fun n -> n.EndsWith(".nupkg")) CopyDir "out/Numerics/packages/NuGet" "src/FSharp/bin/Release/" (fun n -> n.EndsWith(".nupkg"))
if hasBuildParam "sign" then
Seq.iter (signNuGet fingerprint timeserver) (!! "out/Numerics/packages/NuGet/*.nupkg" -- "out/Numerics/packages/NuGet/*.Signed.*.nupkg") // NuGet Sign (all or nothing)
if isWindows && hasBuildParam "sign" then
Seq.iter (signNuGet fingerprint timeserver) !! "out/Numerics/packages/NuGet/*.nupkg"
) )
"Prepare" ==> "Build" "Prepare" ==> "Build"
@ -407,7 +351,7 @@ Target "DataBuild" (fun _ ->
buildSN "MathNet.Numerics.Data.sln" buildSN "MathNet.Numerics.Data.sln"
CopyDir "out/Data/lib-strongname" "src/Data/Text/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Text.dll") || n.Contains("MathNet.Numerics.Data.Text.pdb") || n.Contains("MathNet.Numerics.Data.Text.xml")) CopyDir "out/Data/lib-strongname" "src/Data/Text/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Text.dll") || n.Contains("MathNet.Numerics.Data.Text.pdb") || n.Contains("MathNet.Numerics.Data.Text.xml"))
CopyDir "out/Data/lib-strongname" "src/Data/Matlab/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Matlab.dll") || n.Contains("MathNet.Numerics.Data.Matlab.pdb") || n.Contains("MathNet.Numerics.Data.Matlab.xml")) CopyDir "out/Data/lib-strongname" "src/Data/Matlab/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Matlab.dll") || n.Contains("MathNet.Numerics.Data.Matlab.pdb") || n.Contains("MathNet.Numerics.Data.Matlab.xml"))
dataSignedBundle |> zip "out/Data/packages/Zip" "out/Data/lib-strongname" (fun f -> f.Contains("MathNet.Numerics.Data.")) zip dataStrongNameZipPackage "out/Data/packages/Zip" "out/Data/lib-strongname" (fun f -> f.Contains("MathNet.Numerics.Data."))
if isWindows then if isWindows then
packSN "src/Data/Text/Text.csproj" packSN "src/Data/Text/Text.csproj"
packSN "src/Data/Matlab/Matlab.csproj" packSN "src/Data/Matlab/Matlab.csproj"
@ -422,14 +366,16 @@ Target "DataBuild" (fun _ ->
sign fingerprint timeserver (!! "src/Data/Text/bin/Release/**/MathNet.Numerics.Data.Text.dll" ++ "src/Data/Matlab/bin/Release/**/MathNet.Numerics.Data.Matlab.dll" ) sign fingerprint timeserver (!! "src/Data/Text/bin/Release/**/MathNet.Numerics.Data.Text.dll" ++ "src/Data/Matlab/bin/Release/**/MathNet.Numerics.Data.Matlab.dll" )
CopyDir "out/Data/lib" "src/Data/Text/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Text.dll") || n.Contains("MathNet.Numerics.Data.Text.pdb") || n.Contains("MathNet.Numerics.Data.Text.xml")) CopyDir "out/Data/lib" "src/Data/Text/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Text.dll") || n.Contains("MathNet.Numerics.Data.Text.pdb") || n.Contains("MathNet.Numerics.Data.Text.xml"))
CopyDir "out/Data/lib" "src/Data/Matlab/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Matlab.dll") || n.Contains("MathNet.Numerics.Data.Matlab.pdb") || n.Contains("MathNet.Numerics.Data.Matlab.xml")) CopyDir "out/Data/lib" "src/Data/Matlab/bin/Release" (fun n -> n.Contains("MathNet.Numerics.Data.Matlab.dll") || n.Contains("MathNet.Numerics.Data.Matlab.pdb") || n.Contains("MathNet.Numerics.Data.Matlab.xml"))
dataBundle |> zip "out/Data/packages/Zip" "out/Data/lib" (fun f -> f.Contains("MathNet.Numerics.Data.")) zip dataZipPackage "out/Data/packages/Zip" "out/Data/lib" (fun f -> f.Contains("MathNet.Numerics.Data."))
if isWindows then if isWindows then
pack "src/Data/Text/Text.csproj" pack "src/Data/Text/Text.csproj"
pack "src/Data/Matlab/Matlab.csproj" pack "src/Data/Matlab/Matlab.csproj"
CopyDir "out/Data/packages/NuGet" "src/Data/Text/bin/Release/" (fun n -> n.EndsWith(".nupkg")) CopyDir "out/Data/packages/NuGet" "src/Data/Text/bin/Release/" (fun n -> n.EndsWith(".nupkg"))
CopyDir "out/Data/packages/NuGet" "src/Data/Matlab/bin/Release/" (fun n -> n.EndsWith(".nupkg")) CopyDir "out/Data/packages/NuGet" "src/Data/Matlab/bin/Release/" (fun n -> n.EndsWith(".nupkg"))
if hasBuildParam "sign" then
Seq.iter (signNuGet fingerprint timeserver) (!! "out/Data/packages/NuGet/*.nupkg" -- "out/Data/packages/NuGet/*.Signed.*.nupkg") // NuGet Sign (all or nothing)
if isWindows && hasBuildParam "sign" then
Seq.iter (signNuGet fingerprint timeserver) !! "out/Data/packages/NuGet/*.nupkg"
) )
"Prepare" ==> "DataBuild" "Prepare" ==> "DataBuild"
@ -532,23 +478,23 @@ Target "OpenBlasWinPack" DoNothing
Target "MklWinZip" (fun _ -> Target "MklWinZip" (fun _ ->
CreateDir "out/MKL/packages/Zip" CreateDir "out/MKL/packages/Zip"
mklWinBundle |> zip "out/MKL/packages/Zip" "out/MKL/Windows" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5md.dll"))) zip mklWinZipPackage "out/MKL/packages/Zip" "out/MKL/Windows" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5md.dll")))
"MklWinBuild" ==> "MklWinZip" ==> "MklWinPack" "MklWinBuild" ==> "MklWinZip" ==> "MklWinPack"
Target "MklLinuxZip" (fun _ -> Target "MklLinuxZip" (fun _ ->
CreateDir "out/MKL/packages/Zip" CreateDir "out/MKL/packages/Zip"
mklLinuxBundle |> zip "out/MKL/packages/Zip" "out/MKL/Linux" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5.so"))) zip mklLinuxZipPackage "out/MKL/packages/Zip" "out/MKL/Linux" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5.so")))
// "MklLinuxBuild" ==> "MklLinuxZip" ==> "MklLinuxPack" // "MklLinuxBuild" ==> "MklLinuxZip" ==> "MklLinuxPack"
"MklLinuxZip" ==> "MklLinuxPack" "MklLinuxZip" ==> "MklLinuxPack"
Target "CudaWinZip" (fun _ -> Target "CudaWinZip" (fun _ ->
CreateDir "out/CUDA/packages/Zip" CreateDir "out/CUDA/packages/Zip"
cudaWinBundle |> zip "out/CUDA/packages/Zip" "out/CUDA/Windows" (fun f -> f.Contains("MathNet.Numerics.CUDA.") || f.Contains("cublas") || f.Contains("cudart") || f.Contains("cusolver"))) zip cudaWinZipPackage "out/CUDA/packages/Zip" "out/CUDA/Windows" (fun f -> f.Contains("MathNet.Numerics.CUDA.") || f.Contains("cublas") || f.Contains("cudart") || f.Contains("cusolver")))
"CudaWinBuild" ==> "CudaWinZip" ==> "CudaWinPack" "CudaWinBuild" ==> "CudaWinZip" ==> "CudaWinPack"
Target "OpenBlasWinZip" (fun _ -> Target "OpenBlasWinZip" (fun _ ->
CreateDir "out/OpenBLAS/packages/Zip" CreateDir "out/OpenBLAS/packages/Zip"
openBlasWinBundle |> zip "out/OpenBLAS/packages/Zip" "out/OpenBLAS/Windows" (fun f -> f.Contains("MathNet.Numerics.OpenBLAS.") || f.Contains("libgcc") || f.Contains("libgfortran") || f.Contains("libopenblas") || f.Contains("libquadmath"))) zip openBlasWinZipPackage "out/OpenBLAS/packages/Zip" "out/OpenBLAS/Windows" (fun f -> f.Contains("MathNet.Numerics.OpenBLAS.") || f.Contains("libgcc") || f.Contains("libgfortran") || f.Contains("libopenblas") || f.Contains("libquadmath")))
"OpenBlasWinBuild" ==> "OpenBlasWinZip" ==> "OpenBlasWinPack" "OpenBlasWinBuild" ==> "OpenBlasWinZip" ==> "OpenBlasWinPack"
// NUGET // NUGET
@ -637,26 +583,26 @@ Target "Api" (fun _ ->
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
Target "PublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics" "" numericsRelease) Target "PublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics" "" numericsRelease)
Target "DataPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics Data Extensions" "data-" dataRelease)
Target "MklPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics MKL Provider" "mkl-" mklRelease) Target "MklPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics MKL Provider" "mkl-" mklRelease)
Target "CudaPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics CUDA Provider" "cuda-" cudaRelease) Target "CudaPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics CUDA Provider" "cuda-" cudaRelease)
Target "OpenBlasPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics OpenBLAS Provider" "openblas-" openBlasRelease) Target "OpenBlasPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics OpenBLAS Provider" "openblas-" openBlasRelease)
Target "DataPublishTag" (fun _ -> publishReleaseTag "Math.NET Numerics Data Extensions" "data-" dataRelease)
Target "PublishMirrors" (fun _ -> publishMirrors ()) Target "PublishMirrors" (fun _ -> publishMirrors ())
Target "PublishDocs" (fun _ -> publishDocs numericsRelease) Target "PublishDocs" (fun _ -> publishDocs numericsRelease)
Target "PublishApi" (fun _ -> publishApi numericsRelease) Target "PublishApi" (fun _ -> publishApi numericsRelease)
Target "PublishArchive" (fun _ -> publishArchive "out/Numerics/packages/Zip" "out/Numerics/packages/NuGet" [coreBundle; coreSignedBundle]) Target "PublishArchive" (fun _ -> publishArchive "out/Numerics/packages/Zip" "out/Numerics/packages/NuGet" [numericsZipPackage; numericsStrongNameZipPackage] [numericsNuGetPackage; numericsFSharpNuGetPackage; numericsStrongNameNuGetPackage; numericsFSharpStrongNameNuGetPackage])
Target "MklPublishArchive" (fun _ -> publishArchive "out/MKL/packages/Zip" "out/MKL/packages/NuGet" [mklWinBundle; mklLinuxBundle]) Target "DataPublishArchive" (fun _ -> publishArchive "out/Data/packages/Zip" "out/Data/packages/NuGet" [dataZipPackage; dataStrongNameZipPackage] [dataTextNuGetPackage; dataMatlabNuGetPackage; dataTextStrongNameNuGetPackage; dataMatlabStrongNameNuGetPackage])
Target "CudaPublishArchive" (fun _ -> publishArchive "out/CUDA/packages/Zip" "out/CUDA/packages/NuGet" [cudaWinBundle]) Target "MklPublishArchive" (fun _ -> publishArchive "out/MKL/packages/Zip" "out/MKL/packages/NuGet" [mklWinZipPackage; mklLinuxZipPackage] [mklWinNuGetPackage; mklWin32NuGetPackage; mklWin64NuGetPackage; mklLinuxNuGetPackage; mklLinux32NuGetPackage; mklLinux64NuGetPackage])
Target "OpenBlasPublishArchive" (fun _ -> publishArchive "out/OpenBLAS/packages/Zip" "out/OpenBLAS/packages/NuGet" [openBlasWinBundle]) Target "CudaPublishArchive" (fun _ -> publishArchive "out/CUDA/packages/Zip" "out/CUDA/packages/NuGet" [cudaWinZipPackage] [cudaWinNuGetPackage])
Target "DataPublishArchive" (fun _ -> publishArchive "out/Data/packages/Zip" "out/Data/packages/NuGet" [dataBundle]) Target "OpenBlasPublishArchive" (fun _ -> publishArchive "out/OpenBLAS/packages/Zip" "out/OpenBLAS/packages/NuGet" [openBlasWinZipPackage] [openBlasWinNuGetPackage])
Target "PublishNuGet" (fun _ -> !! "out/Numerics/packages/NuGet/*.nupkg" -- "out/Numerics/packages/NuGet/*.symbols.nupkg" |> publishNuGet) Target "PublishNuGet" (fun _ -> !! "out/Numerics/packages/NuGet/*.nupkg" -- "out/Numerics/packages/NuGet/*.symbols.nupkg" |> publishNuGet)
Target "DataPublishNuGet" (fun _ -> !! "out/Data/packages/NuGet/*.nupkg" |> publishNuGet)
Target "MklPublishNuGet" (fun _ -> !! "out/MKL/packages/NuGet/*.nupkg" |> publishNuGet) Target "MklPublishNuGet" (fun _ -> !! "out/MKL/packages/NuGet/*.nupkg" |> publishNuGet)
Target "CudaPublishNuGet" (fun _ -> !! "out/CUDA/packages/NuGet/*.nupkg" |> publishNuGet) Target "CudaPublishNuGet" (fun _ -> !! "out/CUDA/packages/NuGet/*.nupkg" |> publishNuGet)
Target "OpenBlasPublishNuGet" (fun _ -> !! "out/OpenBLAS/packages/NuGet/*.nupkg" |> publishNuGet) Target "OpenBlasPublishNuGet" (fun _ -> !! "out/OpenBLAS/packages/NuGet/*.nupkg" |> publishNuGet)
Target "DataPublishNuGet" (fun _ -> !! "out/Data/packages/NuGet/*.nupkg" |> publishNuGet)
Target "Publish" DoNothing Target "Publish" DoNothing
Dependencies "Publish" [ "PublishTag"; "PublishDocs"; "PublishApi"; "PublishArchive"; "PublishNuGet" ] Dependencies "Publish" [ "PublishTag"; "PublishDocs"; "PublishApi"; "PublishArchive"; "PublishNuGet" ]

42
build/build-framework.fsx

@ -117,6 +117,16 @@ type Bundle =
Title: string Title: string
Packages: Package list } Packages: Package list }
type ZipPackage =
{ Id: string
Release: Release
Title: string
FsLoader: bool }
type NuGetPackage =
{ Id: string
Release: Release }
let release title releaseNotesFile : Release = let release title releaseNotesFile : Release =
let info = LoadReleaseNotes releaseNotesFile let info = LoadReleaseNotes releaseNotesFile
let buildPart = "0" let buildPart = "0"
@ -251,10 +261,10 @@ let provideFsIfSharpLoader path =
let startIndex = fullScript |> Seq.findIndex (fun s -> s.Contains "***MathNet.Numerics.IfSharp.fsx***") let startIndex = fullScript |> Seq.findIndex (fun s -> s.Contains "***MathNet.Numerics.IfSharp.fsx***")
ReplaceFile (path </> "MathNet.Numerics.IfSharp.fsx") (fullScript .[startIndex + 1 ..] |> toLines) ReplaceFile (path </> "MathNet.Numerics.IfSharp.fsx") (fullScript .[startIndex + 1 ..] |> toLines)
let provideZipExtraFiles path (bundle:Bundle) = let provideZipExtraFiles (package:ZipPackage) path =
provideLicense path provideLicense path
provideReadme (sprintf "%s v%s" bundle.Title bundle.Release.PackageVersion) bundle.Release path provideReadme (sprintf "%s v%s" package.Title package.Release.PackageVersion) package.Release path
if bundle.Packages |> List.exists (fun p -> p.FsLoader) then if package.FsLoader then
let includes = [ for root in [ ""; "../"; "../../" ] -> sprintf "#I \"%sNet40\"" root ] let includes = [ for root in [ ""; "../"; "../../" ] -> sprintf "#I \"%sNet40\"" root ]
provideFsLoader includes path provideFsLoader includes path
provideFsIfSharpLoader path provideFsIfSharpLoader path
@ -297,12 +307,12 @@ let signNuGet fingerprint timeserver file =
// ZIP // ZIP
let zip zipDir filesDir filesFilter (bundle:Bundle) = let zip (package:ZipPackage) zipDir filesDir filesFilter =
CleanDir "obj/Zip" CleanDir "obj/Zip"
let workPath = "obj/Zip/" + bundle.Id let workPath = "obj/Zip/" + package.Id
CopyDir workPath filesDir filesFilter CopyDir workPath filesDir filesFilter
provideZipExtraFiles workPath bundle provideZipExtraFiles package workPath
Zip "obj/Zip/" (zipDir </> sprintf "%s-%s.zip" bundle.Id bundle.Release.PackageVersion) !! (workPath + "/**/*.*") Zip "obj/Zip/" (zipDir </> sprintf "%s-%s.zip" package.Id package.Release.PackageVersion) !! (workPath + "/**/*.*")
DeleteDir "obj/Zip" DeleteDir "obj/Zip"
// NUGET // NUGET
@ -459,9 +469,9 @@ let publishApi (release:Release) =
Git.Commit.Commit repo (sprintf "Numerics: %s api update" release.PackageVersion) Git.Commit.Commit repo (sprintf "Numerics: %s api update" release.PackageVersion)
Git.Branches.pushBranch repo "origin" "master" Git.Branches.pushBranch repo "origin" "master"
let publishNuGetToArchive archivePath nupkgFile (pack:Package) = let publishNuGetToArchive (package:NuGetPackage) archivePath nupkgFile =
let tempDir = Path.GetTempPath() </> Path.GetRandomFileName() let tempDir = Path.GetTempPath() </> Path.GetRandomFileName()
let archiveDir = archivePath </> pack.Id </> pack.Release.PackageVersion let archiveDir = archivePath </> package.Id </> package.Release.PackageVersion
CleanDirs [tempDir; archiveDir] CleanDirs [tempDir; archiveDir]
nupkgFile |> CopyFile archiveDir nupkgFile |> CopyFile archiveDir
use sha512 = System.Security.Cryptography.SHA512.Create() use sha512 = System.Security.Cryptography.SHA512.Create()
@ -471,18 +481,18 @@ let publishNuGetToArchive archivePath nupkgFile (pack:Package) =
!! (tempDir </> "*.nuspec") |> Copy archiveDir !! (tempDir </> "*.nuspec") |> Copy archiveDir
DeleteDir tempDir DeleteDir tempDir
let publishArchive zipOutPath nugetOutPath (bundles:Bundle list) = let publishArchive zipOutPath nugetOutPath (zipPackages:ZipPackage list) (nugetPackages:NuGetPackage list) =
let archivePath = (environVarOrFail "MathNetReleaseArchive") </> "Math.NET Numerics" let archivePath = (environVarOrFail "MathNetReleaseArchive") </> "Math.NET Numerics"
if directoryExists archivePath |> not then failwith "Release archive directory does not exists. Safety Check failed." if directoryExists archivePath |> not then failwith "Release archive directory does not exists. Safety Check failed."
for bundle in bundles do for zipPackage in zipPackages do
let zipFile = zipOutPath </> sprintf "%s-%s.zip" bundle.Id bundle.Release.PackageVersion let zipFile = zipOutPath </> sprintf "%s-%s.zip" zipPackage.Id zipPackage.Release.PackageVersion
if FileSystemHelper.fileExists zipFile then if FileSystemHelper.fileExists zipFile then
zipFile |> CopyFile (archivePath </> "Zip") zipFile |> CopyFile (archivePath </> "Zip")
for package in bundles |> List.collect (fun b -> b.Packages) do for nugetPackage in nugetPackages do
let nupkgFile = nugetOutPath </> sprintf "%s.%s.nupkg" package.Id package.Release.PackageVersion let nupkgFile = nugetOutPath </> sprintf "%s.%s.nupkg" nugetPackage.Id nugetPackage.Release.PackageVersion
if FileSystemHelper.fileExists nupkgFile then if FileSystemHelper.fileExists nupkgFile then
trace nupkgFile trace nupkgFile
publishNuGetToArchive (archivePath </> "NuGet") nupkgFile package publishNuGetToArchive nugetPackage (archivePath </> "NuGet") nupkgFile
let symbolsFile = nugetOutPath </> sprintf "%s.%s.symbols.nupkg" package.Id package.Release.PackageVersion let symbolsFile = nugetOutPath </> sprintf "%s.%s.symbols.nupkg" nugetPackage.Id nugetPackage.Release.PackageVersion
if FileSystemHelper.fileExists symbolsFile then if FileSystemHelper.fileExists symbolsFile then
symbolsFile |> CopyFile (archivePath </> "Symbols") symbolsFile |> CopyFile (archivePath </> "Symbols")

Loading…
Cancel
Save