From d0d287cc28eaa07adf3392b46be8ccf9c6d4d8ef Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Thu, 28 Aug 2014 21:14:10 +0200 Subject: [PATCH] Build: unify build.sh and buildn.sh build.sh now checks the OS and supports Bash on Windows as well. buildn.sh is therefore no longer needed. See also fsprojects/ProjectScaffold#76 --- README.md | 5 ++--- build.sh | 12 +++++++++--- buildn.sh | 5 ----- docs/content/index.fsx | 5 ++--- 4 files changed, 13 insertions(+), 14 deletions(-) delete mode 100644 buildn.sh diff --git a/README.md b/README.md index acee302a..e6d29375 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,8 @@ 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 - ./buildn.sh # normal build (.Net 4.0), run unit tests - bash on Windows (.Net instead of mono) + build.cmd # normal build (.Net 4.0), run unit tests (.Net on Windows) + ./build.sh # normal build (.Net 4.0), run unit tests (Mono on Linux/Mac, .Net on Windows) build.cmd Build # normal build (.Net 4.0) build.cmd Build incremental # normal build, incremental (.Net 4.0) diff --git a/build.sh b/build.sh index c24b3d8f..d0168af9 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,11 @@ #!/bin/bash -if [ ! -f packages/FAKE/tools/FAKE.exe ]; then - mono --runtime=v4.0 tools/NuGet/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion +if test "$OS" = "Windows_NT" +then + # use .Net + [ ! -f packages/FAKE/tools/FAKE.exe ] && tools/NuGet/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion + packages/FAKE/tools/FAKE.exe build.fsx $@ +else + # use mono + [ ! -f packages/FAKE/tools/FAKE.exe ] && mono --runtime=v4.0 tools/NuGet/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion + mono --runtime=v4.0 packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx fi -mono --runtime=v4.0 packages/FAKE/tools/FAKE.exe build.fsx $@ diff --git a/buildn.sh b/buildn.sh deleted file mode 100644 index 366b8154..00000000 --- a/buildn.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [ ! -f packages/FAKE/tools/FAKE.exe ]; then - tools/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 62351d71..54b010d8 100644 --- a/docs/content/index.fsx +++ b/docs/content/index.fsx @@ -216,9 +216,8 @@ 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 - ./buildn.sh # normal build (.Net 4.0), run unit tests - bash on Windows (.Net instead of mono) + build.cmd # normal build (.Net 4.0), run unit tests (.Net on Windows) + ./build.sh # normal build (.Net 4.0), run unit tests (Mono on Linux/Mac, .Net on Windows) build.cmd Build # normal build (.Net 4.0) build.cmd Build incremental # normal build, incremental (.Net 4.0)