api: remove some hard-coded version numbers
This commit is contained in:
		
							parent
							
								
									e89c3752c4
								
							
						
					
					
						commit
						47f3ebf25a
					
				
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							| @ -173,7 +173,6 @@ DOCSOURCEFILES:= \ | |||||||
| # files which should be updated when the version changes
 | # files which should be updated when the version changes
 | ||||||
| VERSIONSENSITIVEFILES=\
 | VERSIONSENSITIVEFILES=\
 | ||||||
| 	$(HPACKFILES) \
 | 	$(HPACKFILES) \
 | ||||||
| 	hledger-api/hledger-api.hs \
 |  | ||||||
| 	doc/lib.m4 \
 | 	doc/lib.m4 \
 | ||||||
| 
 | 
 | ||||||
| # # file(s) which require recompilation for a build to have an up-to-date version string
 | # # file(s) which require recompilation for a build to have an up-to-date version string
 | ||||||
| @ -1199,11 +1198,6 @@ updatedate: setdate $(call def-help,updatedate, set date in manuals to current m | |||||||
| 	perl -pe "s/(hledger(-\w+)?) *>=? *((\d+\.)*\d+) *$$/\$$1 >=$(VERSION)/" -i $@                                 # hledgerX >= A | 	perl -pe "s/(hledger(-\w+)?) *>=? *((\d+\.)*\d+) *$$/\$$1 >=$(VERSION)/" -i $@                                 # hledgerX >= A | ||||||
| 	perl -pe "s/(hledger(-\w+)?) *>=? *((\d+\.)*\d+) *&& *< *((\d+\.)*\d+) *$$/\$$1 >=$(VERSION) && <\$$5/" -i $@  # hledgerX >= A && < B | 	perl -pe "s/(hledger(-\w+)?) *>=? *((\d+\.)*\d+) *&& *< *((\d+\.)*\d+) *$$/\$$1 >=$(VERSION) && <\$$5/" -i $@  # hledgerX >= A && < B | ||||||
| 
 | 
 | ||||||
| # update hledger-api's version strings
 |  | ||||||
| hledger-api/hledger-api.hs: $(VERSIONFILE) |  | ||||||
| 	perl -pe "s/(hledgerApiVersion=)\"((\d+\.)*\d+)\" *$$/\$$1\"$(VERSION)\"/" -i $@ |  | ||||||
| 	perl -pe "s/(.*?hledger-api +)((\d+\.)*\d+)(.*)$$/\$${1}$(VERSION)\$$4/" -i $@ |  | ||||||
| 
 |  | ||||||
| # update version string used in generated docs
 | # update version string used in generated docs
 | ||||||
| doc/lib.m4: $(VERSIONFILE) | doc/lib.m4: $(VERSIONFILE) | ||||||
| 	perl -pe "s/^(m4_define\({{_version_}}, *{{)((\d+\.)*\d+)(}}\)m4_dnl *)$$/\$${1}$(VERSION)\$${4}/" -i $@ | 	perl -pe "s/^(m4_define\({{_version_}}, *{{)((\d+\.)*\d+)(}}\)m4_dnl *)$$/\$${1}$(VERSION)\$${4}/" -i $@ | ||||||
|  | |||||||
| @ -37,12 +37,17 @@ import           Text.Printf | |||||||
| import Hledger.Query | import Hledger.Query | ||||||
| import Hledger.Cli hiding (Reader, version) | import Hledger.Cli hiding (Reader, version) | ||||||
| 
 | 
 | ||||||
| hledgerApiVersion="1.13" | #ifdef VERSION | ||||||
|  | hledgerApiVersion = VERSION | ||||||
|  | #else | ||||||
|  | hledgerApiVersion = "dev build" | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| -- https://github.com/docopt/docopt.hs#readme | -- https://github.com/docopt/docopt.hs#readme | ||||||
|  | -- XXX VERSION is "X.Y" and the quotes appear in the output | ||||||
| doc :: Docopt | doc :: Docopt | ||||||
| doc = [docopt| | doc = [docopt| | ||||||
| hledger-api 1.13 | hledger-api VERSION | ||||||
| 
 | 
 | ||||||
| Serves hledger data and reports as a JSON web API. | Serves hledger data and reports as a JSON web API. | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user