;just: more porting, cleanups
This commit is contained in:
parent
f4156475cf
commit
7c82c54f0b
256
Justfile
256
Justfile
@ -1,19 +1,44 @@
|
|||||||
#!/usr/bin/env just
|
#!/usr/bin/env just
|
||||||
# * Light project scripts, without file dependendencies
|
# * Project scripts, using https://github.com/casey/just (last tested with 1.16.0)
|
||||||
# using https://github.com/casey/just 0.16.
|
# Usage: alias j=just, run j to list available scripts.
|
||||||
|
#
|
||||||
|
# After many years with make and plain shell and haskell for
|
||||||
|
# scripting, just is better enough, and the goal of clean consolidated
|
||||||
|
# efficient project automation is so valuable, that I am relying on it
|
||||||
|
# even though it's not installed by default.
|
||||||
|
#
|
||||||
|
# All of Makefile has been absorbed below; uncomment/update/drop
|
||||||
|
# remaining bits when needed. Makefile will be removed some time soon.
|
||||||
|
#
|
||||||
|
# just currently lacks make-style file dependency tracking. When that
|
||||||
|
# is needed for efficiency, or when more powerful code is needed, use
|
||||||
|
# Shake.hs instead of just.
|
||||||
|
#
|
||||||
|
# Lines beginning with "# * ", "# ** ", etc are section headings,
|
||||||
|
# foldable in Emacs outshine-mode. Some extra Emacs highlighting:
|
||||||
|
# (add-hook 'just-mode-hook (lambda ()
|
||||||
|
# (display-line-numbers-mode 1)
|
||||||
|
# (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)
|
||||||
|
# ))
|
||||||
|
#
|
||||||
|
# This file is formatted by `just _fmt`, which currently eats blank lines a bit.
|
||||||
|
|
||||||
|
# ** Prelude
|
||||||
|
|
||||||
|
# Reference:
|
||||||
# https://docs.rs/regex/1.5.4/regex/#syntax Regexps
|
# https://docs.rs/regex/1.5.4/regex/#syntax Regexps
|
||||||
# https://just.systems/man/en/chapter_31.html Functions
|
# https://just.systems/man/en/chapter_31.html Functions
|
||||||
# https://cheatography.com/linux-china/cheat-sheets/justfile Cheatsheet
|
# https://cheatography.com/linux-china/cheat-sheets/justfile Cheatsheet
|
||||||
# https://github.com/casey/just/discussions
|
# https://github.com/casey/just/discussions
|
||||||
# This has absorbed all of Makefile; uncomment and update remaining bits when needed.
|
|
||||||
# See also Shake.hs.
|
|
||||||
# ** prelude
|
|
||||||
|
|
||||||
@help:
|
# Invocations of just in this file assume you are in this justfile's directory,
|
||||||
just -lu
|
# since otherwise we must write --justfile {{ justfile() }} or {{ just }} everywhere.
|
||||||
|
|
||||||
# This and all other just invocations assume you are in this justfile's directory,
|
# list this justfile's recipes, optionally filtered by REGEX
|
||||||
# otherwise we must write --justfile {{ justfile() }} or {{ just }} everywhere.
|
@help *REGEX:
|
||||||
|
if [[ '{{ REGEX }}' =~ '' ]]; then just -lu; else just -lu | rg -i '{{ REGEX }}'; fi
|
||||||
|
# if [[ "$REGEX" =~ "" ]]; then just -lu; else just -lu | rg -i "$REGEX"; true; fi
|
||||||
|
|
||||||
@_check:
|
@_check:
|
||||||
just --fmt --unstable --check
|
just --fmt --unstable --check
|
||||||
@ -24,7 +49,29 @@
|
|||||||
@_watch:
|
@_watch:
|
||||||
watchexec -w {{ justfile() }} -- 'just; just -q _check && echo format ok || echo non-standard format'
|
watchexec -w {{ justfile() }} -- 'just; just -q _check && echo format ok || echo non-standard format'
|
||||||
|
|
||||||
# ** vars
|
# rerun RECIPE when any git-committed file changes
|
||||||
|
watchgit RECIPE *OPTS:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
watchexec -r --filter-file <(git ls-files) -- just $RECIPE
|
||||||
|
|
||||||
|
# show watchexec env vars when any git-committed file changes
|
||||||
|
watchgitdbg *OPTS:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
watchexec -r --filter-file <(git ls-files) {{ OPTS }} -- 'env | rg "WATCHEXEC\w*"; true'
|
||||||
|
|
||||||
|
# show watchexec env vars when any file changes, ignoring nothing and printing events
|
||||||
|
watchdbg *OPTS:
|
||||||
|
watchexec --ignore-nothing --print-events {{ OPTS }} -- 'env | rg "WATCHEXEC\w*"; true'
|
||||||
|
|
||||||
|
# Constants and recipe arguments will also be available as environment variables
|
||||||
|
# in recipes, making just code easier to convert to and from shell, so you can
|
||||||
|
# write $VAR instead of {{ VAR }}. Notes:
|
||||||
|
# They handle multi-word values differently, {{ }} is better ?
|
||||||
|
# In command lines in output, {{ }} is fully evaluated, $ is not.
|
||||||
|
set export
|
||||||
|
|
||||||
|
# ** Constants
|
||||||
|
|
||||||
# GHC-compiled executables require a locale (and not just C) or they
|
# 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.
|
# will die on encountering non-ascii data. Set LANG to something if not already set.
|
||||||
# export LANG? := 'en_US.UTF-8'
|
# export LANG? := 'en_US.UTF-8'
|
||||||
@ -115,6 +162,24 @@ SOURCEFILES := '\
|
|||||||
hledger-lib/Text/*/*hs \
|
hledger-lib/Text/*/*hs \
|
||||||
'
|
'
|
||||||
|
|
||||||
|
SOURCEFILES2 := '''
|
||||||
|
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
|
||||||
|
'''
|
||||||
|
|
||||||
# hledger-*/src/*hs \
|
# hledger-*/src/*hs \
|
||||||
|
|
||||||
HPACKFILES := '\
|
HPACKFILES := '\
|
||||||
@ -191,51 +256,51 @@ BUILDFLAGS := '-rtsopts ' + WARNINGS + GHCLOWMEMFLAGS + CABALMACROSFLAGS + ' -DD
|
|||||||
TIME := "{{ shell date +'%Y%m%d%H%M' }}"
|
TIME := "{{ shell date +'%Y%m%d%H%M' }}"
|
||||||
MONTHYEAR := "{{ shell date +'%B %Y' }}"
|
MONTHYEAR := "{{ shell date +'%B %Y' }}"
|
||||||
|
|
||||||
# ** GHCI
|
# ** ghci
|
||||||
|
|
||||||
GHCI:
|
GHCI:
|
||||||
|
|
||||||
# run GHCI on hledger-lib + hledger
|
# run ghci on hledger-lib + hledger
|
||||||
@ghci:
|
@ghci:
|
||||||
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger/Hledger/Cli.hs
|
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger/Hledger/Cli.hs
|
||||||
|
|
||||||
# run GHCI on hledger-lib + hledger with profiling/call stack information
|
# run ghci on hledger-lib + hledger with profiling/call stack information
|
||||||
@ghci-prof:
|
@ghci-prof:
|
||||||
stack build --profile hledger --only-dependencies
|
stack build --profile hledger --only-dependencies
|
||||||
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} -fexternal-interpreter -prof -fprof-auto hledger/Hledger/Cli.hs
|
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} -fexternal-interpreter -prof -fprof-auto hledger/Hledger/Cli.hs
|
||||||
|
|
||||||
# # run GHCI on hledger-lib + hledger + dev.hs script
|
# # run ghci on hledger-lib + hledger + dev.hs script
|
||||||
# @ghci-dev:
|
# @ghci-dev:
|
||||||
# {{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} -fno-warn-unused-imports -fno-warn-unused-binds dev.hs
|
# {{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} -fno-warn-unused-imports -fno-warn-unused-binds dev.hs
|
||||||
|
|
||||||
# run GHCI on hledger-lib + hledger + hledger-ui
|
# run ghci on hledger-lib + hledger + hledger-ui
|
||||||
@ghci-ui:
|
@ghci-ui:
|
||||||
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger-ui/Hledger/UI/Main.hs
|
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger-ui/Hledger/UI/Main.hs
|
||||||
|
|
||||||
# run GHCI on hledger-lib + hledger + hledger-web
|
# run ghci on hledger-lib + hledger + hledger-web
|
||||||
@ghci-web:
|
@ghci-web:
|
||||||
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger-web/app/main.hs
|
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger-web/app/main.hs
|
||||||
|
|
||||||
# run GHCI on hledger-lib + hledger + hledger-web + hledger-web test suite
|
# run ghci on hledger-lib + hledger + hledger-web + hledger-web test suite
|
||||||
@ghci-web-test:
|
@ghci-web-test:
|
||||||
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger-web/test/test.hs
|
{{ STACKGHCI }} exec -- {{ GHCI }} {{ BUILDFLAGS }} hledger-web/test/test.hs
|
||||||
|
|
||||||
# # better than stack exec ?
|
# # better than stack exec ?
|
||||||
# # XXX does not see changes to files
|
# # XXX does not see changes to files
|
||||||
# # run GHCI on hledger-lib + test runner
|
# # run ghci on hledger-lib + test runner
|
||||||
# ghci-lib-test:
|
# ghci-lib-test:
|
||||||
# {{ STACKGHCI }} ghci --ghc-options="\'-rtsopts {{ WARNINGS }} -ihledger-lib -DDEVELOPMENT -DVERSION=\"1.26.99\"\'" hledger-lib/test/unittest.hs
|
# {{ STACKGHCI }} ghci --ghc-options="\'-rtsopts {{ WARNINGS }} -ihledger-lib -DDEVELOPMENT -DVERSION=\"1.26.99\"\'" hledger-lib/test/unittest.hs
|
||||||
# run GHCI on all the hledger
|
# run ghci on all the hledger
|
||||||
# ghci-all:
|
# ghci-all:
|
||||||
# {{ STACK }} exec -- {{ GHCI }} {{ BUILDFLAGS }} \
|
# {{ STACK }} exec -- {{ GHCI }} {{ BUILDFLAGS }} \
|
||||||
# hledger-ui/Hledger/UI/Main.hs \
|
# hledger-ui/Hledger/UI/Main.hs \
|
||||||
# hledger-web/app/main.hs \
|
# hledger-web/app/main.hs \
|
||||||
|
|
||||||
# run GHCI on hledger-lib doctests
|
# run ghci on hledger-lib doctests
|
||||||
@ghci-doctest:
|
@ghci-doctest:
|
||||||
cd hledger-lib; {{ STACKGHCI }} ghci hledger-lib:test:doctest
|
cd hledger-lib; {{ STACKGHCI }} ghci hledger-lib:test:doctest
|
||||||
|
|
||||||
# run GHCI on Shake.hs
|
# run ghci on Shake.hs
|
||||||
@ghci-shake:
|
@ghci-shake:
|
||||||
{{ STACK }} exec {{ SHAKEDEPS }} -- ghci Shake.hs
|
{{ STACK }} exec {{ SHAKEDEPS }} -- ghci Shake.hs
|
||||||
|
|
||||||
@ -318,11 +383,11 @@ ghcid-shake:
|
|||||||
# dev-heap-upload:
|
# dev-heap-upload:
|
||||||
# curl -F "file=@devprof-hc.hp" -F "title='hledger parser'" http://heap.ezyang.com/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
|
# curl -F "file=@devprof-hr.hp" -F "title='hledger parser'" http://heap.ezyang.com/upload
|
||||||
# ** building
|
# ** Building
|
||||||
|
|
||||||
BUILDING:
|
BUILDING:
|
||||||
|
|
||||||
# build the hledger package showing GHC codegen times/allocations
|
# build the hledger package showing ghc codegen times/allocations
|
||||||
@buildtimes:
|
@buildtimes:
|
||||||
time ({{ STACK }} build hledger --force-dirty --ghc-options='-fforce-recomp -ddump-timings' 2>&1 | grep -E '\bCodeGen \[.*time=')
|
time ({{ STACK }} build hledger --force-dirty --ghc-options='-fforce-recomp -ddump-timings' 2>&1 | grep -E '\bCodeGen \[.*time=')
|
||||||
|
|
||||||
@ -343,7 +408,7 @@ BUILDING:
|
|||||||
# # build "bin/hledgercov" for coverage reports (with ghc)
|
# # build "bin/hledgercov" for coverage reports (with ghc)
|
||||||
# hledgercov:
|
# hledgercov:
|
||||||
# {{ STACK }} ghc {{ MAIN }} -fhpc -o bin/hledgercov -outputdir .hledgercovobjs {{ BUILDFLAGS }}
|
# {{ STACK }} ghc {{ MAIN }} -fhpc -o bin/hledgercov -outputdir .hledgercovobjs {{ BUILDFLAGS }}
|
||||||
# ** testing
|
# ** Testing
|
||||||
|
|
||||||
TESTING:
|
TESTING:
|
||||||
|
|
||||||
@ -460,7 +525,7 @@ ADDONEXTS := 'pl py rb sh hs lhs rkt exe com bat'
|
|||||||
installtest:
|
installtest:
|
||||||
cd; {{ justfile_directory() }}/hledger-install/hledger-install.sh
|
cd; {{ justfile_directory() }}/hledger-install/hledger-install.sh
|
||||||
|
|
||||||
# ** benchmarking
|
# ** Benchmarking
|
||||||
|
|
||||||
BENCHMARKING:
|
BENCHMARKING:
|
||||||
|
|
||||||
@ -490,10 +555,8 @@ samplejournals:
|
|||||||
|
|
||||||
BENCHEXES := 'hledger'
|
BENCHEXES := 'hledger'
|
||||||
|
|
||||||
bench: quickbench
|
|
||||||
|
|
||||||
# run benchmark commands in bench.sh for each of BENCHEXES, with quickbench
|
# run benchmark commands in bench.sh for each of BENCHEXES, with quickbench
|
||||||
@quickbench:
|
@bench:
|
||||||
printf "Running benchmarks with {{ BENCHEXES }} (times are approximate, can be skewed):\n"
|
printf "Running benchmarks with {{ BENCHEXES }} (times are approximate, can be skewed):\n"
|
||||||
which quickbench >/dev/null && quickbench -w {{ BENCHEXES }} || echo "quickbench not installed (see bench.sh), skipping"
|
which quickbench >/dev/null && quickbench -w {{ BENCHEXES }} || echo "quickbench not installed (see bench.sh), skipping"
|
||||||
|
|
||||||
@ -596,9 +659,9 @@ bench: quickbench
|
|||||||
# # view the last html code coverage report\
|
# # view the last html code coverage report\
|
||||||
# # )
|
# # )
|
||||||
# # $(VIEWHTML) doc/profs/coverage/index.html
|
# # $(VIEWHTML) doc/profs/coverage/index.html
|
||||||
# ** documentation
|
# ** Documenting
|
||||||
|
|
||||||
DOCUMENTATION:
|
DOCUMENTING:
|
||||||
|
|
||||||
# see also Shake.hs
|
# see also Shake.hs
|
||||||
# http://www.haskell.org/haddock/doc/html/invoking.html
|
# http://www.haskell.org/haddock/doc/html/invoking.html
|
||||||
@ -689,7 +752,7 @@ haddock-open:
|
|||||||
# @make -s Shake
|
# @make -s Shake
|
||||||
# @(printf "\nbrowser will open in $(BROWSEDELAY)s (adjust BROWSE in Makefile if needed)...\n\n"; sleep $(BROWSEDELAY); $(BROWSE) $(LOCALSITEURL)) &
|
# @(printf "\nbrowser will open in $(BROWSEDELAY)s (adjust BROWSE in Makefile if needed)...\n\n"; sleep $(BROWSEDELAY); $(BROWSE) $(LOCALSITEURL)) &
|
||||||
# @$(WATCHEXEC) --print-events -e md,m4 -i hledger.md -i hledger-ui.md -i hledger-web.md -r './Shake webmanuals && ./Shake orgfiles && make -sC site serve'
|
# @$(WATCHEXEC) --print-events -e md,m4 -i hledger.md -i hledger-ui.md -i hledger-web.md -r './Shake webmanuals && ./Shake orgfiles && make -sC site serve'
|
||||||
# ** installing
|
# ** Installing
|
||||||
|
|
||||||
INSTALLING:
|
INSTALLING:
|
||||||
|
|
||||||
@ -707,7 +770,7 @@ INSTALLING:
|
|||||||
# # update shell completions in hledger package
|
# # update shell completions in hledger package
|
||||||
# shellcompletions:
|
# shellcompletions:
|
||||||
# make -C hledger/shell-completion/ clean-all all
|
# make -C hledger/shell-completion/ clean-all all
|
||||||
# ** releasing
|
# ** Releasing
|
||||||
|
|
||||||
RELEASING:
|
RELEASING:
|
||||||
|
|
||||||
@ -889,24 +952,43 @@ _gitSwitchAutoCreate BRANCH:
|
|||||||
# # @echo Commits since last release:
|
# # @echo Commits since last release:
|
||||||
# # @darcs changes --from-tag $(FROMTAG) --count
|
# # @darcs changes --from-tag $(FROMTAG) --count
|
||||||
# # @echo
|
# # @echo
|
||||||
# describe: $(call def-help,describe, show a precise git-describe version string )
|
|
||||||
# @git describe --tags --match 'hledger-[0-9]*' --dirty
|
# show a precise git-describe version string
|
||||||
# # showreleaseauthors: $(call def-help,showreleaseauthors, show author names since last release)
|
@describe:
|
||||||
# # @echo Commit authors since last release:
|
git describe --tags --match 'hledger-[0-9]*' --dirty
|
||||||
# # @git shortlog -sn $(CHANGELOGSTART).. # TODO undefined
|
|
||||||
# showauthors: $(call def-help,showauthors, show all commit author names)
|
# show commit author names since last release
|
||||||
# @echo "Commit authors ($$(git shortlog -sn | wc -l | awk '{print $$1}'))":
|
@authors-release:
|
||||||
# @git shortlog -sn
|
echo "Commit authors since last release:"
|
||||||
# cloc: $(call def-help,cloc, count lines of source code )
|
git shortlog -sn `git tag --sort=-creatordate -l '[0-9]*' | head -1`..
|
||||||
# @echo Lines of code including tests:
|
|
||||||
# @cloc --exclude-lang=HTML --exclude-dir=.stack-work,.idea,dist,old,bin,doc,site,.tutorial-data,static,angular .
|
# show all commit author names
|
||||||
# SCC=scc -z --cocomo-project-type semi-detached -f wide -s code
|
@authors:
|
||||||
# scc: $(call def-help,scc, count lines of source code with scc)
|
echo "Commit authors ($(git shortlog -sn | wc -l | awk '{print $1}'))":
|
||||||
# @echo Lines of code including tests:
|
git shortlog -sn
|
||||||
# @$(SCC) -i hs,sh,m4,hamlet
|
|
||||||
# sccv: $(call def-help,sccv, count lines of source code with scc showing all files)
|
# show all commit author names and emails
|
||||||
# @echo Lines of code including tests:
|
@authorsv:
|
||||||
# @$(SCC) -i hs,sh,m4,hamlet --by-file
|
echo "Commit authors ($(git shortlog -sn | wc -l | awk '{print $1}'))":
|
||||||
|
git shortlog -sne
|
||||||
|
|
||||||
|
# count lines of code with cloc
|
||||||
|
@cloc:
|
||||||
|
echo "Lines of code including tests:"
|
||||||
|
cloc --exclude-lang=HTML --exclude-dir=.stack-work,.idea,dist,old,bin,doc,site,.tutorial-data,static,angular .
|
||||||
|
|
||||||
|
SCC := 'scc -z --cocomo-project-type semi-detached -f wide -s code'
|
||||||
|
|
||||||
|
# count lines of code with scc
|
||||||
|
@scc:
|
||||||
|
echo Lines of code including tests:
|
||||||
|
$SCC -i hs,sh,m4,hamlet
|
||||||
|
|
||||||
|
# count lines of code with scc showing all files
|
||||||
|
@sccv:
|
||||||
|
echo Lines of code including tests:
|
||||||
|
$SCC -i hs,sh,m4,hamlet --by-file
|
||||||
|
|
||||||
# # `ls $(SOURCEFILES)`
|
# # `ls $(SOURCEFILES)`
|
||||||
# # sloc: \
|
# # sloc: \
|
||||||
# # $(call def-help,sloc,\
|
# # $(call def-help,sloc,\
|
||||||
@ -980,7 +1062,7 @@ _gitSwitchAutoCreate BRANCH:
|
|||||||
# @open 'https://github.com/NixOS/nixpkgs/commits/master/pkgs/development/haskell-modules/hackage-packages.nix'
|
# @open 'https://github.com/NixOS/nixpkgs/commits/master/pkgs/development/haskell-modules/hackage-packages.nix'
|
||||||
# list-commits: $(call def-help,list-commits, list all commits chronologically and numbered)
|
# list-commits: $(call def-help,list-commits, list all commits chronologically and numbered)
|
||||||
# @git log --format='%ad %h %s (%an)' --date=short --reverse | cat -n
|
# @git log --format='%ad %h %s (%an)' --date=short --reverse | cat -n
|
||||||
# ** misc
|
# ** Misc
|
||||||
|
|
||||||
MISC:
|
MISC:
|
||||||
|
|
||||||
@ -1052,45 +1134,43 @@ mkwebdirs:
|
|||||||
for p in ledger hledger beancount; do git -C ../$p log --format="%cd (%h) %s%n ($p) 1%n" --date=short --reverse >> project-commits.j; done
|
for p in ledger hledger beancount; do git -C ../$p log --format="%cd (%h) %s%n ($p) 1%n" --date=short --reverse >> project-commits.j; done
|
||||||
echo "wrote project-commits.j"
|
echo "wrote project-commits.j"
|
||||||
|
|
||||||
# ###############################################################################
|
# symlink tools/commitlint as .git/hooks/commit-msg
|
||||||
# $(call def-help-subheading,MISCELLANEOUS:)
|
installcommithook:
|
||||||
# installcommithook: $(call def-help,installcommithook, symlink tools/commitlint as .git/hooks/commit-msg)
|
ln -s ../../tools/commitlint .git/hooks/commit-msg
|
||||||
# ln -s ../../tools/commitlint .git/hooks/commit-msg
|
|
||||||
# watch-%: $(call def-help,watch-RULE, run make RULE repeatedly when any committed file changes)
|
|
||||||
# @git ls-files | entr -r make $*
|
|
||||||
# Shake: Shake.hs $(call def-help,Shake, ensure the Shake script is compiled )
|
# Shake: Shake.hs $(call def-help,Shake, ensure the Shake script is compiled )
|
||||||
# ./Shake.hs
|
# ./Shake.hs
|
||||||
# usage: cabalusage stackusage \
|
|
||||||
# $(call def-help,usage, show size of various dirs )
|
# show some big directory sizes
|
||||||
# du -sh .git bin data doc extra
|
@usage:
|
||||||
# du -sh .
|
-du -sh .git bin data doc extra `find . -name '.stack*' -prune -o -name 'dist' -prune -o -name 'dist-newstyle' -prune` 2>/dev/null | sort -hr
|
||||||
# stackusage: \
|
|
||||||
# $(call def-help,stackusage, show size of stack working dirs if any )
|
# Tags:
|
||||||
# -du -shc `find . -name '.stack*'`
|
# 1. haskell source files with hasktags
|
||||||
# cabalusage: \
|
# 2. other source files recognised by (exuberant) ctags and not excluded by .ctags. Keep .ctags up to date.
|
||||||
# $(call def-help,cabalusage, show size of cabal working dirs if any )
|
# 3. some extra files missed by the above, as just their file names (for tags-search, tags-query-replace etc.)
|
||||||
# -du -shc */dist* 2>/dev/null
|
# generate emacs TAGS file for haskell source and other project files, and list the tagged files in TAGS.files
|
||||||
# # Generate an emacs TAGS file. Tag:
|
@etags:
|
||||||
# # 1. haskell source files with hasktags
|
hasktags -e {{ SOURCEFILES }}
|
||||||
# # 2. other source files recognised by (exuberant) ctags and not excluded by .ctags. Keep .ctags up to date.
|
# ctags -a -e -R
|
||||||
# # 3. some extra files missed by the above, as just their file names (for tags-search, tags-query-replace etc.)
|
# for f in \
|
||||||
# etags:$(call def-help,etags, generate emacs TAGS file for haskell source and other project files )
|
# $WEBTEMPLATEFILES \
|
||||||
# hasktags -e $(SOURCEFILES)
|
# $DOCSOURCEFILES \
|
||||||
# ctags -a -e -R
|
# $TESTFILES \
|
||||||
# for f in \
|
# $HPACKFILES \
|
||||||
# $(WEBTEMPLATEFILES) \
|
# $CABALFILES \
|
||||||
# $(DOCSOURCEFILES) \
|
# Shake.hs \
|
||||||
# $(TESTFILES) \
|
# ; do printf "\n$f,1\n" >> TAGS; done
|
||||||
# $(HPACKFILES) \
|
# -just etags-ls >TAGS.files
|
||||||
# $(CABALFILES) \
|
|
||||||
# Shake.hs \
|
# list the files tagged in TAGS
|
||||||
# ; do printf "\n$$f,1\n" >> TAGS; done
|
@etags-ls:
|
||||||
# -etagsls >TAGS.files
|
rg -v '[ ]' TAGS | rg -r '$1' '^(.*?)([0-9]+)?,[0-9,]+*'
|
||||||
# etags-ls: # list files indexed in TAGS
|
|
||||||
# @rg -v '[ ]' TAGS | rg -r '$$1' '^(.*?)([0-9]+)?,[0-9,]+*'
|
# remove TAGS files
|
||||||
# cleantags: \
|
@etags-clean:
|
||||||
# $(call def-help-hide,cleantags, remove tag files )
|
rm -f TAGS TAGS.files
|
||||||
# rm -f TAGS tags
|
|
||||||
# stackclean: \
|
# stackclean: \
|
||||||
# $(call def-help-hide,stackclean, remove .stack-work/ dirs )
|
# $(call def-help-hide,stackclean, remove .stack-work/ dirs )
|
||||||
# $(STACK) purge
|
# $(STACK) purge
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user