This repository was archived by the owner on Nov 9, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 2.16 KB
/
Copy pathMakefile
File metadata and controls
53 lines (39 loc) · 2.16 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
include default.mk
GOOD_FEATURE_FILES = $(shell find ../testdata/good -name "*.feature")
BAD_FEATURE_FILES = $(shell find ../testdata/bad -name "*.feature")
TOKENS = $(patsubst ../testdata/%,acceptance/testdata/%.tokens,$(GOOD_FEATURE_FILES))
ASTS = $(patsubst ../testdata/%,acceptance/testdata/%.ast.ndjson,$(GOOD_FEATURE_FILES))
PICKLES = $(patsubst ../testdata/%,acceptance/testdata/%.pickles.ndjson,$(GOOD_FEATURE_FILES))
SOURCES = $(patsubst ../testdata/%,acceptance/testdata/%.source.ndjson,$(GOOD_FEATURE_FILES))
ERRORS = $(patsubst ../testdata/%,acceptance/testdata/%.errors.ndjson,$(BAD_FEATURE_FILES))
.DELETE_ON_ERROR:
default: .compared
.deps: src/main/java/io/cucumber/gherkin/Parser.java
src/main/java/io/cucumber/gherkin/Parser.java: gherkin-java.razor gherkin.berp
$(berp-generate-parser)
.compared: $(TOKENS) $(ASTS) $(PICKLES) $(ERRORS) $(SOURCES)
touch $@
acceptance/testdata/%.tokens: ../testdata/% ../testdata/%.tokens .built
mkdir -p $(@D)
bin/gherkin-generate-tokens $< > $@
diff --unified $<.tokens $@
acceptance/testdata/%.ast.ndjson: ../testdata/% ../testdata/%.ast.ndjson .built
mkdir -p $(@D)
bin/gherkin --no-source --no-pickles --predictable-ids $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.ast.ndjson) <(jq "." $@)
acceptance/testdata/%.pickles.ndjson: ../testdata/% ../testdata/%.pickles.ndjson .built
mkdir -p $(@D)
bin/gherkin --no-source --no-ast --predictable-ids $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.pickles.ndjson) <(jq "." $@)
acceptance/testdata/%.source.ndjson: ../testdata/% ../testdata/%.source.ndjson .built
mkdir -p $(@D)
bin/gherkin --no-ast --no-pickles --predictable-ids $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.source.ndjson) <(jq "." $@)
acceptance/testdata/%.errors.ndjson: ../testdata/% ../testdata/%.errors.ndjson .built
mkdir -p $(@D)
bin/gherkin --no-source --predictable-ids $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.errors.ndjson) <(jq "." $@)
clean:
rm -rf .compared acceptance bin/classpath.txt
clobber: clean
rm -f src/main/java/io/cucumber/gherkin/Parser.java