Browse Source

Build: better framework support for multiple solutions

pull/612/head
Christoph Ruegg 8 years ago
parent
commit
0105d62a26
  1. 32
      build.fsx
  2. 16
      build/build-framework.fsx

32
build.fsx

@ -222,7 +222,7 @@ Target "Build" (fun _ ->
collectNuGetPackages numericsSolution collectNuGetPackages numericsSolution
// NuGet Sign (all or nothing) // NuGet Sign (all or nothing)
if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver numericsSolution if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [numericsSolution]
) )
"Prepare" ==> "Build" "Prepare" ==> "Build"
@ -255,7 +255,7 @@ Target "DataBuild" (fun _ ->
collectNuGetPackages dataSolution collectNuGetPackages dataSolution
// NuGet Sign (all or nothing) // NuGet Sign (all or nothing)
if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver dataSolution if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [dataSolution]
) )
"Prepare" ==> "DataBuild" "Prepare" ==> "DataBuild"
@ -271,7 +271,7 @@ Target "MklWinBuild" (fun _ ->
nugetPackManually mklSolution [ mklWinPack; mklWin32Pack; mklWin64Pack ] nugetPackManually mklSolution [ mklWinPack; mklWin32Pack; mklWin64Pack ]
// NuGet Sign (all or nothing) // NuGet Sign (all or nothing)
if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver mklSolution if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [mklSolution]
) )
"Prepare" ==> "MklWinBuild" "Prepare" ==> "MklWinBuild"
@ -286,7 +286,7 @@ Target "CudaWinBuild" (fun _ ->
nugetPackManually cudaSolution [ cudaWinPack ] nugetPackManually cudaSolution [ cudaWinPack ]
// NuGet Sign (all or nothing) // NuGet Sign (all or nothing)
if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver cudaSolution if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [cudaSolution]
) )
"Prepare" ==> "CudaWinBuild" "Prepare" ==> "CudaWinBuild"
@ -302,7 +302,7 @@ Target "OpenBlasWinBuild" (fun _ ->
nugetPackManually openBlasSolution [ openBlasWinPack ] nugetPackManually openBlasSolution [ openBlasWinPack ]
// NuGet Sign (all or nothing) // NuGet Sign (all or nothing)
if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver openBlasSolution if isWindows && hasBuildParam "sign" then signNuGet fingerprint timeserver [openBlasSolution]
) )
"Prepare" ==> "OpenBlasWinBuild" "Prepare" ==> "OpenBlasWinBuild"
@ -455,17 +455,17 @@ 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 numericsSolution) Target "PublishArchive" (fun _ -> publishArchives [numericsSolution])
Target "DataPublishArchive" (fun _ -> publishArchive dataSolution) Target "DataPublishArchive" (fun _ -> publishArchives [dataSolution])
Target "MklPublishArchive" (fun _ -> publishArchive mklSolution) Target "MklPublishArchive" (fun _ -> publishArchives [mklSolution])
Target "CudaPublishArchive" (fun _ -> publishArchive cudaSolution) Target "CudaPublishArchive" (fun _ -> publishArchives [cudaSolution])
Target "OpenBlasPublishArchive" (fun _ -> publishArchive openBlasSolution) Target "OpenBlasPublishArchive" (fun _ -> publishArchives [openBlasSolution])
Target "PublishNuGet" (fun _ -> publishNuGet !! (numericsSolution.OutputNuGetDir </> "*.nupkg")) Target "PublishNuGet" (fun _ -> publishNuGet [numericsSolution])
Target "DataPublishNuGet" (fun _ -> publishNuGet !! (dataSolution.OutputNuGetDir </> "*.nupkg")) Target "DataPublishNuGet" (fun _ -> publishNuGet [dataSolution])
Target "MklPublishNuGet" (fun _ -> publishNuGet !! (mklSolution.OutputNuGetDir </> "*.nupkg")) Target "MklPublishNuGet" (fun _ -> publishNuGet [mklSolution])
Target "CudaPublishNuGet" (fun _ -> publishNuGet !! (cudaSolution.OutputNuGetDir </> "*.nupkg")) Target "CudaPublishNuGet" (fun _ -> publishNuGet [cudaSolution])
Target "OpenBlasPublishNuGet" (fun _ -> publishNuGet !! (openBlasSolution.OutputNuGetDir </> "*.nupkg")) Target "OpenBlasPublishNuGet" (fun _ -> publishNuGet [openBlasSolution])
Target "Publish" DoNothing Target "Publish" DoNothing
Dependencies "Publish" [ "PublishTag"; "PublishDocs"; "PublishApi"; "PublishArchive"; "PublishNuGet" ] Dependencies "Publish" [ "PublishTag"; "PublishDocs"; "PublishApi"; "PublishArchive"; "PublishNuGet" ]

