From fbc594dc6b99b9cfceebb17dba42438be63f0f49 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sat, 23 Jun 2018 22:37:38 +0200 Subject: [PATCH] Build: simplify native provider build and packaging --- build.fsx | 190 +++++++++++--------------------------- build/build-framework.fsx | 71 ++++---------- 2 files changed, 73 insertions(+), 188 deletions(-) diff --git a/build.fsx b/build.fsx index f1ca992c..04004cc1 100644 --- a/build.fsx +++ b/build.fsx @@ -74,15 +74,27 @@ let dataSolution = solution "Data" "MathNet.Numerics.Data.sln" [dataTextProject; // MKL NATIVE PROVIDER PACKAGES +let mklWinZipPackage = zipPackage "MathNet.Numerics.MKL.Win" "Math.NET Numerics MKL Native Provider for Windows" mklRelease false +let mklLinuxZipPackage = zipPackage "MathNet.Numerics.MKL.Linux" "Math.NET Numerics MKL Native Provider for Linux" mklRelease false + +let mklWinNuGetPackage = nugetPackage "MathNet.Numerics.MKL.Win" mklRelease +let mklWin32NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Win-x86" mklRelease +let mklWin64NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Win-x64" mklRelease +let mklLinuxNuGetPackage = nugetPackage "MathNet.Numerics.MKL.Linux" mklRelease +let mklLinux32NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Linux-x86" mklRelease +let mklLinux64NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Linux-x64" mklRelease + +let mklWinProject = nativeProject "MathNet.Numerics.MKL" "src/NativeProviders/Windows/MKL/MKLWrapper.vcxproj" [mklWinNuGetPackage; mklWin32NuGetPackage; mklWin64NuGetPackage] +let mklLinuxProject = nativeBashScriptProject "MathNet.Numerics.MKL" "src/NativeProviders/Linux/mkl_build.sh" [mklLinuxNuGetPackage; mklLinux32NuGetPackage; mklLinux64NuGetPackage] +let mklSolution = solution "MKL" "MathNet.Numerics.MKL.sln" [mklWinProject; mklLinuxProject] [mklWinZipPackage; mklLinuxZipPackage] + let mklWinPack = - { Id = "MathNet.Numerics.MKL.Win" - Release = mklRelease + { NuGet = mklWinNuGetPackage Title = "Math.NET Numerics - MKL Native Provider for Windows (x64 and x86)" Summary = "" Description = "Intel MKL native libraries for Math.NET Numerics on Windows." Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native mkl" Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ] - FsLoader = false Dependencies = [] Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.MKL.Win.targets", None; @@ -93,7 +105,7 @@ let mklWinPack = let mklWin32Pack = { mklWinPack with - Id = "MathNet.Numerics.MKL.Win-x86" + NuGet = mklWin32NuGetPackage Title = "Math.NET Numerics - MKL Native Provider for Windows (x86)" Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.MKL.Win-x86.targets", None; @@ -102,7 +114,7 @@ let mklWin32Pack = let mklWin64Pack = { mklWinPack with - Id = "MathNet.Numerics.MKL.Win-x64" + NuGet = mklWin64NuGetPackage Title = "Math.NET Numerics - MKL Native Provider for Windows (x64)" Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.MKL.Win-x64.targets", None; @@ -110,14 +122,12 @@ let mklWin64Pack = @"..\..\out\MKL\Windows\x64\MathNet.Numerics.MKL.dll", Some @"build\x64", None ] } let mklLinuxPack = - { Id = "MathNet.Numerics.MKL.Linux" - Release = mklRelease + { NuGet = mklLinuxNuGetPackage Title = "Math.NET Numerics - MKL Native Provider for Linux (x64 and x86)" Summary = "" Description = "Intel MKL native libraries for Math.NET Numerics on Linux." Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native mkl" Authors = [ "Christoph Ruegg"; "Marcus Cuda"; "Jurgen Van Gael" ] - FsLoader = false Dependencies = [] Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.MKL.Linux.targets", None; @@ -128,7 +138,7 @@ let mklLinuxPack = let mklLinux32Pack = { mklLinuxPack with - Id = "MathNet.Numerics.MKL.Linux-x86" + NuGet = mklLinux32NuGetPackage Title = "Math.NET Numerics - MKL Native Provider for Linux (x86)" Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.MKL.Linux-x86.targets", None; @@ -137,51 +147,29 @@ let mklLinux32Pack = let mklLinux64Pack = { mklLinuxPack with - Id = "MathNet.Numerics.MKL.Linux-x64" + NuGet = mklLinux64NuGetPackage Title = "Math.NET Numerics - MKL Native Provider for Linux (x64)" Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.MKL.Linux-x64.targets", None; @"..\..\out\MKL\Linux\x64\libiomp5.so", Some @"build\x64", None; @"..\..\out\MKL\Linux\x64\MathNet.Numerics.MKL.dll", Some @"build\x64", None ] } -let mklWinBundle = - { Id = "MathNet.Numerics.MKL.Win" - Release = mklRelease - Title = "Math.NET Numerics MKL Native Provider for Windows" - Packages = [ mklWinPack; mklWin32Pack; mklWin64Pack ] } - -let mklLinuxBundle = - { Id = "MathNet.Numerics.MKL.Linux" - Release = mklRelease - Title = "Math.NET Numerics MKL Native Provider for Linux" - Packages = [ mklLinuxPack; mklLinux32Pack; mklLinux64Pack ] } - -let mklWinZipPackage = zipPackage "MathNet.Numerics.MKL.Win" "Math.NET Numerics MKL Native Provider for Windows" mklRelease false -let mklLinuxZipPackage = zipPackage "MathNet.Numerics.MKL.Linux" "Math.NET Numerics MKL Native Provider for Linux" mklRelease false -let mklWinNuGetPackage = nugetPackage "MathNet.Numerics.MKL.Win" mklRelease -let mklWin32NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Win-x86" mklRelease -let mklWin64NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Win-x64" mklRelease -let mklLinuxNuGetPackage = nugetPackage "MathNet.Numerics.MKL.Linux" mklRelease -let mklLinux32NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Linux-x86" mklRelease -let mklLinux64NuGetPackage = nugetPackage "MathNet.Numerics.MKL.Linux-x64" mklRelease - -let mklWinProject = nativeProject "MathNet.Numerics.MKL" "src/NativeProviders/Windows/MKL/MKLWrapper.vcxproj" [mklWinNuGetPackage; mklWin32NuGetPackage; mklWin64NuGetPackage] -let mklLinuxProject = nativeBashScriptProject "MathNet.Numerics.MKL" "src/NativeProviders/Linux/mkl_build.sh" [mklLinuxNuGetPackage; mklLinux32NuGetPackage; mklLinux64NuGetPackage] -let mklSolution = solution "MKL" "MathNet.Numerics.MKL.sln" [mklWinProject; mklLinuxProject] [mklWinZipPackage; mklLinuxZipPackage] +// CUDA NATIVE PROVIDER PACKAGES +let cudaWinZipPackage = zipPackage "MathNet.Numerics.CUDA.Win" "Math.NET Numerics CUDA Native Provider for Windows" cudaRelease false +let cudaWinNuGetPackage = nugetPackage "MathNet.Numerics.CUDA.Win" cudaRelease -// CUDA NATIVE PROVIDER PACKAGES +let cudaWinProject = nativeProject "MathNet.Numerics.CUDA" "src/NativeProviders/Windows/CUDA/CUDAWrapper.vcxproj" [cudaWinNuGetPackage] +let cudaSolution = solution "CUDA" "MathNet.Numerics.CUDA.sln" [cudaWinProject] [cudaWinZipPackage] let cudaWinPack = - { Id = "MathNet.Numerics.CUDA.Win" - Release = cudaRelease + { NuGet = cudaWinNuGetPackage Title = "Math.NET Numerics - CUDA Native Provider for Windows (x64)" Summary = "" Description = "Nvidia CUDA native libraries for Math.NET Numerics." Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native cuda gpu" Authors = [ "Matthew A Johnson"; "Christoph Ruegg" ] - FsLoader = false Dependencies = [] Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.CUDA.Win.targets", None; @@ -190,30 +178,22 @@ let cudaWinPack = @"..\..\out\CUDA\Windows\x64\cusolver64_70.dll", Some "content", None; @"..\..\out\CUDA\Windows\x64\MathNet.Numerics.CUDA.dll", Some "content", None ] } -let cudaWinBundle = - { Id = "MathNet.Numerics.CUDA.Win" - Release = cudaRelease - Title = "Math.NET Numerics CUDA Native Provider for Windows" - Packages = [ cudaWinPack ] } - -let cudaWinZipPackage = zipPackage "MathNet.Numerics.CUDA.Win" "Math.NET Numerics CUDA Native Provider for Windows" cudaRelease false -let cudaWinNuGetPackage = nugetPackage "MathNet.Numerics.CUDA.Win" cudaRelease -let cudaWinProject = nativeProject "MathNet.Numerics.CUDA" "src/NativeProviders/Windows/CUDA/CUDAWrapper.vcxproj" [cudaWinNuGetPackage] -let cudaSolution = solution "CUDA" "MathNet.Numerics.CUDA.sln" [cudaWinProject] [cudaWinZipPackage] +// OpenBLAS NATIVE PROVIDER PACKAGES +let openBlasWinZipPackage = zipPackage "MathNet.Numerics.OpenBLAS.Win" "Math.NET Numerics OpenBLAS Native Provider for Windows" openBlasRelease false +let openBlasWinNuGetPackage = nugetPackage "MathNet.Numerics.OpenBLAS.Win" openBlasRelease -// OpenBLAS NATIVE PROVIDER PACKAGES +let openBlasWinProject = nativeProject "MathNet.Numerics.OpenBLAS" "src/NativeProviders/Windows/OpenBLAS/OpenBLASWrapper.vcxproj" [openBlasWinNuGetPackage] +let openBlasSolution = solution "OpenBLAS" "MathNet.Numerics.OpenBLAS.sln" [openBlasWinProject] [openBlasWinZipPackage] let openBlasWinPack = - { Id = "MathNet.Numerics.OpenBLAS.Win" - Release = openBlasRelease + { NuGet = openBlasWinNuGetPackage Title = "Math.NET Numerics - OpenBLAS Native Provider for Windows (x64 and x86)" Summary = "" Description = "OpenBLAS native libraries for Math.NET Numerics." Tags = "math numeric statistics probability integration interpolation linear algebra matrix fft native openblas" Authors = [ "Kuan Bartel"; "Christoph Ruegg"; "Marcus Cuda" ] - FsLoader = false Dependencies = [] Files = [ @"..\..\build\NativeProvider.targets", Some "build\MathNet.Numerics.OpenBLAS.Win.targets", None; @@ -228,18 +208,6 @@ let openBlasWinPack = @"..\..\out\OpenBLAS\Windows\x86\libquadmath-0.dll", Some @"build\x86", None; @"..\..\out\OpenBLAS\Windows\x86\MathNet.Numerics.OpenBLAS.dll", Some @"build\x86", None ] } -let openBlasWinBundle = - { Id = "MathNet.Numerics.OpenBLAS.Win" - Release = openBlasRelease - Title = "Math.NET Numerics OpenBLAS Native Provider for Windows" - Packages = [ openBlasWinPack ] } - -let openBlasWinZipPackage = zipPackage "MathNet.Numerics.OpenBLAS.Win" "Math.NET Numerics OpenBLAS Native Provider for Windows" openBlasRelease false -let openBlasWinNuGetPackage = nugetPackage "MathNet.Numerics.OpenBLAS.Win" openBlasRelease - -let openBlasWinProject = nativeProject "MathNet.Numerics.OpenBLAS" "src/NativeProviders/Windows/OpenBLAS/OpenBLASWrapper.vcxproj" [openBlasWinNuGetPackage] -let openBlasSolution = solution "OpenBLAS" "MathNet.Numerics.OpenBLAS.sln" [openBlasWinProject] [openBlasWinZipPackage] - // ALL @@ -352,51 +320,43 @@ Target "DataBuild" (fun _ -> ) "Prepare" ==> "DataBuild" -Target "MklWin32Build" (fun _ -> +Target "MklWinBuild" (fun _ -> - //CleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) restore mklSolution buildConfig32 "Release-MKL" !! "MathNet.Numerics.MKL.sln" - - ) -Target "MklWin64Build" (fun _ -> - - //CleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) - restore mklSolution buildConfig64 "Release-MKL" !! "MathNet.Numerics.MKL.sln" + CreateDir mklSolution.OutputZipDir + zip mklWinZipPackage mklSolution.OutputZipDir "out/MKL/Windows" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5md.dll")) + CreateDir mklSolution.OutputNuGetDir + nugetPackManually mklSolution [ mklWinPack; mklWin32Pack; mklWin64Pack ] ) -Target "MklWinBuild" DoNothing -"Prepare" ==> "MklWin32Build" ==> "MklWinBuild" -"Prepare" ==> "MklWin64Build" ==> "MklWinBuild" +"Prepare" ==> "MklWinBuild" -Target "CudaWin64Build" (fun _ -> +Target "CudaWinBuild" (fun _ -> - //CleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) restore cudaSolution buildConfig64 "Release-CUDA" !! "MathNet.Numerics.CUDA.sln" + CreateDir 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 + nugetPackManually cudaSolution [ cudaWinPack ] ) -Target "CudaWinBuild" DoNothing -"Prepare" ==> "CudaWin64Build" ==> "CudaWinBuild" +"Prepare" ==> "CudaWinBuild" -Target "OpenBlasWin32Build" (fun _ -> +Target "OpenBlasWinBuild" (fun _ -> - //CleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) restore openBlasSolution buildConfig32 "Release-OpenBLAS" !! "MathNet.Numerics.OpenBLAS.sln" - - ) -Target "OpenBlasWin64Build" (fun _ -> - - //CleanDirs (!! "src/**/obj/" ++ "src/**/bin/" ) - restore openBlasSolution buildConfig64 "Release-OpenBLAS" !! "MathNet.Numerics.OpenBLAS.sln" + CreateDir 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 + nugetPackManually openBlasSolution [ openBlasWinPack ] ) -Target "OpenBlasWinBuild" DoNothing -"Prepare" ==> "OpenBlasWin32Build" ==> "OpenBlasWinBuild" -"Prepare" ==> "OpenBlasWin64Build" ==> "OpenBlasWinBuild" +"Prepare" ==> "OpenBlasWinBuild" // -------------------------------------------------------------------------------------- @@ -465,61 +425,21 @@ Target "DataTestNET45" (fun _ -> testData "net45") // -------------------------------------------------------------------------------------- -// PACKAGES +// LINUX PACKAGES // -------------------------------------------------------------------------------------- -Target "MklWinPack" DoNothing Target "MklLinuxPack" DoNothing -Target "CudaWinPack" DoNothing -Target "OpenBlasWinPack" DoNothing - - -// ZIP - -Target "MklWinZip" (fun _ -> - CreateDir mklSolution.OutputZipDir - zip mklWinZipPackage mklSolution.OutputZipDir "out/MKL/Windows" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5md.dll"))) -"MklWinBuild" ==> "MklWinZip" ==> "MklWinPack" Target "MklLinuxZip" (fun _ -> CreateDir mklSolution.OutputZipDir zip mklLinuxZipPackage mklSolution.OutputZipDir "out/MKL/Linux" (fun f -> f.Contains("MathNet.Numerics.MKL.") || f.Contains("libiomp5.so"))) -// "MklLinuxBuild" ==> "MklLinuxZip" ==> "MklLinuxPack" "MklLinuxZip" ==> "MklLinuxPack" -Target "CudaWinZip" (fun _ -> - CreateDir 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"))) -"CudaWinBuild" ==> "CudaWinZip" ==> "CudaWinPack" - -Target "OpenBlasWinZip" (fun _ -> - CreateDir 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"))) -"OpenBlasWinBuild" ==> "OpenBlasWinZip" ==> "OpenBlasWinPack" - -// NUGET - -Target "MklWinNuGet" (fun _ -> - CreateDir mklSolution.OutputNuGetDir - nugetPackExtension mklWinBundle mklSolution.OutputNuGetDir) -"MklWinBuild" ==> "MklWinNuGet" ==> "MklWinPack" - Target "MklLinuxNuGet" (fun _ -> CreateDir mklSolution.OutputNuGetDir - nugetPackExtension mklLinuxBundle mklSolution.OutputNuGetDir) -// "MklLinuxBuild" ==> "MklLinuxNuGet" ==> "MklLinuxPack" + nugetPackManually mklSolution [ mklLinuxPack; mklLinux32Pack; mklLinux64Pack ]) "MklLinuxNuGet" ==> "MklLinuxPack" -Target "CudaWinNuGet" (fun _ -> - CreateDir cudaSolution.OutputNuGetDir - nugetPackExtension cudaWinBundle cudaSolution.OutputNuGetDir) -"CudaWinBuild" ==> "CudaWinNuGet" ==> "CudaWinPack" - -Target "OpenBlasWinNuGet" (fun _ -> - CreateDir openBlasSolution.OutputNuGetDir - nugetPackExtension openBlasWinBundle openBlasSolution.OutputNuGetDir) -"OpenBlasWinBuild" ==> "OpenBlasWinNuGet" ==> "OpenBlasWinPack" - // -------------------------------------------------------------------------------------- // Documentation @@ -631,12 +551,12 @@ Target "DataAll" DoNothing Dependencies "DataAll" [ "DataBuild"; "DataTest" ] Target "MklWinAll" DoNothing -Dependencies "MklWinAll" [ "MklWinPack"; "MklTest" ] +Dependencies "MklWinAll" [ "MklWinBuild"; "MklTest" ] Target "CudaWinAll" DoNothing -Dependencies "CudaWinAll" [ "CudaWinPack"; "CudaTest" ] +Dependencies "CudaWinAll" [ "CudaWinBuild"; "CudaTest" ] Target "OpenBlasWinAll" DoNothing -Dependencies "OpenBlasWinAll" [ "OpenBlasWinPack"; "OpenBlasTest" ] +Dependencies "OpenBlasWinAll" [ "OpenBlasWinBuild"; "OpenBlasTest" ] RunTargetOrDefault "Test" diff --git a/build/build-framework.fsx b/build/build-framework.fsx index 3fff3242..ef5ba305 100644 --- a/build/build-framework.fsx +++ b/build/build-framework.fsx @@ -147,24 +147,16 @@ type Solution = OutputZipDir: string OutputNuGetDir: string } -type Package = - { Id: string - Release: Release +type NuGetSpecification = + { NuGet: NuGetPackage Title: string Summary: string Description: string Tags: string - FsLoader: bool Authors: string list Dependencies: NugetFrameworkDependencies list Files: (string * string option * string option) list } -type Bundle = - { Id: string - Release: Release - Title: string - Packages: Package list } - let release title releaseNotesFile : Release = let info = LoadReleaseNotes releaseNotesFile @@ -395,24 +387,6 @@ let provideFsIfSharpLoader path = let startIndex = fullScript |> Seq.findIndex (fun s -> s.Contains "***MathNet.Numerics.IfSharp.fsx***") ReplaceFile (path "MathNet.Numerics.IfSharp.fsx") (fullScript .[startIndex + 1 ..] |> toLines) -let provideZipExtraFiles (package:ZipPackage) path = - provideLicense path - provideReadme (sprintf "%s v%s" package.Title package.Release.PackageVersion) package.Release path - if package.FsLoader then - let includes = [ for root in [ ""; "../"; "../../" ] -> sprintf "#I \"%sNet40\"" root ] - provideFsLoader includes path - provideFsIfSharpLoader path - -let provideNuGetExtraFiles path (bundle:Bundle) (pack:Package) = - provideLicense path - provideReadme (sprintf "%s v%s" pack.Title pack.Release.PackageVersion) bundle.Release path - if pack.FsLoader then - let includes = [ for root in [ ""; "../"; "../../"; "../../../" ] do - for package in bundle.Packages do - yield sprintf "#I \"%spackages/%s/lib/net40/\"" root package.Id - yield sprintf "#I \"%spackages/%s.%s/lib/net40/\"" root package.Id package.Release.PackageVersion ] - provideFsLoader includes path - provideFsIfSharpLoader path // SIGN @@ -450,19 +424,25 @@ let zip (package:ZipPackage) zipDir filesDir filesFilter = CleanDir "obj/Zip" let workPath = "obj/Zip/" + package.Id CopyDir workPath filesDir filesFilter - provideZipExtraFiles package workPath + provideLicense workPath + provideReadme (sprintf "%s v%s" package.Title package.Release.PackageVersion) package.Release workPath + if package.FsLoader then + let includes = [ for root in [ ""; "../"; "../../" ] -> sprintf "#I \"%sNet40\"" root ] + provideFsLoader includes workPath + provideFsIfSharpLoader workPath Zip "obj/Zip/" (zipDir sprintf "%s-%s.zip" package.Id package.Release.PackageVersion) !! (workPath + "/**/*.*") DeleteDir "obj/Zip" + // NUGET -let updateNuspec (pack:Package) outPath symbols updateFiles spec = +let updateNuspec (nuget:NuGetPackage) (pack:NuGetSpecification) outPath symbols updateFiles spec = { spec with ToolPath = "packages/build/NuGet.CommandLine/tools/NuGet.exe" OutputPath = outPath WorkingDir = "obj/NuGet" - Version = pack.Release.PackageVersion - ReleaseNotes = pack.Release.ReleaseNotes - Project = pack.Id + Version = nuget.Release.PackageVersion + ReleaseNotes = nuget.Release.ReleaseNotes + Project = nuget.Id Title = pack.Title Summary = pack.Summary Description = pack.Description @@ -473,28 +453,13 @@ let updateNuspec (pack:Package) outPath symbols updateFiles spec = Files = updateFiles pack.Files Publish = false } -let nugetPack (bundle:Bundle) outPath = - CleanDir "obj/NuGet" - for pack in bundle.Packages do - provideNuGetExtraFiles "obj/NuGet" bundle pack - let withLicenseReadme f = [ "license.txt", None, None; "readme.txt", None, None; ] @ f - let withoutSymbolsSources f = - List.choose (function | (_, Some (target:string), _) when target.StartsWith("src") -> None - | (s, t, None) -> Some (s, t, Some ("**/*.pdb")) - | (s, t, Some e) -> Some (s, t, Some (e + ";**/*.pdb"))) f - // first pass - generates symbol + normal package. NuGet does drop the symbols from the normal package, but unfortunately not the sources. - // NuGet (updateNuspec pack outPath NugetSymbolPackage.Nuspec withLicenseReadme) "build/MathNet.Numerics.nuspec" - // second pass - generate only normal package, again, but this time explicitly drop the sources (and the debug symbols) - NuGet (updateNuspec pack outPath NugetSymbolPackage.None (withLicenseReadme >> withoutSymbolsSources)) "build/MathNet.Numerics.nuspec" - CleanDir "obj/NuGet" - DeleteDir "obj/NuGet" - -let nugetPackExtension (bundle:Bundle) outPath = +let nugetPackManually (solution:Solution) (packages:NuGetSpecification list) = CleanDir "obj/NuGet" - for pack in bundle.Packages do - provideNuGetExtraFiles "obj/NuGet" bundle pack + for pack in packages do + provideLicense "obj/NuGet" + provideReadme (sprintf "%s v%s" pack.Title pack.NuGet.Release.PackageVersion) pack.NuGet.Release "obj/NuGet" let withLicenseReadme f = [ "license.txt", None, None; "readme.txt", None, None; ] @ f - NuGet (updateNuspec pack outPath NugetSymbolPackage.None withLicenseReadme) "build/MathNet.Numerics.Extension.nuspec" + NuGet (updateNuspec pack.NuGet pack solution.OutputNuGetDir NugetSymbolPackage.None withLicenseReadme) "build/MathNet.Numerics.Extension.nuspec" CleanDir "obj/NuGet" DeleteDir "obj/NuGet"