-
-
Notifications
You must be signed in to change notification settings - Fork 414
Expand file tree
/
Copy pathJustfile
More file actions
1978 lines (1667 loc) · 78 KB
/
Copy pathJustfile
File metadata and controls
1978 lines (1667 loc) · 78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env just
# * Project scripts
# using https://github.com/casey/just, doc: https://just.systems/man/en
# Usage: alias j=just, run j to list available scripts.
#
# Maintainable robust project automation is essential.
# We rely on just for project automation scripts,
# even though it's less likely to be installed by default than make.
# After many years with make and plain shell and haskell for scripting,
# just is better enough that it's worthwhile.
# The big current limitation of just is the lack of file dependencies.
# When that is needed, or when more powerful scripting is needed,
# call out to Shake.hs, which handles both of those well.
#
# Reference:
# https://docs.rs/regex/1.5.4/regex/#syntax Regexps
# https://just.systems/man/en/chapter_31.html Functions
# https://cheatography.com/linux-china/cheat-sheets/justfile Cheatsheet
# https://github.com/casey/just/discussions
#
# Here are other tools required by some of the scripts below:
# - bash - (not the old /bin/bash on mac)
# - ghc - a haskell compiler in PATH (installing with ghcup is recommended)
# - ghcid - recompiles and optionally runs tests on file change
# - stack - installs haskell libs, runs ghc
# - shelltestrunner - runs functional tests
# - quickbench - runs benchmarks
# - hasktags - generates tag files for code navigation
# - profiterole - simplifies profiles
# - profiteur - renders profiles as html
# - dateround - from dateutils
#
# Lines beginning with "# * ", "# ** " in this file are emacs outshine-mode headings, foldable with TAB.
# You could add emacs highlighting like so, if needed:
# (add-hook 'just-mode-hook (lambda ()
# (highlight-lines-matching-regexp "^# \\*\\*? " 'hi-yellow) ; level 1-2 outshine headings
# (highlight-lines-matching-regexp "^@?\\w.*\\w:$" 'hi-pink) ; recipe headings (misses recipes with dependencies)
# ))
# ** just config ------------------------------------------------------------
################################################################################
# prelude.just - Standard definitions for justfiles.
#set allow-duplicate-recipes
set allow-duplicate-variables
set export := true
set positional-arguments := true
just := 'just -f ' + justfile()
# list recipes, optionally filtered by REGEX. Useful when there's many, but slower than just -ul.
_help *REGEX:
#!/usr/bin/env bash
if [[ '{{ REGEX }}' == '' ]]
then just -f {{ justfile() }} -ul | sed -E 's/(^ +[A-Z_-]+ )/\n\1/'; echo
else just -f {{ justfile() }} -ul | rg --pcre2 -i '{{ REGEX }}'; true
fi
alias h := _help
# check this justfile for errors and non-standard format
@_chk:
just --fmt --unstable --check
# if this justfile is error free but in non-standard format, reformat and commit it
@_fmt:
just -q check || just --fmt --unstable && git commit -m 'just: fmt' -- {{ justfile() }}
WATCHEXEC := 'watchexec'
# rerun RECIPE when any watched-by-default file changes
@_watch RECIPE *JOPTS:
$WATCHEXEC -r -- just $RECIPE {{ JOPTS }}
################################################################################
# Ensure a predictable default shell. bash will need to be installed to use this justfile.
set shell := ["bash", "-uc"]
# ** Constants ------------------------------------------------------------
# Open a web browser
OPEN := 'open -a safari'
# grep-like rg
#RG_ := 'rg --sort=path --no-heading -i'
#TODAY := `date +%Y-%m-%d`
# just := "just -f " + justfile()
# Use this justfile from within its directory, otherwise we must write {{ just }} everywhere.
BROWSE := 'open'
# XXX These often don't work well interpolated as $CMD or {{ CMD }}, not sure why
# find GNU tools, eg on mac
GDATE := `type -P gdate || echo date`
GTAR := `type -P gtar || echo tar`
#GNUTAR := `which gtar >/dev/null && echo gtar || echo tar`
# make ghc usable for scripting with -e
GHC := 'ghc -package-env - -ignore-dot-ghci -Wno-x-partial'
GHCI := 'ghci'
# GHCPKG := 'ghc-pkg'
# HADDOCK := 'haddock'
# CABAL := 'cabal'
# CABALINSTALL := 'cabal install -w {{ GHC }}'
# GHC-compiled executables require a locale (and not just C) or they
# will die on encountering non-ascii data. Set LANG to something if not already set.
# export LANG? := 'en_US.UTF-8'
# command to run during profiling (time and heap)
# command to run when profiling
PROFCMD := 'bin/hledgerprof balance -f examples/10000x1000x10.journal >/dev/null'
PROFRTSFLAGS := '-P'
# # command to run when checking test coverage
# COVCMD := 'test'
# COVCMD := '-f test-wf.csv print'
# Which stack command (and in particular, stack yaml/GHC version) to use for building etc. ?
STACK := 'stack'
#STACK := 'stack --stack-yaml=stack912.yaml'
PACKAGES := '
hledger-lib
hledger
hledger-ui
hledger-web
'
INCLUDEPATHS := '
-ihledger-lib
-ihledger
-ihledger-ui
-ihledger-web
-ihledger-web/app
'
MAIN := 'hledger/app/hledger-cli.hs'
# All source files in the project (plus a few strays like Setup.hs & hlint.hs).
# Used eg for building tags. Doesn't reliably catch all source files.
SOURCEFILES := '
dev.hs
hledger/*hs
hledger/app/*hs
hledger/bench/*hs
hledger/test/*hs
hledger/Hledger/*hs
hledger/Hledger/*/*hs
hledger/Hledger/*/*/*hs
hledger-*/*hs
hledger-*/app/*hs
hledger-*/test/*hs
hledger-*/Hledger/*hs
hledger-*/Hledger/*/*hs
hledger-*/Hledger/*/*/*hs
hledger-lib/Text/*/*hs
'
HPACKFILES := '
hledger/*package.yaml
hledger-*/*package.yaml
'
CABALFILES := '
hledger/hledger.cabal
hledger-*/*.cabal
'
MANUALSOURCEFILES := '
doc/common.m4
*/*.m4.md
'
# MANUALGENFILES := '
# hledger*/hledger*.{1,5,info,txt}
# '
COMMANDHELPFILES := '
hledger/Hledger/Cli/Commands/*.md
'
WEBTEMPLATEFILES := '
hledger-web/templates/*
'
WEBCODEFILES := '
hledger-web/static/*.js
hledger-web/static/*.css
'
DOCSOURCEFILES := '
README.md
CONTRIBUTING.md
' + MANUALSOURCEFILES + COMMANDHELPFILES
TESTFILES := `fd '\.test$' --exclude ledger-compat`
# XXX it's fd-find on gnu/linux ?
# # file(s) which require recompilation for a build to have an up-to-date version string
# VERSIONSOURCEFILE := 'hledger/Hledger/Cli/Version.hs'
# Two or three-part version string, set as program version in builds made by this makefile.
# We use hledger CLI's current version (XXX for all packages, which isn't quite right).
export VERSION := `cat hledger/.version`
# Flags for ghc builds.
# Warnings to see during dev tasks like make ghci*. XXX redundant with package.yamls ?
WARNINGS := '
-Wall
-Wno-incomplete-uni-patterns
-Wno-missing-signatures
-Wno-orphans
-Wno-type-defaults
-Wno-unused-do-bind
'
# if you have need to try building in less memory
GHCLOWMEMFLAGS := ''
#GHCLOWMEMFLAGS := '+RTS +M2g -RTS'
# ghc-only builds need the macro definitions generated by cabal
# from cabal's dist dir, hopefully there's just one:
#CABALMACROSFLAGS := '-optP-include -optP hledger/dist*/build/autogen/cabal_macros.h'
# or from stack's dist dir:
#CABALMACROSFLAGS := '-optP-include -optP hledger/.stack-work/dist/*/*/build/autogen/cabal_macros.h'
CABALMACROSFLAGS := ''
BUILDFLAGS := '-rtsopts ' + WARNINGS + GHCLOWMEMFLAGS + CABALMACROSFLAGS + ' -DDEVELOPMENT' + ' -DVERSION="' + VERSION + '"' + INCLUDEPATHS
# -fplugin Debug.Breakpoint \
# -fhide-source-paths \
# PROFBUILDFLAGS := '-prof -fprof-auto -osuf hs_p'
TIME := "{{ shell date +'%Y%m%d%H%M' }}"
MONTHYEAR := "{{ shell date +'%B %Y' }}"
# ** Building ------------------------------------------------------------
BUILDING:
# build the hledger package showing ghc codegen times/allocations
@buildtimes:
time ($STACK build hledger --force-dirty --ghc-options='-fforce-recomp -ddump-timings' 2>&1 | grep -E '\bCodeGen \[.*time=')
# # build an unoptimised hledger at bin/hledger.EXT.unopt (default: git describe)
# build-unopt *EXT:
# #!/usr/bin/env bash
# ext={{ if EXT == '' { `git describe --tags` } else { EXT } }}
# exe="bin/hledger.$ext.unopt"
# $STACK --verbosity=error install --ghc-options=-O0 hledger --local-bin-path=bin
# mv bin/hledger "$exe"
# echo "$exe"
# build hledger with profiling enabled at bin/hledgerprof
hledgerprof:
@echo "building bin/hledgerprof..."
{{ STACK }} install --profile --local-bin-path=bin hledger && mv bin/hledger{,prof}
@echo "to profile, use $STACK exec --profile -- hledger ..."
# # build "bin/hledgercov" for coverage reports (with ghc)
# hledgercov:
# $STACK ghc {{ MAIN }} -fhpc -o bin/hledgercov -outputdir .hledgercovobjs $BUILDFLAGS
# run ghcid on hledger-lib + hledger
@ghcid:
ghcid -c 'just ghci'
# run ghcid autobuilder on hledger-lib + hledger + hledger-ui
@ghcid-ui:
ghcid -c 'just ghci-ui'
# run ghcid autobuilder on hledger-lib + hledger + hledger-web
@ghcid-web:
ghcid -c 'just ghci-web'
# run ghcid autobuilding and running hledger-web with sample journal on port 5001
@ghcid-web-run:
ghcid -c 'just ghci-web' --test ':main -f examples/sample.journal --port 5001 --serve'
# # run ghcid autobuilding and running the test command
# ghcid-test:
# ghcid -c 'just ghci' --test ':main test -- --color=always'
# # run ghcid autobuilding and running the test command with this TESTPATTERN
# ghcid-test-%:
# ghcid -c 'just ghci' --test ':main test -- --color=always -p$*'
# run ghcid autobuilding and running hledger-lib doctests
@ghcid-doctest:
ghcid -c 'cd hledger-lib; $STACK ghci hledger-lib:test:doctest' --test ':main' --reload hledger-lib
GHCIDRESTART := '--restart Makefile --restart Makefile.local'
GHCIDRELOAD := '--reload t.j --reload t.timedot'
GHCIDCMD := ':main -f t.j bal date:today -S'
# # run ghcid autobuilding and running a custom GHCI command with reload/restart on certain files - customise this
# ghcid-watch watch:
# ghcid -c 'just ghci' --test '{{ GHCIDCMD }}' {{ GHCIDRELOAD }} {{ GHCIDRESTART }}
# keep synced with Shake.hs header
SHAKEDEPS := '\
--package base-prelude \
--package directory \
--package extra \
--package process \
--package regex \
--package safe \
--package shake \
--package time \
'
# --package hledger-lib \ # for Hledger.Utils.Debug
# run ghcid autobuilder on Shake.hs
ghcid-shake:
stack exec {{ SHAKEDEPS }} -- ghcid Shake.hs
# ** Testing ------------------------------------------------------------
TESTING:
# run ghci on hledger-lib + hledger
@ghci *GHCIARGS:
$STACK exec -- $GHCI $BUILDFLAGS {{ GHCIARGS }} hledger/Hledger/Cli.hs
# echo the full command that just ghci would run
@ghci-echo *GHCIARGS:
echo $STACK exec -- $GHCI $BUILDFLAGS {{ GHCIARGS }} hledger/Hledger/Cli.hs
# run ghci on hledger-lib + hledger with profiling/call stack information
@ghci-prof *GHCIARGS:
stack build --profile hledger --only-dependencies
$STACK exec -- $GHCI $BUILDFLAGS -fexternal-interpreter -prof -fprof-auto {{ GHCIARGS }} hledger/Hledger/Cli.hs
# run ghcitui on hledger-lib + hledger
@ghcitui *GHCITUIARGS:
ghcitui --cmd "just ghci"
# # run ghci on hledger-lib + hledger + dev.hs script
# @ghci-dev:
# $STACK exec -- $GHCI $BUILDFLAGS -fno-warn-unused-imports -fno-warn-unused-binds dev.hs
# run ghci on hledger-lib + hledger + hledger-ui
@ghci-ui *GHCIARGS:
$STACK exec -- $GHCI $BUILDFLAGS {{ GHCIARGS }} hledger-ui/app/hledger-ui.hs
# run ghci on hledger-lib + hledger + hledger-web
@ghci-web *GHCIARGS:
$STACK exec -- $GHCI $BUILDFLAGS {{ GHCIARGS }} hledger-web/app/main.hs
# run ghci on hledger-lib + hledger + hledger-web + hledger-web test suite
@ghci-web-test *GHCIARGS:
$STACK exec -- $GHCI $BUILDFLAGS {{ GHCIARGS }} hledger-web/test/test.hs
# # better than stack exec ?
# # XXX does not see changes to files
# # run ghci on hledger-lib + test runner
# ghci-lib-test:
# $STACK ghci --ghc-options="\'-rtsopts {{ WARNINGS }} -ihledger-lib -DDEVELOPMENT -DVERSION=\"1.26.99\"\'" hledger-lib/test/unittest.hs
# run ghci on all the hledger
# ghci-all:
# $STACK exec -- $GHCI $BUILDFLAGS \
# hledger-ui/Hledger/UI/Main.hs \
# hledger-web/app/main.hs \
# run ghci on hledger-lib doctests
@ghci-doctest:
cd hledger-lib; $STACK ghci hledger-lib:test:doctest
# run ghci on Shake.hs
@ghci-shake:
$STACK exec {{ SHAKEDEPS }} -- ghci Shake.hs
# # hledger-lib/Hledger/Read/TimeclockReaderPP.hs
# # build the dev.hs script for quick experiments (with ghc)
# dev:
# $STACK ghc -- {{ CABALMACROSFLAGS }} -ihledger-lib dev.hs \
# # to get profiling deps installed, first do something like:
# # stack build --library-profiling hledger-lib timeit criterion
# # build the dev.hs script with profiling support
# devprof:
# $STACK ghc -- {{ CABALMACROSFLAGS }} -ihledger-lib dev.hs -rtsopts -prof -fprof-auto -osuf p_o -o devprof
# # get a time & space profile of the dev.hs script
# dev-profile:
# time ./devprof +RTS -P \
# && cp devprof.prof devprof.prof.{{ TIME }} \
# && profiterole devprof.prof
# # get heap profiles of the dev.hs script
# dev-heap:
# time ./devprof +RTS -hc -L1000 && cp devprof.hp devprof-hc.hp && hp2ps devprof-hc.hp
# time ./devprof +RTS -hr -L1000 && cp devprof.hp devprof-hr.hp && hp2ps devprof-hr.hp
# dev-heap-upload:
# curl -F "file=@devprof-hc.hp" -F "title='hledger parser'" http://heap.ezyang.com/upload
# curl -F "file=@devprof-hr.hp" -F "title='hledger parser'" http://heap.ezyang.com/upload
# run most tests (files, unit, doc, functional). doctest is slow, requiring its own build.
test:
@echo
just embedtest
@echo
just functest --hide
@echo
just doctest
@echo
# For quieter tests add --silent. It may hide troubleshooting info.
# For very verbose tests add --verbosity=debug. It seems hard to get something in between.
STACKTEST := STACK + ' test --fast'
# # When doing build testing, save a little time and output noise by not
# # running tests & benchmarks. Comment this out if you want to run them.
# SKIPTESTSBENCHS := '--no-run-tests --no-run-benchmarks'
# check all files embedded with file-embed are declared in extra-source-files
@embedtest:
tools/checkembeddedfiles
# # stack build --dry-run all hledger packages ensuring an install plan with default snapshot)
# buildplantest:
# buildplantest-stack.yaml
# # stack build --dry-run all hledger packages ensuring an install plan with each ghc version/stackage snapshot
# buildplantest-all:
# for F in stack*.yaml; do make --no-print-directory buildplantest-$F; done
# # stack build --dry-run all hledger packages ensuring an install plan with the given stack yaml file; eg make buildplantest-stack8.2.yaml
# buildplantest-%:
# $STACK build --dry-run --test --bench --stack-yaml=$*
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with default snapshot)
# buildtest:
# buildtest-stack.yaml
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot
# buildtest-all:
# for F in stack*.yaml; do make --no-print-directory buildtest-$F; done
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with the given stack yaml file; eg make buildtest-stack8.2.yaml
# buildtest-%:
# $STACK build --test --bench {{ SKIPTESTSBENCHS }} --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --stack-yaml=$*
# # build any outdated hledger packages/modules quickly ensuring no warnings with default snapshot. Wont detect warnings in up-to-date modules.)
# incr-buildtest:
# incr-buildtest-stack.yaml
# # build any outdated hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot. Wont detect warnings in up-to-date modules.
# incr-buildtest-all:
# for F in stack*.yaml; do make --no-print-directory incr-buildtest-$F; done
# # build any outdated hledger packages/modules quickly ensuring no warnings with the stack yaml file; eg make buildtest-stack8.2.yaml. Wont detect warnings in up-to-date modules.
# incr-buildtest-%:
# $STACK build --test --bench {{ SKIPTESTSBENCHS }} --fast --ghc-options=-Werror --stack-yaml=$*
# # do a stack clean --full with all ghc versions for paranoia/troubleshooting
# stack-clean-all:
# for F in stack*.yaml; do $STACK clean --full --stack-yaml=$F; done
# run all test suites in the hledger packages
@pkgtest:
($STACKTEST && echo $@ PASSED) || (echo $@ FAILED; false)
# doctest with ghc 8.4 on mac requires a workaround, see hledger-lib/package.yaml.
# Or, could run it with ghc 8.2:
# @($STACKTEST --stack-yaml stack8.2.yaml hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false)
# run the doctests in hledger-lib module/function docs. DOCTESTARGS is passed through but seems not too useful.
@doctest *DOCTESTARGS:
({{ STACK }} test --test-arguments="$DOCTESTARGS" hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false)
# # run the unit tests in hledger-lib
# unittest:
# @($STACKTEST hledger-lib:test:unittest && echo $@ PASSED) || (echo $@ FAILED; false)
# run hledger & hledger-lib unit tests (do a stack build hledger first).
@unittest:
($STACK exec hledger test && echo $@ PASSED) || (echo $@ FAILED; false)
SHELLTEST := STACK + ' exec -- shelltest --execdir --threads=40'
# --hide-successes
# build hledger warning-free and run functional tests, with any shelltest OPTS.
@functest *STOPTS:
{{ STACK }} build --ghc-options=-Werror --test --no-run-tests hledger
time (({{ SHELLTEST }} --exclude=/_ --hide {{ if STOPTS == '' { '' } else { STOPTS } }} \
hledger/test/ bin/ \
-x hledger/test/perf.test \
-x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-extra \
&& echo $@ PASSED) || (echo $@ FAILED; false))
# --test so that subsequent `stack test` won't recompile everything
# --no-run-tests to avoid running the slow doctest suite every time
# run hledger-web's browser tests against the current build, with any playwright OPTS (needs setup, see hledger-web/test/browser/README.md)
@browsertest *PWOPTS:
{{ STACK }} build hledger-web
cd hledger-web/test/browser && \
HLEDGER_WEB="{{ STACK }} exec -- hledger-web" pnpm test {{ PWOPTS }}
# too fragile:
# echo
# just perftest {{ STOPTS }}
# remind how to test performance
@perfhelp:
echo "Some ways to compare performance of two installed hledger versions:"
echo "just installas new"
echo "just perftest"
echo "just bench -w hledger,hledger-new -n2 -N2"
echo "just bench-throughput hledger; just bench-throughput hledger-new"
# run performance tests with the hledger in PATH, logging to perf.log and expecting a certain txns/s. Accepts shelltest OPTS.
@perftest *STOPTS:
echo "Running performance tests..."
time (({{ SHELLTEST }} {{ if STOPTS == '' { '' } else { STOPTS } }} hledger/test/_perf.test \
&& echo $@ PASSED) || (echo $@ FAILED; false))
echo "Now eyeball the recent perf.log for changes:"
tail -50 perf.log
# compare hledger's and ledger's balance report
compare-balance:
#!/usr/bin/env bash
for f in examples/1txns-1accts.journal \
examples/10txns-10accts.journal \
; do \
(export f=$f; \
printf "\n-------------------------------------------------------------------------------\n"; \
echo "comparing hledger -f $f balance and ledger -f $f balance --flat"; \
difft --color=always --display side-by-side-show-both <(hledger -f $f balance) <(ledger -f $f balance --flat) ) | tail +2; \
done
# generate a hlint report
hlinttest hlint:
hlint --hint=hlint --report=hlint.html {{ SOURCEFILES }}
# check that haddock can generate docs without dying
@haddocktest:
(just -q haddock && echo haddocktest PASSED) || (echo haddocktest FAILED; false)
# check cabal files' syntax
@cabalfilestest:
(for p in $PACKAGES; do (cd $p && printf "\nchecking $p.cabal:\n" && cabal check); done \
&& echo $@ PASSED) || (echo $@ FAILED; false)
# test-stack%yaml:
# $STACK --stack-yaml stack$*yaml clean
# $STACK --stack-yaml stack$*yaml build --ghc-options="{{ WARNINGS }} -Werror" --test --bench --haddock --no-haddock-deps
#
# releasetest: Clean unittest functest fullcabaltest haddocktest #buildtest doctest \
# {{ call def-help,releasetest,pre-release tests }}
# run hledger-install.sh not from inside a haskell project
installtest:
cd; {{ justfile_directory() }}/hledger-install/hledger-install.sh
# ** Benchmarking ------------------------------------------------------------
BENCHMARKING:
# generate standard sample journals in examples/. Run just tools first.
samplejournals:
# small journals
tools/generatejournal 3 5 5 > examples/ascii.journal
tools/generatejournal 3 5 5 --mixed > examples/mixed.journal
tools/generatejournal 1 1 10 > examples/1txns-1accts.journal
tools/generatejournal 10 10 10 > examples/10txns-10accts.journal
tools/generatejournal 100 100 10 > examples/100txns-100accts.journal
# many transactions
tools/generatejournal 1000 1000 10 > examples/1ktxns-1kaccts.journal
tools/generatejournal 2000 1000 10 > examples/2ktxns-1kaccts.journal
tools/generatejournal 3000 1000 10 > examples/3ktxns-1kaccts.journal
tools/generatejournal 4000 1000 10 > examples/4ktxns-1kaccts.journal
tools/generatejournal 5000 1000 10 > examples/5ktxns-1kaccts.journal
tools/generatejournal 6000 1000 10 > examples/6ktxns-1kaccts.journal
tools/generatejournal 7000 1000 10 > examples/7ktxns-1kaccts.journal
tools/generatejournal 8000 1000 10 > examples/8ktxns-1kaccts.journal
tools/generatejournal 9000 1000 10 > examples/9ktxns-1kaccts.journal
tools/generatejournal 10000 1000 10 > examples/10ktxns-1kaccts.journal
tools/generatejournal 20000 1000 10 > examples/20ktxns-1kaccts.journal
tools/generatejournal 30000 1000 10 > examples/30ktxns-1kaccts.journal
tools/generatejournal 40000 1000 10 > examples/40ktxns-1kaccts.journal
tools/generatejournal 50000 1000 10 > examples/50ktxns-1kaccts.journal
tools/generatejournal 60000 1000 10 > examples/60ktxns-1kaccts.journal
tools/generatejournal 70000 1000 10 > examples/70ktxns-1kaccts.journal
tools/generatejournal 80000 1000 10 > examples/80ktxns-1kaccts.journal
tools/generatejournal 90000 1000 10 > examples/90ktxns-1kaccts.journal
tools/generatejournal 100000 1000 10 > examples/100ktxns-1kaccts.journal
tools/generatejournal 1000000 1000 10 > examples/1Mtxns-1kaccts.journal
# many accounts
tools/generatejournal 1000 1 10 > examples/1ktxns-1accts.journal
tools/generatejournal 1000 10 10 > examples/1ktxns-10accts.journal
tools/generatejournal 1000 100 10 > examples/1ktxns-100accts.journal
#tools/generatejournal 1000 1000 10 > examples/1ktxns-1kaccts.journal
tools/generatejournal 1000 10000 10 > examples/1ktxns-10kaccts.journal
tools/generatejournal 1000 100000 10 > examples/1ktxns-100kaccts.journal
tools/generatejournal 1000 1000000 10 > examples/1ktxns-1maccts.journal
tools/generatejournal 10000 1 10 > examples/10ktxns-1accts.journal
tools/generatejournal 10000 10 10 > examples/10ktxns-10accts.journal
tools/generatejournal 10000 100 10 > examples/10ktxns-100accts.journal
#tools/generatejournal 10000 1000 10 > examples/10ktxns-1kaccts.journal
tools/generatejournal 10000 10000 10 > examples/10ktxns-10kaccts.journal
tools/generatejournal 10000 20000 10 > examples/10ktxns-20kaccts.journal
tools/generatejournal 10000 30000 10 > examples/10ktxns-30kaccts.journal
tools/generatejournal 10000 40000 10 > examples/10ktxns-40kaccts.journal
tools/generatejournal 10000 50000 10 > examples/10ktxns-50kaccts.journal
tools/generatejournal 10000 60000 10 > examples/10ktxns-60kaccts.journal
tools/generatejournal 10000 70000 10 > examples/10ktxns-70kaccts.journal
tools/generatejournal 10000 80000 10 > examples/10ktxns-80kaccts.journal
tools/generatejournal 10000 90000 10 > examples/10ktxns-90kaccts.journal
tools/generatejournal 10000 100000 10 > examples/10ktxns-100kaccts.journal
tools/generatejournal 10000 1000000 10 > examples/10ktxns-1maccts.journal
# tools/generatejournal.hs 3 5 5 --chinese > examples/chinese.journal # don't regenerate, keep the simple version
# $ just --set BENCHEXES ledger,hledger bench
# run the benchmark commands in bench.sh with quickbench. Eg: just bench -h; just bench -f bench10k.sh -w hledger-1.30,hledger-1.31,hledger-1.32 -n2 -N2
@bench *ARGS:
printf "Running quick benchmarks (times are approximate, can be skewed):\n"
which quickbench >/dev/null && quickbench {{ ARGS }} || echo "quickbench not installed (see bench.sh), skipping"
# @bench-gtime:
# for args in '-f examples/10ktxns-1kaccts.journal print' '-f examples/100ktxns-1kaccts.journal register' '-f examples/100ktxns-1kaccts.journal balance'; do \
# echo; \
# for app in hledger-1.26 hledger-21ad ledger; do \
# echo; echo $app $args:; \
# gtime $app $args >/dev/null; \
# done; \
# done
# show throughput at various data sizes with the given hledger executable (requires samplejournals)
@bench-throughput EXE:
echo date: `date`
echo system: `uname -a`
echo executable: {{ EXE }}
echo version: `{{ EXE }} --version`
for n in 1 2 3 4 5 6 7 8 9 10 100 ; do \
printf "%3dk txns: " $n; {{ EXE }} stats -f examples/${n}ktxns-1kaccts.journal | tail -1; \
done
date
# show throughput at various data sizes with the latest hledger dev build, optimised or not (requires samplejournals)
@bench-throughput-dev:
stack build hledger
stack exec -- just throughput hledger
# show throughput of recent hledger versions (requires samplejournals)
@bench-throughput-recent:
for v in 1.25 1.40 1.52 1.99.4; do printf "\nhledger-$v:\n"; for i in `seq 1 3`; do hledger-$v -f examples/10ktxns-10kaccts.journal stats | grep ^Run; done; done
# @bench-balance-many-accts:
# quickbench -w hledger-1.26,hledger-21ad,ledger -f bench-many-accts.sh -N2
# #quickbench -w hledger-1.25,hledger-1.28,hledger-1.29,hledger-1.30,hledger-1.31,hledger-1.32,hledger-21ad,ledger -f bench-many-accts.sh -N2
# @bench-balance-many-txns:
# quickbench -w hledger-21ad,ledger -f bench-many-txns.sh -N2
# samplejournals bench.sh
# bench: samplejournals tests/bench.tests tools/simplebench \
# $(call def-help,bench,\
# run simple performance benchmarks and archive results\
# Requires some commands defined in tests/bench.tests and some BENCHEXES defined above.\
# )
# tools/simplebench -v -ftests/bench.tests $(BENCHEXES) | tee doc/profs/$(TIME).bench
# @rm -f benchresults.*
# @(cd doc/profs; rm -f latest.bench; ln -s $(TIME).bench latest.bench)
# criterionbench: samplejournals tools/criterionbench \
# $(call def-help,criterionbench,\
# run criterion benchmark tests and save graphical results\
# )
# tools/criterionbench -t png -k png
# progressionbench: samplejournals tools/progressionbench \
# $(call def-help,progressionbench,\
# run progression benchmark tests and save graphical results\
# )
# tools/progressionbench -- -t png -k png
# prof: samplejournals \
# $(call def-help,prof,\
# generate and archive an execution profile\
# ) #bin/hledgerprof
# @echo "Profiling: $(PROFCMD)"
# -$(PROFCMD) +RTS $(PROFRTSFLAGS) -RTS
# mv hledgerprof.prof doc/profs/$(TIME).prof
# (cd doc/profs; rm -f latest*.prof; ln -s $(TIME).prof latest.prof)
# viewprof: prof \
# $(call def-help,viewprof,\
# generate, archive, simplify and display an execution profile\
# )
# tools/simplifyprof.hs doc/profs/latest.prof
#{{ STACK }} exec --profile -- hledger +RTS {{ PROFRTSFLAGS }} -RTS -f examples/1000x1000x10.journal {{ CMD }} #>/dev/null
# run a hledger CMD against a sample journal and display the execution profile (build hledgerprof first)
quickprof CMD: #hledgerprof #samplejournals
hledgerprof +RTS {{ PROFRTSFLAGS }} -RTS -f examples/10ktxns-1kaccts.journal {{ CMD }} #>/dev/null
@profiterole hledger.prof
@echo
@head -20 hledger.prof
@echo ...
@echo
@head -20 hledger.profiterole.txt
@echo ...
@echo
@echo "See hledger.prof, hledger.profiterole.txt, hledger.profiterole.html for more."
# generate and archive a graphical heap profile
@heap: hledgerprof #samplejournals
echo "Profiling heap with: $PROFCMD"
{{ PROFCMD }} +RTS -hc -RTS
mv hledgerprof.hp doc/profs/$(TIME).hp
(cd doc/profs; rm -f latest.hp; ln -s {{ TIME }}.hp latest.hp; \
hp2ps {{ TIME }}.hp; rm -f latest.ps; ln -s {{ TIME }}.ps latest.ps; rm -f *.aux)
# viewheap: heap \
# $(call def-help,viewheap,\
# \
# )
# $(VIEWPS) doc/profs/latest.ps
# quickheap-%: hledgerprof samplejournals \
# $(call def-help,quickheap-"CMD", run some command against a sample journal and display the heap profile )
# $(STACK) exec -- hledgerprof +RTS -hc -RTS $* -f examples/10000x1000x10.journal >/dev/null
# hp2ps hledgerprof.hp
# @echo generated hledgerprof.ps
# $(VIEWPS) hledgerprof.ps
# quickcoverage: hledgercov \
# $(call def-help,quickcoverage,\
# display a code coverage text report from running hledger COVCMD\
# )
# @echo "Generating code coverage text report for hledger command: $(COVCMD)"
# tools/runhledgercov "report" $(COVCMD)
# coverage: samplejournals hledgercov \
# $(call def-help,coverage,\
# generate a code coverage html report from running hledger COVCMD\
# )
# @echo "Generating code coverage html report for hledger command: $(COVCMD)"
# tools/runhledgercov "markup --destdir=doc/profs/coverage" $(COVCMD)
# cd doc/profs/coverage; rm -f index.html; ln -s hpc_index.html index.html
# viewcoverage: \
# $(call def-help,viewcoverage,\
# view the last html code coverage report\
# )
# $(VIEWHTML) doc/profs/coverage/index.html
# ** Documenting ------------------------------------------------------------
DOCUMENTING:
# Update manuals - build hledger, regenerate flag docs, regenerate manuals
manuals:
$STACK build hledger
./Shake cmddocs -c
./Shake manuals -c
# Update the site's snapshot of the manuals for this branch's major release version.
manuals-site: manuals
make -C site snapshot-$(just majorver)
# Update the general options help shown in the manuals (doc/common.m4) from hledger's --help output.
generaloptionshelp:
$STACK build hledger
tools/generaloptionshelp
# Add latest commit messages to the changelogs. (Runs ./Shake changelogs [OPTS])
changelogs *OPTS:
./Shake changelogs {{ OPTS }}
# Check the changelogs for stale resume points, bad issue links, leftover draft markers. (Runs ./Shake changelogs-check)
changelogs-check:
./Shake changelogs-check
# Drop any uncommitted changes to the project and package changelogs.
changelogs-reset:
git checkout */CHANGES.md
# Set changelog headings to the specified commit, or HEAD. Rarely needed now (changelogs auto-relocates rewritten resume points). Run on release branch.
changelogs-catchup *COMMIT:
#!/usr/bin/env bash
set -euo pipefail
just _on-release-branch
C={{ if COMMIT == '' { `git log -1 --pretty=%h --abbrev=8` } else { COMMIT } }}
for p in $PACKAGES; do \
sed -i "0,/^# /s/^# .*$/# $C/" $p/CHANGES.md; \
done
sed -i "0,/^# /s/^# .*$/# $C/" doc/CHANGES.md
echo "Changelog headings have been set to $C"
# Set changelog headings for a full release today. Run on release branch.
changelogs-finalise:
#!/usr/bin/env bash
set -euo pipefail
just _on-release-branch
date=`gdate -I`
for p in $PACKAGES; do \
sed -i "0,/^# /s/^# .*$/# `cat $p/.version` $date/" $p/CHANGES.md; \
done
sed -i "0,/^# /s/^# .*$/# `cat .version` $date/" doc/CHANGES.md
git commit -m ";doc: finalise changelogs for `cat .version` on $date" */CHANGES.md
# see also Shake.hs
# http://www.haskell.org/haddock/doc/html/invoking.html
# update the website (the live one if run on hledger.org)
site: #Shake
./Shake -V site 2>&1 | tee -a site.log
# Use the existing Shake executable without recompiling it, so as not to automatially run unreviewed code by hook ? I think this no longer applies.
# site: $(call def-help,site-build, update the hledger.org website (run this on hledger.org, or run "make hledgerorg" elsewhere) )
# @[ ! -x Shake ] \
# && echo 'Please run "make Shake" first (manual compilation required for safety)' \
# || ( \
# echo; \
# ./Shake -V site; \
# ) 2>&1 | tee -a site.log
BROWSEDELAY := '5'
LOCALSITEURL := 'http://localhost:3000/index.html'
# open a browser on the website (in ./site) and rerender when docs or web pages change
@site-watch: #Shake
(printf "\nbrowser will open in {{ BROWSEDELAY }}s (adjust BROWSE if needed)...\n\n"; sleep $BROWSEDELAY; $BROWSE "$LOCALSITEURL" ) &
$WATCHEXEC --no-vcs-ignore -e md,m4 -i hledger.md -i hledger-ui.md -i hledger-web.md -r './Shake webmanuals && make -sC site serve'
# --no-vcs-ignore to include site/src/*.md
# restart hledger.org's caddy server, after config changes
site-restart:
osh -i -c 'hledgerorgssh systemctl restart caddy'
STACKHADDOCK := 'time ' + STACK + ' --verbosity=error haddock --fast --no-keep-going \
--only-locals --no-haddock-deps --no-haddock-hyperlink-source \
--haddock-arguments="--no-warnings" \
'
# workaround for haddock "Module defined in multiple files" trac.haskell.org/haddock/ticket/284
# -ghc-options='-optP-P'
HADDOCKPKGS := 'hledger-lib'
# regenerate haddock docs for the hledger packages
haddock:
{{ STACKHADDOCK }} {{ HADDOCKPKGS }}
# regenerate haddock docs for the hledger packages and open them
@haddock-and-open:
just haddock
just haddock-open
# open the haddock packages contents page in a browser
haddock-open:
{{ BROWSE }} `$STACK path --local-install-root`/doc/index.html
# # Rerenders all hledger packages. Run make haddock-open to open contents page.
# haddock-watch1: \
# $(call def-help,haddock-watch, regenerate haddock docs when files change )
# $(STACKHADDOCK) $(HADDOCK_PKGS) --file-watch --exec='echo done'
# # Rerenders hledger-lib modules, opens hledger-lib contents page.
# haddock-watch2: \
# $(call def-help,haddock-watch2, regenerate hledger-lib haddock docs when files change )
# watchexec -r -e yaml,cabal,hs --print-events -- \
# $(STACKHADDOCK) --verbosity=info $(HADDOCK_PKGS) --exec="'echo done'" hledger-lib --open
# # Rerenders/reopens the Hledger module, without submodules. (Fastest)
# haddock-watch: \
# $(call def-help,haddock-watch3, quickly regenerate & reload Hledger.hs haddock when files change )
# watchexec -r -e yaml,cabal,hs --print-events --shell=none -- bash -c 'mkdir -p tmp && rm -f tmp/Hledger.html && haddock -h -o tmp hledger-lib/Hledger.hs --no-warnings --no-print-missing-docs 2>&1 | grep -v "Could not find documentation" && open tmp/Hledger.html'
# hoogle-setup: $(call def-help,hoogle-setup, install hoogle then build haddocks and a hoogle db for the project and all deps )
# stack hoogle --rebuild
# HOOGLEBROWSER="/Applications/Firefox Dev.app/Contents/MacOS/firefox" # safari not supported
# hoogle-serve: $(call def-help,hoogle-serve, run hoogle web app and open in browser after doing setup if needed )
# $(HOOGLEBROWSER) http://localhost:8080 &
# stack --verbosity=warn hoogle --server
# sourcegraph: \
# $(call def-help,sourcegraph,\
# \
# )
# for p in $(PACKAGES); do (cd $$p; SourceGraph $$p.cabal); done
# manuals-watch: Shake \
# $(call def-help,manuals-watch, rerender manuals when their source files change )
# ls $(DOCSOURCEFILES) | entr ./Shake -VV manuals
# man-watch: man-watch-hledger \
# $(call def-help,man-watch, run man on the hledger man page when its source file changes )
# man-watch-%: Shake \
# $(call def-help,man-watch-PROG, run man on the given man page when its source file changes. Eg make man-watch-hledger-web )
# $(WATCHEXEC) -r -w $*/$*.m4.md './Shake $*/$*.1 && man $*/$*.1'
# shakehelp-watch: \
# $(call def-help,shakehelp-watch, rerender Shake.hs's help when it changes)
# ls Shake.hs | entr -c ./Shake.hs
# The following rule, for updating the website, gets called on hledger.org by:
# 1. github-post-receive (github webhook handler), when something is pushed
# to the main or wiki repos on Github. Config:
# /etc/supervisord.conf -> [program:github-post-receive]
# /etc/github-post-receive.conf
# 2. cron, nightly. Config: /etc/crontab
# 3. manually: "make site" on hledger.org, or "make hledgerorg" elsewhere (cf Makefile.local).
# Generate packages diagrams for the hledger packages.
@packagediags:
# just packagediag hledger-lib
# just packagediag hledger
# just packagediag hledger-ui
# just packagediag hledger-web
stack exec -- ghc-pkg dot | tred | dot -Tsvg >packages.svg
# View the packages diagrams.
@packagediags-view:
# $OPEN hledger-lib/packages.svg
# $OPEN hledger/packages.svg
# $OPEN hledger-ui/packages.svg
# $OPEN hledger-web/packages.svg
$OPEN packages.svg
# # Generate a packages diagram for a hledger package.
# @packagediag PKG:
# cd && stack exec -- ghc-pkg dot | tred | dot -Tsvg >packages.svg
# Generate modules diagrams for the hledger packages.
@modulediags:
just modulediag hledger-lib
just modulediag hledger
just modulediag hledger-ui
just modulediag hledger-web
cd hledger && stack exec -- graphmod -q -c Hledger.Cli.Commands | tred | dot -Tsvg >modules-collapsed.svg
# View the modules diagrams.
@modulediags-view:
$OPEN hledger-lib/modules.svg
$OPEN hledger/modules.svg
$OPEN hledger-ui/modules.svg
$OPEN hledger-web/modules.svg
# Generate a modules diagram for a hledger package.
@modulediag PKG:
cd {{ PKG }} && stack exec -- graphmod -q | tred | dot -Tsvg >modules.svg
# optimise and commit RELEASING.png diagram after export from obsidian
@releasediag:
pngquant doc/RELEASING.png -f -o doc/RELEASING.png
git add doc/RELEASING.png
git commit -m ';doc:RELEASING.png: update' -- doc/RELEASING.png
# optimise and commit doc-update.png diagram after export from obsidian
@docupdatediag:
pngquant doc/doc-update.png -f -o doc/doc-update.png
git add doc/doc-update.png
git commit -m ';doc:doc-update.png: update' -- doc/doc-update.png
CHANGELOGS := 'CHANGES.md hledger/CHANGES.md hledger-ui/CHANGES.md hledger-web/CHANGES.md hledger-lib/CHANGES.md'
# Show changes since last release in the given CHANGES.md file or all of them. (Run after ./Shake changelogs.)
unreleased *CHANGELOG:
#!/usr/bin/env osh
if [[ -z $CHANGELOG ]]; then
for CHANGELOG in $CHANGELOGS; do
printf "** $CHANGELOG\n\n"
just unreleased $CHANGELOG
echo
done
else
awk '/^#+ /{p=1};/^#+ +[0-9]+\.[0-9].*([0-9]{4}-[0-9]{2}-[0-9]{2})/{exit};p' $CHANGELOG
fi
# Commit and push FAQ edits.
pushfaq:
(cd ~/src/hledger/site; git commit -m 'faq' src/faq.md; git push)
# Show diffs between upstream hledger tldr pages and the local copies in this repo.
tldr-diff:
# XXX JUSTFILEDIR
diff doc/tldr/upstream doc/tldr | grep hledger
# Save a copy of the full jj log showing all commits and branches.
log-save:
jj log -r:: >doc/log.txt
jj log -r:: --color=always >doc/log.color.txt
# log-headtail [y] - show the start and end of the saved log, optionally in color.
log-headtail *COLOR:
#/usr/bin/env osh
set -euo pipefail
LOG=doc/log{{ if COLOR == 'y' { ".color" } else { "" } }}.txt; \
head $LOG; echo ...; tail $LOG
# Upload a copy of the log to the website, on the side since it's large.
log-push:
scp -v doc/log*.txt 173.255.213.235:/opt/hledger/site/out
# Update the short version of the hledger script example (by removing docs).
bin-short:
awk '/^----/ { b=!b; next } !b' bin/hledger-script-example.hs | rg -v '^ *-- \w' > bin/hledger-script-example-short.hs
@site-caching-open:
$OPEN https://dash.cloudflare.com/f629035917dd3b99b1e37ae20c15ff09/hledger.org/caching/configuration
# ** Releasing ------------------------------------------------------------
RELEASING:
# These are roughly in the order they should be done during release.
# Create or switch to this release branch, and set the version string in various places.
relbranch VER:
#!/usr/bin/env bash
set -euo pipefail
[[ -z {{ VER }} ]] && usage
BRANCH=$(just _versionReleaseBranch {{ VER }})
echo "Switching to $BRANCH, auto-creating it if needed"
just _gitSwitchAutoCreate "$BRANCH"
echo "Setting {{ VER }} in package.yamls and .version.m4 macros"
./Shake setversion {{ VER }} -c
# Too much at once, allow smaller steps.
# echo "Updating all command help texts for embedding..."
# ./Shake cmddocs -c
# echo "Generating all the manuals in all formats...."
# ./Shake manuals -c
# # echo "Updating CHANGES.md files with latest commits..."
# # ./Shake changelogs $COMMIT
# update shell completions in hledger package
@completions:
make -C hledger/shell-completion/
echo "now please commit any changes in hledger/shell-completion/"