-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
162 lines (129 loc) · 3.93 KB
/
Makefile
File metadata and controls
162 lines (129 loc) · 3.93 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
export PYTHONPATH = $(CURDIR)
MYPY_FLAGS += --package codegra_fs
PYLINT_FLAGS += --rcfile=setup.cfg codegra_fs
YAPF_FLAGS += --recursive --parallel codegra_fs
ISORT_FLAGS += --recursive codegra_fs
TEST_FILE ?= test/
TEST_FLAGS += -vvv
VERSION = $(shell node -e 'console.log(require("./package.json").version)')
UNAME = $(shell python ./.scripts/get_os.py)
.PHONY: run
run: install
npm run dev
.PHONY: install-deps
install-deps: node_modules/.install-deps
pip install -r requirements.txt
pip install -r requirements-$(UNAME).txt
node_modules/.install-deps: package.json
npm ci
date >$@
.PHONY: install
install: install-deps env/bin/cgfs env/bin/cgapi-consumer
env/bin/%: setup.py codegra_fs/*.py
pip install .
.PHONY: mypy
mypy: install-deps
mypy $(MYPY_FLAGS)
.PHONY: lint
lint: install-deps
pylint $(PYLINT_FLAGS)
npm run lint
.PHONY: format
format: install-deps
yapf --in-place $(YAPF_FLAGS)
isort $(ISORT_FLAGS)
npm run format
.PHONY: check-format
check-format: install-deps
yapf --diff $(YAPF_FLAGS)
isort --check-only $(ISORT_FLAGS)
npm run check-format
.PHONY: test
test: install
coverage erase
pytest $(TEST_FILE) $(TEST_FLAGS)
coverage report -m codegra_fs/cgfs.py
npm run unit
.PHONY: travis_test
travis_test:
npm run unit
coverage erase
pytest $(TEST_FILE) $(TEST_FLAGS)
coverage report -m codegra_fs/cgfs.py
.PHONY: test-quick
test-quick: TEST_FLAGS += -x
test-quick: test
.PHONY: check
check: check-format mypy lint test
.PHONY: build
build: install check build-$(UNAME)
.PHONY: build-quick
build-quick: install build-$(UNAME)
dist/cgfs: codegra_fs/*.py
pyinstaller \
--noconfirm \
--onedir \
--specpath dist \
--additional-hooks-dir=./pyinstaller_hooks \
--name cgfs \
codegra_fs/cgfs.py
dist/cgapi-consumer: codegra_fs/*.py
pyinstaller \
--noconfirm \
--onedir \
--specpath dist \
--additional-hooks-dir=./pyinstaller_hooks \
--name cgapi-consumer \
codegra_fs/api_consumer.py
.PHONY: build-darwin
build-darwin: dist/CodeGrade\ Filesystem\ $(VERSION).pkg
.PHONY: dist/CodeGrade Filesystem $(VERSION).pkg
dist/CodeGrade\ Filesystem\ $(VERSION).pkg: dist/mac | build/pkg-scripts/osxfuse.pkg
pkgbuild --root dist/mac \
--install-location /Applications \
--component-plist build/com.codegrade.codegrade-fs.plist \
--scripts build/pkg-scripts \
"$@"
build/pkg-scripts/osxfuse.pkg:
bash ./.scripts/get_macfuse.bash
.PHONY: dist/mac
dist/mac: dist/cgfs dist/cgapi-consumer
npm run build:mac
.PHONY: build-win
build-win:
python .\build.py
.PHONY: build-linux
build-linux: build-linux-deb
python .scripts/make_install_linux_script.py
.PHONY: build-linux-deb
build-linux-deb: build-linux-deb-frontend build-linux-deb-backend
.PHONY: build-linux-deb-frontend
build-linux-deb-frontend: dist/codegrade-fs_$(VERSION)_amd64.deb dist/codegrade-fs_$(VERSION)_i386.deb
.PHONY: dist/codegrade-fs_$(VERSION)_amd64.deb
dist/codegrade-fs_$(VERSION)_amd64.deb:
npm run build:linux:x64
.PHONY: dist/codegrade-fs_$(VERSION)_i386.deb
dist/codegrade-fs_$(VERSION)_i386.deb:
npm run build:linux:ia32
.PHONY: build-linux-deb-backend
build-linux-deb-backend: dist/python3-codegrade-fs_$(VERSION)-1_all.deb
.PHONY: dist/python3-codegrade-fs_$(VERSION)-1_all.deb
dist/python3-codegrade-fs_$(VERSION)-1_all.deb: dist/python3-fusepy_3.0.1-1_all.deb build/deb.patch
dpkg -s python3-fusepy || sudo dpkg -i dist/python3-fusepy_3.0.1-1_all.deb
trap 'rm -rf codegrade_fs.egg-info codegrade-fs-$(VERSION).tar.gz;' 0 1 2 3 15; \
python setup.py --command-packages=stdeb.command bdist_deb
mkdir -p dist
mv deb_dist/*.deb dist
build/deb.patch: codegra_fs/*.py
build/make-deb-patch.sh
dist/python3-fusepy_3.0.1-1_all.deb:
mkdir -p dist
curl -L -o "$@" 'http://ftp.us.debian.org/debian/pool/main/p/python-fusepy/python3-fusepy_3.0.1-1_all.deb'
.PHONY: docs
docs: install-deps-docs
$(MAKE) -C docs html
.PHONY: install-deps-docs
install-deps-docs: env/.install-deps-docs
env/.install-deps-docs: requirements-docs.txt | env
pip install -r $^
date >$@