16
build/build-framework.fsx

@ -383,9 +383,11 @@ let sign fingerprint timeserver (solution: Solution) =
if result <> 0 then if result <> 0 then
failwithf "Error during SignTool call " failwithf "Error during SignTool call "
let signNuGet fingerprint timeserver (solution: Solution) = let signNuGet fingerprint timeserver (solutions: Solution list) =
CleanDir "obj/NuGet" CleanDir "obj/NuGet"
!! (solution.OutputNuGetDir </> "*.nupkg") solutions
|> Seq.collect (fun solution -> !! (solution.OutputNuGetDir </> "*.nupkg"))
|> Seq.distinct
|> Seq.iter (fun file -> |> Seq.iter (fun file ->
let args = sprintf """sign "%s" -HashAlgorithm SHA256 -TimestampHashAlgorithm SHA256 -CertificateFingerprint "%s" -Timestamper "%s""" (FullName file) fingerprint timeserver let args = sprintf """sign "%s" -HashAlgorithm SHA256 -TimestampHashAlgorithm SHA256 -CertificateFingerprint "%s" -Timestamper "%s""" (FullName file) fingerprint timeserver
let result = let result =
@ -501,8 +503,7 @@ let publishReleaseTag title prefix (release:Release) =
let remoteName = main.Split('\t').[0] let remoteName = main.Split('\t').[0]
Git.Branches.pushTag "." remoteName tagName Git.Branches.pushTag "." remoteName tagName
let publishNuGet packageFiles = let publishNuGet (solutions: Solution list) =
// TODO: Migrate to NuGet helper once it supports direct (non-integrated) operations
CleanDir "obj/NuGet" CleanDir "obj/NuGet"
let rec impl trials (file:string) = let rec impl trials (file:string) =
trace ("NuGet Push: " + System.IO.Path.GetFileName(file) + ".") trace ("NuGet Push: " + System.IO.Path.GetFileName(file) + ".")
@ -517,7 +518,10 @@ let publishNuGet packageFiles =
with exn -> with exn ->
if trials > 0 then impl (trials-1) file if trials > 0 then impl (trials-1) file
else () else ()
Seq.iter (impl 3) packageFiles solutions
|> Seq.collect (fun solution -> !! (solution.OutputNuGetDir </> "*.nupkg"))
|> Seq.distinct
|> Seq.iter (impl 3)
DeleteDir "obj/NuGet" DeleteDir "obj/NuGet"
let publishMirrors () = let publishMirrors () =
@ -576,3 +580,5 @@ let publishArchive (solution:Solution) =
let zipPackages = solution.ZipPackages let zipPackages = solution.ZipPackages
let nugetPackages = solution.Projects |> List.collect projectNuGetPackages |> List.distinct let nugetPackages = solution.Projects |> List.collect projectNuGetPackages |> List.distinct
publishArchiveManual zipOutPath nugetOutPath zipPackages nugetPackages publishArchiveManual zipOutPath nugetOutPath zipPackages nugetPackages
let publishArchives (solutions: Solution list) = solutions |> List.iter publishArchive

Loading…
Cancel
Save