Sha256: f3b79193a707b697e46ed3e1fc1aa01b680e39171c6be1cdc04e55c378632433
Contents?: true
Size: 1.18 KB
Versions: 91
Compression:
Stored size: 1.18 KB
Contents
#!/bin/sh if [ $# -eq 0 ]; then echo "usage: $0 /path/to/exercise" exit 1 fi exercisedir=$(cd "$1" && pwd) exercisename=$(basename "$exercisedir") examplename="stub" xhaskell=$(cd "$(dirname "$0")/.." && pwd) # We would ideally use a tmpdir here, # but stack will invalidate its cache if the path changes, # so the best alternative seems to be to put it in xhaskell. buildfolder="${xhaskell}/build/${exercisename}/${examplename}" mkdir -p "${buildfolder}" cleanup() { rm -r "${xhaskell}/build" } trap cleanup EXIT INT TERM cp -R -L ${exercisedir}/stack.yaml ${exercisedir}/package.yaml ${exercisedir}/src ${exercisedir}/test "${buildfolder}" cd $buildfolder if [ -n "$TRAVIS" ]; then cachedir="$HOME" else cachedir="$xhaskell" fi examplecache="${cachedir}/.foldercache/${exercisename}/${examplename}/.stack-work" mkdir -p "$examplecache" ln -f -s "$examplecache" # SET_RESOLVER passed by .travis.yml - sets --resolver if not current. if [ -f "${exercisedir}/.meta/DONT-TEST-STUB" ]; then echo "only building stub" stack build ${SET_RESOLVER} --install-ghc --no-terminal else echo "testing stub" stack test ${SET_RESOLVER} --install-ghc --no-terminal --no-run-tests fi
Version data entries
91 entries across 91 versions & 1 rubygems