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 | 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
 | # cabal install the main hledger packages and all their dependencies
 | ||||||
|  | # in the sandbox if any, otherwise in the user's package db
 | ||||||
| install: | install: | ||||||
| 	$(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests | 	$(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests | ||||||
| 
 | 
 | ||||||
| # cabal install the main hledger packages and all their dependencies, more forcibly
 | # cabal install the main hledger packages and all their dependencies more forcibly
 | ||||||
| # (may break installed libs, requiring ghc-pkg-clean)
 | # (can break installed libs, requiring ghc-pkg-clean)
 | ||||||
| install-force: | install-force: | ||||||
| 	$(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests --allow-newer --force-reinstalls | 	$(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests --allow-newer --force-reinstalls | ||||||
| 
 | 
 | ||||||
| @ -184,6 +199,14 @@ allcabal%: | |||||||
| # all%:
 | # all%:
 | ||||||
| # 	for p in $(PACKAGES); do (echo doing $* in $$p; cd $$p; $*); done
 | # 	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-recompile and run (something, eg --help or unit tests) whenever a module changes
 | ||||||
| 
 | 
 | ||||||
| auto: auto---version | auto: auto---version | ||||||
| @ -353,12 +376,10 @@ tools/generatejournal: tools/generatejournal.hs | |||||||
| # TESTING
 | # TESTING
 | ||||||
| 
 | 
 | ||||||
| # developer environment checks
 | # developer environment checks
 | ||||||
| ######################################################################
 |  | ||||||
| # DOCUMENTATION
 |  | ||||||
| 
 | 
 | ||||||
| check: | check: | ||||||
| 	@echo sanity-check developer environment: | 	@echo sanity-check developer environment: | ||||||
| 	@($(SHELLTEST) checks -- --threads=8 \
 | 	@($(SHELLTEST) checks -- \
 | ||||||
| 		&& echo $@ PASSED) || echo $@ FAILED | 		&& echo $@ PASSED) || echo $@ FAILED | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -367,6 +388,10 @@ check: | |||||||
| packdeps: | packdeps: | ||||||
| 	for p in $(PACKAGES); do packdeps $$p/$$p.cabal; done | 	for p in $(PACKAGES); do packdeps $$p/$$p.cabal; done | ||||||
| 
 | 
 | ||||||
|  | ######################################################################
 | ||||||
|  | # DOCUMENTATION
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| ######################################################################
 | ######################################################################
 | ||||||
| # RELEASING
 | # RELEASING
 | ||||||
| 
 | 
 | ||||||
| @ -576,10 +601,10 @@ viewcoverage: | |||||||
| 
 | 
 | ||||||
| # get a debug prompt
 | # get a debug prompt
 | ||||||
| ghci: | ghci: | ||||||
| 	$(GHCI) $(WARNINGS) $(INCLUDEPATHS) $(MAIN) | 	cabal exec $(GHCI) -- $(WARNINGS) $(INCLUDEPATHS) $(MAIN) | ||||||
| 
 | 
 | ||||||
| ghciweb: | ghci-web: | ||||||
| 	$(GHCI) $(BUILDFLAGS) $(WEBLANGEXTS) hledger-web/app/main.hs | 	cabal exec $(GHCI) -- $(BUILDFLAGS) $(WEBLANGEXTS) hledger-web/app/main.hs | ||||||
| 
 | 
 | ||||||
| repl-lib: | repl-lib: | ||||||
| 	(cd hledger-lib; cabal repl) | 	(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 | # hledger+hledger-lib GHCI prompt works | ||||||
| echo :q | make ghci | tail | echo :q | make ghci | tail | ||||||
| >>> /Ok, modules loaded: Hledger, / | >>> /Ok, modules loaded/ | ||||||
| >>>= 0 | >>>= 0 | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| # hledger-web+hledger+hledger-lib GHCI prompt works | # hledger-web+hledger+hledger-lib GHCI prompt works | ||||||
| echo :q | make ghciweb | tail | echo :q | make ghci-web | tail | ||||||
| >>> /Ok, modules loaded: Settings, Main, / | >>> /Ok, modules loaded/ | ||||||
| >>>= 0 | >>>= 0 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user