From 503e297afb1482c5251f326344f45ecec306a3db Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sun, 1 Jun 2014 15:19:04 +0200 Subject: [PATCH] Build: publish docs and api reference; buildn.sh for bash with .net (instead of mono) --- README.md | 5 +++-- build.fsx | 30 ++++++++++++++++++++++++++---- buildn.sh | 5 +++++ docs/content/index.fsx | 5 +++-- 4 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 buildn.sh diff --git a/README.md b/README.md index 776c9404..c23eb208 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,9 @@ If you do not want to use the official binaries, or if you like to modify, debug ### How to build with FAKE - build.cmd # normal build (.Net 4.0), run unit tests - ./build.sh # normal build (.Net 4.0), run unit tests - on Linux or Mac + build.cmd # normal build (.Net 4.0), run unit tests + ./build.sh # normal build (.Net 4.0), run unit tests - on Linux or Mac + ./buildn.sh # normal build (.Net 4.0), run unit tests - bash on Windows (.Net instead of mono) build.cmd Build # normal build (.Net 4.0) build.cmd Build incremental # normal build, incremental (.Net 4.0) diff --git a/build.fsx b/build.fsx index f406260b..4f61727a 100644 --- a/build.fsx +++ b/build.fsx @@ -9,7 +9,6 @@ open Fake open Fake.DocuHelper open Fake.AssemblyInfoFile open Fake.ReleaseNotesHelper -open Fake.Git open System Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ @@ -287,12 +286,35 @@ Target "PublishTag" (fun _ -> // create tag with release notes let tagName = "v" + packageVersion let cmd = sprintf """tag -a %s -m "%s" """ tagName releaseNotes - CommandHelper.runSimpleGitCommand "." cmd |> printfn "%s" + Git.CommandHelper.runSimpleGitCommand "." cmd |> printfn "%s" // push tag - let _, remotes, _ = CommandHelper.runGitCommand "." "remote -v" + let _, remotes, _ = Git.CommandHelper.runGitCommand "." "remote -v" let main = remotes |> Seq.find (fun s -> s.Contains("(push)") && s.Contains("mathnet/mathnet-numerics")) let remoteName = main.Split('\t').[0] - Branches.pushTag "." remoteName tagName) + Git.Branches.pushTag "." remoteName tagName) + +Target "PublishDocs" (fun _ -> + let repo = "../mathnet-websites" + Git.Branches.pull repo "origin" "master" + CleanDir "../mathnet-websites/numerics/docs" + CopyRecursive "out/docs" "../mathnet-websites/numerics/docs" true |> printfn "%A" + Git.Staging.StageAll repo + Git.Commit.Commit repo (sprintf "Numerics: %s docs update" packageVersion) + Git.Branches.pushBranch repo "origin" "master") + +Target "PublishApi" (fun _ -> + let repo = "../mathnet-websites" + Git.Branches.pull repo "origin" "master" + CleanDir "../mathnet-websites/api-numerics" + CopyRecursive "out/api" "../mathnet-websites/api-numerics" true |> printfn "%A" + Git.Staging.StageAll repo + Git.Commit.Commit repo (sprintf "Numerics: %s api update" packageVersion) + Git.Branches.pushBranch repo "origin" "master") + +Target "Publish" DoNothing +"PublishTag" ==> "Publish" +"PublishDocs" ==> "Publish" +"PublishApi" ==> "Publish" // RUN diff --git a/buildn.sh b/buildn.sh new file mode 100644 index 00000000..a04d39fd --- /dev/null +++ b/buildn.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if [ ! -f packages/FAKE/tools/FAKE.exe ]; then + .nuget/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion +fi +packages/FAKE/tools/FAKE.exe build.fsx $@ diff --git a/docs/content/index.fsx b/docs/content/index.fsx index c26ac6f7..37f01e04 100644 --- a/docs/content/index.fsx +++ b/docs/content/index.fsx @@ -201,8 +201,9 @@ If you do not want to use the official binaries, or if you like to modify, debug ### How to build with FAKE [lang=sh] - build.cmd # normal build (.Net 4.0), run unit tests - ./build.sh # normal build (.Net 4.0), run unit tests - on Linux or Mac + build.cmd # normal build (.Net 4.0), run unit tests + ./build.sh # normal build (.Net 4.0), run unit tests - on Linux or Mac + ./buildn.sh # normal build (.Net 4.0), run unit tests - bash on Windows (.Net instead of mono) build.cmd Build # normal build (.Net 4.0) build.cmd Build incremental # normal build, incremental (.Net 4.0)