-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (46 loc) · 1.34 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
BUCKET_NAME=toukibo-parser-samples
URL=https://pub-a26a7972d1ea437b983bf6696a7d847e.r2.dev
DATA_DIR=testdata
export NUM_SAMPLE=1330
build:
mkdir -p bin
go build -o bin/toukibo-parser main.go
run: build
./bin/toukibo-parser -mode=run -path=$(TARGET).pdf
run/sample: build
./bin/toukibo-parser -mode=run -path="$(DATA_DIR)/pdf/$(TARGET).pdf"
find/sample: build
./bin/toukibo-parser -mode=find -path="$(DATA_DIR)/pdf/$(TARGET).pdf" -target="$(FIND)"
find/all: build
./find-samples.sh
edit:
cat $(DATA_DIR)/yaml/$(TARGET).yaml
check:
make open/sample TARGET=$(TARGET)
make edit TARGET=$(TARGET)
annotate: build
./bin/toukibo-parser -mode=run -path="$(DATA_DIR)/pdf/$(TARGET).pdf" > $(DATA_DIR)/yaml/$(TARGET).yaml
make check TARGET=$(TARGET)
annotate/all: build
./annotate-samples.sh
test: build
go test -coverprofile=coverage.out -shuffle=on ./...
coverage/show:
go tool cover -html=coverage.out
zip/sample:
zip -r testdata.zip testdata
put/sample: zip/sample
wrangler r2 object delete $(BUCKET_NAME)/testdata.zip
wrangler r2 object put $(BUCKET_NAME)/testdata.zip --file testdata.zip
get/sample: clean/data
mkdir -p $(DATA_DIR)
curl -o testdata.zip $(URL)/testdata.zip
unzip testdata.zip
open/sample:
open $(DATA_DIR)/pdf/$(TARGET).pdf
clean: clean/bin clean/data
clean/bin:
rm -rf bin
clean/data:
rm -rf $(DATA_DIR)
rm -rf testdata.zip