web: clean up language extensions a bit, make autoweb works again
This commit is contained in:
		
							parent
							
								
									e13ea5706d
								
							
						
					
					
						commit
						080eb866ec
					
				
							
								
								
									
										32
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								Makefile
									
									
									
									
									
								
							| @ -101,25 +101,27 @@ PATCHLEVEL:=$(shell git describe --long | awk -F - '{print $$2}') | ||||
| 
 | ||||
| # build flags
 | ||||
| WARNINGS:=-W -fwarn-tabs -fno-warn-unused-do-bind -fno-warn-name-shadowing #-fwarn-orphans -fwarn-simple-patterns -fwarn-monomorphism-restriction | ||||
| # Language extensions similar to the ones enabled by yesod in hledger-web.cabal,
 | ||||
| # so that we can do full dev builds of  hledger-web. Warning, they are not
 | ||||
| # exactly the same, in particular NoImplicitPrelude is not enabled since
 | ||||
| # hledger and hledger-lib won't build with that. So don't rely on the dev
 | ||||
| # build to show all compilation warnings and errors, do a cabal build as well.
 | ||||
| 
 | ||||
| # For ghc-only dev builds of hledger-web: enable the language
 | ||||
| # extensions specified in hledger-web.cabal, except for some which are
 | ||||
| # not compatible with hledger-lib and hledger, or little-used; those
 | ||||
| # are enabled with source file pragmas instead. Note: compilation
 | ||||
| # warnings and errors might differ between ghc-only and cabal builds.
 | ||||
| WEBLANGEXTS:=\
 | ||||
| 	-XTemplateHaskell \
 | ||||
| 	-XQuasiQuotes \
 | ||||
| 	-XCPP \
 | ||||
| 	-XMultiParamTypeClasses \
 | ||||
| 	-XTypeFamilies \
 | ||||
| 	-XGADTs \
 | ||||
| 	-XGeneralizedNewtypeDeriving \
 | ||||
| 	-XFlexibleContexts \
 | ||||
| 	-XEmptyDataDecls \
 | ||||
| 	-XOverloadedStrings \
 | ||||
| 	-XRecordWildCards | ||||
| #	-XNoImplicitPrelude
 | ||||
| 	-XQuasiQuotes \
 | ||||
| 	-XRecordWildCards \
 | ||||
| 	-XTemplateHaskell \
 | ||||
| #	-XNoImplicitPrelude \
 | ||||
| #	-XTypeFamilies \
 | ||||
| #	-XGADTs \
 | ||||
| #	-XGeneralizedNewtypeDeriving \
 | ||||
| #	-XFlexibleContexts \
 | ||||
| #	-XEmptyDataDecls \
 | ||||
| #	-XNoMonomorphismRestriction
 | ||||
| 
 | ||||
| PREFERMACUSRLIBFLAGS=-L/usr/lib | ||||
| GHCMEMFLAGS= #+RTS -M200m -RTS | ||||
| CABALMACROSFLAGS=-optP-include -optPhledger/dist/build/autogen/cabal_macros.h | ||||
| @ -171,7 +173,7 @@ auto-%: sp | ||||
| 	$(AUTOBUILD) $(MAIN) -o bin/hledgerdev $(AUTOBUILDFLAGS) --run $* | ||||
| 
 | ||||
| autoweb: sp link-web-dirs | ||||
| 	$(AUTOBUILD) hledger-web/app/main.hs -o bin/hledger-webdev $(AUTOBUILDFLAGS) $(WEBLANGEXTS) --run -B --port 5001 --base-url http://localhost:5001 -f test.journal | ||||
| 	$(AUTOBUILD) hledger-web/app/main.hs -o bin/hledger-webdev $(AUTOBUILDFLAGS) $(WEBLANGEXTS) --run -B --port 5001 --base-url http://localhost:5001 -f webtest.j | ||||
| 
 | ||||
| link-web-dirs: config messages static templates | ||||
| 
 | ||||
|  | ||||
| @ -1,4 +1,3 @@ | ||||
| {-# LANGUAGE ScopedTypeVariables #-} | ||||
| {-| | ||||
| 
 | ||||
| A reader for CSV data, using an extra rules file to help interpret the data. | ||||
|  | ||||
| @ -1,3 +1,4 @@ | ||||
| {-# LANGUAGE TypeFamilies #-} | ||||
| {- | ||||
| 
 | ||||
| Define the web application's foundation, in the usual Yesod style. | ||||
|  | ||||
| @ -1,8 +1,3 @@ | ||||
| {-# LANGUAGE TemplateHaskell, CPP #-} | ||||
| {-| | ||||
| 
 | ||||
| -} | ||||
| 
 | ||||
| module Hledger.Web.Options | ||||
| where | ||||
| import Prelude | ||||
|  | ||||
| @ -72,19 +72,21 @@ library | ||||
|   | ||||
|     ghc-options:   -Wall -fno-warn-unused-do-bind | ||||
|   | ||||
|     extensions: TemplateHaskell | ||||
|                 QuasiQuotes | ||||
|                 OverloadedStrings | ||||
|                 NoImplicitPrelude | ||||
|     extensions: | ||||
|                 CPP | ||||
|                 MultiParamTypeClasses | ||||
|                 TypeFamilies | ||||
|                 GADTs | ||||
|                 GeneralizedNewtypeDeriving | ||||
|                 FlexibleContexts | ||||
|                 EmptyDataDecls | ||||
|                 NoMonomorphismRestriction | ||||
|                 NoImplicitPrelude | ||||
|                 OverloadedStrings | ||||
|                 QuasiQuotes | ||||
|                 RecordWildCards | ||||
|                 TemplateHaskell | ||||
|                 TypeFamilies | ||||
|                 -- seem to not be needed at present: | ||||
|                 -- GADTs | ||||
|                 -- GeneralizedNewtypeDeriving | ||||
|                 -- FlexibleContexts | ||||
|                 -- EmptyDataDecls | ||||
|                 -- NoMonomorphismRestriction | ||||
| 
 | ||||
|     hs-source-dirs:  . app | ||||
|     exposed-modules:  Application | ||||
| @ -167,15 +169,15 @@ executable         hledger-web | ||||
|     else | ||||
|         ghc-options:   -O2 | ||||
| 
 | ||||
|     extensions: TemplateHaskell | ||||
|                 QuasiQuotes | ||||
|                 OverloadedStrings | ||||
|                 NoImplicitPrelude | ||||
|     extensions:  | ||||
|                 CPP | ||||
|                 OverloadedStrings | ||||
|                 MultiParamTypeClasses | ||||
|                 TypeFamilies | ||||
|                 NoImplicitPrelude | ||||
|                 OverloadedStrings | ||||
|                 QuasiQuotes | ||||
|                 RecordWildCards | ||||
|                 TemplateHaskell | ||||
|                 TypeFamilies | ||||
| 
 | ||||
|     hs-source-dirs:  . app | ||||
|     main-is:         main.hs | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user