mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
tools: dev setup/test updates
This commit is contained in:
parent
2d6b2008f5
commit
6bf599ae9e
45
Makefile
45
Makefile
@ -154,16 +154,31 @@ TIME:=$(shell date +"%Y%m%d%H%M")
|
||||
defaulttarget: bin/hledgerdev
|
||||
|
||||
######################################################################
|
||||
# BUILDING
|
||||
# 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.
|
||||
|
||||
EXTRAINSTALLARGS=
|
||||
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
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
|
||||
@ -367,6 +388,10 @@ check:
|
||||
packdeps:
|
||||
for p in $(PACKAGES); do packdeps $$p/$$p.cabal; done
|
||||
|
||||
######################################################################
|
||||
# DOCUMENTATION
|
||||
|
||||
|
||||
######################################################################
|
||||
# RELEASING
|
||||
|
||||
@ -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)
|
||||
|
@ -1,5 +0,0 @@
|
||||
# hledger-lib's cabal dependencies are installed
|
||||
cabal install ./hledger-lib --only-dep --dry || echo HINT: cabal install ./hledger-lib --only-dep
|
||||
>>> /All the requested packages are already installed/
|
||||
>>>2
|
||||
>>>= 0
|
@ -1,5 +0,0 @@
|
||||
# hledger's cabal dependencies are installed
|
||||
cabal install ./hledger --only-dep --dry || echo HINT: cabal install ./hledger-lib
|
||||
>>> /All the requested packages are already installed/
|
||||
>>>2
|
||||
>>>= 0
|
@ -1,5 +0,0 @@
|
||||
# hledger-lib's cabal dependencies are installed
|
||||
cabal install ./hledger-web --only-dep --dry || echo HINT: cabal install ./hledger
|
||||
>>> /All the requested packages are already installed/
|
||||
>>>2
|
||||
>>>= 0
|
@ -1,4 +1,4 @@
|
||||
# hledger+hledger-lib GHCI prompt works
|
||||
echo :q | make ghci | tail
|
||||
>>> /Ok, modules loaded: Hledger, /
|
||||
>>> /Ok, modules loaded/
|
||||
>>>= 0
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user