diff --git a/README.md b/README.md index 2aedca26..c78372c4 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ with MsBuild or with FAKE. MsBuild/XBuild: + restore.cmd (or restore.sh) msbuild MathNet.Numerics.sln FAKE: diff --git a/docs/content/Build.md b/docs/content/Build.md index 72d00a2a..f05306d4 100644 --- a/docs/content/Build.md +++ b/docs/content/Build.md @@ -8,16 +8,21 @@ manually with the build scripts. VisualStudio or Xamarin Studio ------------------------------ -The Visual Studio solutions should build out of the box, without any preparation -steps or package restores. Tests can be run with the usual integrated NUnit test -runners or ReSharper. +We clearly separate dependency management from the IDE, you should therefore +run `build.cmd` or `build.sh` once after every git checkout in order to restore +the dependencies exactly as defined. Otherwise Visual Studio and other IDEs +may fail to compile or provide correct IntelliSense. + +Tests can be run with the usual integrated NUnit test runners or ReSharper. MSBuild or XBuild ----------------- Instead of a compatible IDE you can also build the solutions directly with -`msbuild`, or on Mono with `xbuild`. +`msbuild`, or on Mono with `xbuild`. You may need to run `restore.cmd` or +`restore.sh` before, once after every git checkout in order to restore the dependencies. + restore.cmd (or restore.sh) # restore dependencies (once) msbuild MathNet.Numerics.sln # only build for .Net 4 (main solution) msbuild MathNet.Numerics.Net35Only.sln # only build for .Net 3.5 msbuild MathNet.Numerics.All.sln # full build with .Net 4, 3.5 and PCL profiles diff --git a/restore.cmd b/restore.cmd new file mode 100644 index 00000000..27160893 --- /dev/null +++ b/restore.cmd @@ -0,0 +1,12 @@ +@echo off +cls + +.paket\paket.bootstrapper.exe +if errorlevel 1 ( + exit /b %errorlevel% +) + +.paket\paket.exe restore +if errorlevel 1 ( + exit /b %errorlevel% +) diff --git a/restore.sh b/restore.sh new file mode 100644 index 00000000..88477ccd --- /dev/null +++ b/restore.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +cd `dirname $0` + +FSIARGS="" +OS=${OS:-"unknown"} +if [[ "$OS" != "Windows_NT" ]] +then + FSIARGS="--fsiargs -d:MONO" +fi + +function run() { + if [[ "$OS" != "Windows_NT" ]] + then + mono "$@" + else + "$@" + fi +} + +if [[ "$OS" != "Windows_NT" ]] && [ ! -e ~/.config/.mono/certs ] +then + mozroots --import --sync --quiet +fi + +run .paket/paket.bootstrapper.exe +run .paket/paket.exe restore