Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tools: dev setup/test updates
  • Loading branch information
simonmichael committed Aug 14, 2014
1 parent 2d6b200 commit 6bf599a
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 29 deletions.
47 changes: 36 additions & 11 deletions Makefile
Expand Up @@ -154,16 +154,31 @@ TIME:=$(shell date +"%Y%m%d%H%M")
defaulttarget: bin/hledgerdev

######################################################################
# BUILDING

EXTRAINSTALLARGS=
# SETUP
# work in progress
# Some rules use a sandbox, some don't, ideally we'll handle both cases.
# Initial dev setup involves:
# initialising a sandbox, probably
# cabal update, perhaps
# cabal clean in hledger packages, perhaps
# cabal install dependencies for hledger packages
# cabal install hledger-lib and hledger, perhaps hledger-web
# at least start cabal build in hledger packages, to make cabal include files (dist/build/{Paths_PKG.hs,cabal_macros.h}) (not working with a sandbox)
# When done we should be able to make install, repl-{lib,cli,web}, ghci[-web], check etc.

sandbox: .cabal-sandbox

.cabal-sandbox:
cabal sandbox init
cabal sandbox add-source ./hledger-lib ./hledger ./hledger-web

# cabal install the main hledger packages and all their dependencies
# in the sandbox if any, otherwise in the user's package db
install:
$(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests

# cabal install the main hledger packages and all their dependencies, more forcibly
# (may break installed libs, requiring ghc-pkg-clean)
# cabal install the main hledger packages and all their dependencies more forcibly
# (can break installed libs, requiring ghc-pkg-clean)
install-force:
$(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests --allow-newer --force-reinstalls

Expand All @@ -184,6 +199,14 @@ allcabal%:
# all%:
# for p in $(PACKAGES); do (echo doing $* in $$p; cd $$p; $*); done

Reset:
cabal sandbox delete

######################################################################
# BUILDING

EXTRAINSTALLARGS=

# auto-recompile and run (something, eg --help or unit tests) whenever a module changes

auto: auto---version
Expand Down Expand Up @@ -353,12 +376,10 @@ tools/generatejournal: tools/generatejournal.hs
# TESTING

# developer environment checks
######################################################################
# DOCUMENTATION

check:
@echo sanity-check developer environment:
@($(SHELLTEST) checks -- --threads=8 \
@($(SHELLTEST) checks -- \
&& echo $@ PASSED) || echo $@ FAILED


Expand All @@ -367,6 +388,10 @@ check:
packdeps:
for p in $(PACKAGES); do packdeps $$p/$$p.cabal; done

######################################################################
# DOCUMENTATION


######################################################################
# RELEASING

Expand Down Expand Up @@ -576,10 +601,10 @@ viewcoverage:

# get a debug prompt
ghci:
$(GHCI) $(WARNINGS) $(INCLUDEPATHS) $(MAIN)
cabal exec $(GHCI) -- $(WARNINGS) $(INCLUDEPATHS) $(MAIN)

ghciweb:
$(GHCI) $(BUILDFLAGS) $(WEBLANGEXTS) hledger-web/app/main.hs
ghci-web:
cabal exec $(GHCI) -- $(BUILDFLAGS) $(WEBLANGEXTS) hledger-web/app/main.hs

repl-lib:
(cd hledger-lib; cabal repl)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions checks/31-hledger-lib-cabal-deps-installed.test

This file was deleted.

5 changes: 0 additions & 5 deletions checks/32-hledger-cli-cabal-deps-installed.test

This file was deleted.

5 changes: 0 additions & 5 deletions checks/33-hledger-web-cabal-deps-installed.test

This file was deleted.

2 changes: 1 addition & 1 deletion checks/51-make-ghci.test
@@ -1,4 +1,4 @@
# hledger+hledger-lib GHCI prompt works
echo :q | make ghci | tail
>>> /Ok, modules loaded: Hledger, /
>>> /Ok, modules loaded/
>>>= 0
4 changes: 2 additions & 2 deletions checks/52-make-ghci-web.test
@@ -1,4 +1,4 @@
# hledger-web+hledger+hledger-lib GHCI prompt works
echo :q | make ghciweb | tail
>>> /Ok, modules loaded: Settings, Main, /
echo :q | make ghci-web | tail
>>> /Ok, modules loaded/
>>>= 0

0 comments on commit 6bf599a

Please sign in to comment.