-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (26 loc) · 936 Bytes
/
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
TS_FILES := $(shell find ./ -type f -name '*.ts' | grep -v 'node_modules')
HS_FILES := $(shell find ./ -type f -name '*.hs' | grep -v '.stack-work')
BZL := npx bazelisk
BZL_BIN := $(shell npx bazel info bazel-bin)
generated/go/%: build
stack exec onix-exe -- --schemaVersion $(@F) --language go
generated/ts/%: build
stack exec onix-exe -- --schemaVersion $(@F) --language typescript
debug: build
stack exec --trace -- onix-exe +RTS -xc --RTS --schemaVersion v3 --language go
.PHONY: test
test: schema
stack test --trace --fast
.stack-work: $(HS_FILES) package.yaml stack.yaml
stack build --fast
build: schema .stack-work
json: fixtures/20201200.json
fixtures/20201200.json: run
go run github.com/kogai/onix-codegen/go/helper
WORKSPACE: go.mod
$(BZL) run //:gazelle -- update-repos -from_file=go.mod
schema: schema/v2 schema/v3
schema/%:
mkdir -p schema
$(BZL) build onix_$(@F)
cp -r $(BZL_BIN)/$(@F)/ schema/$(@F)/