forked from anton-k/purescript-cardano-serialization-lib
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
54 lines (42 loc) · 1.45 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
.PHONY: build test run watch serve format check-format code-gen copy
nix-sources := $(shell fd --no-ignore-parent -enix --exclude='spago*')
js-sources := $(shell fd --no-ignore-parent -ejs -ecjs)
esbuild-cmd := "esbuild \
./output/Main/index.js \
--bundle \
--outfile=demo/src/purs.js \
--platform=browser \
--format=esm \
--external:@emurgo/cardano-serialization-lib-browser"
build:
spago build
test:
spago test
run:
spago build --then ${esbuild-cmd}
watch:
spago build --then ${esbuild-cmd} --watch
serve: run
(cd demo && npm run build && npm run serve)
format:
@purs-tidy format-in-place "src/**/*.purs"
@purs-tidy format-in-place "test/**/*.purs"
@nixpkgs-fmt ${nix-sources}
@prettier -w ${js-sources}
@make check-format
check-format:
@purs-tidy check "src/**/*.purs"
@purs-tidy check "test/**/*.purs"
@nixpkgs-fmt --check ${nix-sources}
@prettier --log-level warn -c ${js-sources}
@eslint --quiet ${js-sources} --parser-options 'sourceType: module'
code-gen:
cd code-gen/parse-csl && make run
copy:
cp code-gen/parse-csl/output/Lib.js src/Cardano/Serialization/Lib.js
cp code-gen/parse-csl/output/Lib.purs src/Cardano/Serialization/Lib.purs
cp code-gen/parse-csl/output/Lib/Internal.purs src/Cardano/Serialization/Lib/Internal.purs
cp code-gen/parse-csl/output/Lib/Internal.js src/Cardano/Serialization/Lib/Internal.js
ci-actions:
nix build -L .#checks.x86_64-linux.formatting-check
nix build -L .#checks.x86_64-linux.tests