@@ -0,0 +1,154 @@
3+# TODO: (1) Detect if nix is available otherwise run with plain cabal,
4+# (2) Detect the platform and run tests applicable to the platform, (3)
5+# add a test for windows/msys
7+SCRIPT_DIR=$(cd `dirname $0`; pwd)
8+source $SCRIPT_DIR/build-lib.sh
10+#------------------------------------------------------------------------------
12+#------------------------------------------------------------------------------
14+# build-all, Werror, test, inspection, fusion-plugin. Note, inspection
15+# requires fusion-plugin.
19+ --argstr compiler "ghc8101" \
20+ --argstr c2nix "--flag inspection" \
24+ CABAL_DISABLE_DEPS=y \
25+ CABAL_CHECK_RELAX=y \
26+ DISABLE_SDIST_BUILD=y \
27+ CABAL_PROJECT=cabal.project.ci \
28+ CABAL_BUILD_OPTIONS=\"--flag inspection --flag fusion-plugin\""
31+#------------------------------------------------------------------------------
33+#------------------------------------------------------------------------------
35+# XXX avoid rebuilding if nothing has changed in the source
36+# XXX run hlint only on changed files
39+ HLINT_OPTIONS="lint --cpp-include=src --cpp-include=test" \
40+ HLINT_TARGETS="src test benchmark"
43+#------------------------------------------------------------------------------
45+#------------------------------------------------------------------------------
49+ --argstr compiler "ghc8101" \
50+ --run "bin/test.sh --coverage"
53+# To upload the results to coveralls.io using hpc-coveralls
54+# hpc-coveralls --repo-token="$REPO_TOKEN" --coverage-mode=StrictlyFullLines
56+#------------------------------------------------------------------------------
58+#------------------------------------------------------------------------------
60+# chart builds from the nix cache for 8.8, 8.10 requires building
61+# XXX Use a separate build-dir for this
62+# build-all only, throw in most flags except fusion-plugin, inspection, opt
65+ --argstr compiler "ghc883" \
66+ --argstr c2nix "--flag dev" \
70+ CABAL_DISABLE_DEPS=y \
71+ CABAL_CHECK_RELAX=y \
72+ DISABLE_SDIST_BUILD=y \
76+ CABAL_BUILD_OPTIONS=\"--flag streamk --flag debug --flag use-c-malloc --flag dev\""
84+ --argstr compiler "ghc$1" \
88+ CABAL_DISABLE_DEPS=y \
89+ CABAL_CHECK_RELAX=y \
90+ DISABLE_SDIST_BUILD=y \
95+ghc883 () { ghc 883 8.8.3; }
96+ghc865 () { ghc 865 8.6.5; }
97+ghc844 () { ghc 865 8.4.4; }
99+#------------------------------------------------------------------------------
101+#------------------------------------------------------------------------------
104+# --argstr compiler "ghcjs" \
106+# packcheck cabal-v2 \
108+# CABAL_DISABLE_DEPS=y \
109+# CABAL_CHECK_RELAX=y \
110+# DISABLE_SDIST_BUILD=y \
113+# ENABLE_GHCJS=y " || exit 1
115+#-----------------------------------------------------------------------------
117+#-----------------------------------------------------------------------------
122+ -h|--help|help) print_help ;;
123+ # options with arguments
124+ --targets) shift; TARGETS=$1; shift ;;
126+ -*|--*) echo "Unknown flags: $*"; echo; print_help ;;
131+ALL_TARGETS="all basic hlint coverage flags ghc883 ghc864 ghc844"
133+if test "$(has_item "$TARGETS" help)" = "help"
135+ echo "Available targets: $ALL_TARGETS"
139+if test "$(has_item "$TARGETS" help)" = "all"
141+ TARGETS="$ALL_TARGETS"
144+if test -z "$TARGETS"
146+ echo "Usage: $0 --targets <space separated target names>"
147+ echo "Available targets: $ALL_TARGETS"
153+ $i || { echo "$i failed."; exit 1; }