-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 2.47 KB
/
Makefile
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
.PHONY: run test setup bench doc pkg
build:
stack build --bench --no-run-benchmarks
test: build
stack test
singletest: build
stack test --ta '-p "Data.Katydid.Parser.Protobuf.Protobuf"'
test-trace: build
stack test --trace
bench:
stack bench
run: build
stack exec katydid-exe
fmt:
brittany --write-mode=inplace *.hs
brittany --write-mode=inplace **/*.hs
brittany --write-mode=inplace ./src/Data/Katydid/**/*.hs
brittany --write-mode=inplace ./src/Data/Katydid/Relapse/**/*.hs
regenerate:
# If this does not work, then try stack install proto-lens-setup
stack install proto-lens-protoc
# If you don't have protoc then install it https://github.com/google/proto-lens/blob/master/docs/installing-protoc.md
(cd src/Data/Katydid/Parser/Protobuf/Testdata && protoc --plugin=protoc-gen-haskell=`which proto-lens-protoc` --haskell_out=. *.proto)
(cd src/Data/Katydid/Parser/Protobuf/Testdata \
&& sed -e 's/module Proto.Phone/module Data.Katydid.Parser.Protobuf.Testdata.Proto.Phone/g' ./Proto/Phone_Fields.hs > ./Proto/Phone_Fields.hs.bak \
; mv ./Proto/Phone_Fields.hs.bak ./Proto/Phone_Fields.hs \
\
; sed -e 's/module Proto.Phone/module Data.Katydid.Parser.Protobuf.Testdata.Proto.Phone/g' ./Proto/Phone.hs > ./Proto/Phone.hs.bak \
; mv ./Proto/Phone.hs.bak ./Proto/Phone.hs \
\
; sed -e 's/module Proto.Person/module Data.Katydid.Parser.Protobuf.Testdata.Proto.Person/g' ./Proto/Person_Fields.hs > ./Proto/Person_Fields.hs.bak \
; mv ./Proto/Person_Fields.hs.bak ./Proto/Person_Fields.hs \
\
; sed -e 's/import qualified Proto.Phone/import qualified Data.Katydid.Parser.Protobuf.Testdata.Proto.Phone as Proto.Phone/g' ./Proto/Person_Fields.hs > ./Proto/Person_Fields.hs.bak \
; mv ./Proto/Person_Fields.hs.bak ./Proto/Person_Fields.hs \
\
; sed -e 's/module Proto.Person/module Data.Katydid.Parser.Protobuf.Testdata.Proto.Person/g' ./Proto/Person.hs > ./Proto/Person.hs.bak \
; mv ./Proto/Person.hs.bak ./Proto/Person.hs \
\
; sed -e 's/import qualified Proto.Phone/import qualified Data.Katydid.Parser.Protobuf.Testdata.Proto.Phone as Proto.Phone/g' ./Proto/Person.hs > ./Proto/Person.hs.bak \
; mv ./Proto/Person.hs.bak ./Proto/Person.hs)
setup:
stack setup
stack install brittany
doc:
stack haddock --haddock-arguments "--odir=./docs"
lint:
# -XNoPatternSynonyms is a temporary workaround for https://github.com/ndmitchell/hlint/issues/216
hlint -XNoPatternSynonyms .
pkg: doc
stack sdist
echo "Now upload the created file to: https://hackage.haskell.org/upload"