-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (54 loc) · 1.72 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
tator-openapi-schema.yaml:
curl -s -L https://cloud.tator.io/schema > tator-openapi-schema.yaml
.PHONY: copy-files
copy-files:
mkdir -p pkg/src
cp -r src/examples pkg/examples
cp -r src/utils pkg/src/utils
cp -r src/annotator pkg/src/annotator
cp README.md pkg/.
rm -rf pkg/test && cp -r test pkg/test
pkg/src/index.js: tator-openapi-schema.yaml $(shell find templates -name "*.mustache")
rm -rf pkg
mkdir pkg
$(MAKE) copy-files
./codegen.py tator-openapi-schema.yaml
docker run --rm \
-v $(shell pwd):/pwd \
openapitools/openapi-generator-cli:v6.1.0 \
generate -c /pwd/config.json \
-i /pwd/tator-openapi-schema.yaml \
-g javascript -o /pwd/pkg -t /pwd/templates
docker run --rm \
-v $(shell pwd):/pwd \
openapitools/openapi-generator-cli:v6.1.0 \
chmod -R 777 /pwd/pkg
cd pkg && npm uninstall mocha
cd pkg && npm install
cd pkg && npm install -D @playwright/test isomorphic-fetch fetch-retry \
spark-md5 uuid
# Add dependencies for
cd pkg && npm install querystring \
webpack \
webpack-cli@^5.0.1 \
earcut@^2.2.4 \
terser@^5.27.2 \
--save-dev
pkg/dist/tator.js: pkg/src/index.js $(shell find src/ -name "*.js")
$(MAKE) copy-files
cp src/webpack.dev.js pkg/.
cd pkg && npx webpack --config webpack.dev.js
pkg/dist/tator.min.js: pkg/src/index.js $(shell find src/ -name "*.js")
$(MAKE) copy-files
cp src/webpack.prod.js pkg/.
cd pkg && npx webpack --config webpack.prod.js
.PHONY: all
all: pkg/dist/tator.js pkg/dist/tator.min.js
.PHONY: clean
clean:
rm -rf pkg
rm -f tator-openapi-schema.yaml