-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
70 lines (52 loc) · 1.36 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
61
62
63
64
65
66
67
68
69
70
PYTHONPATH := .
VENV := venv
PYMODULE := rvprio
REQUIREMENTS := -r requirements.txt
BIN := $(VENV)/bin
PIP := $(BIN)/pip
PYTHON := $(BIN)/python
PYLINT := $(BIN)/pylint
PRE_COMMIT := $(BIN)/pre-commit
PLANTUML_JAR_URL = https://sourceforge.net/projects/plantuml/files/plantuml.jar/download
PLANTUML = plantuml.jar
PMD := "rvprio/pmd"
run:
$(PYTHON) rvprio.py -i tests_struts.log -p struts -o struts.csv
bootstrap: venv \
requirements \
commit-hooks \
plugins
venv:
python3 -m venv $(VENV)
requirements:
$(PIP) install --upgrade pip
$(PIP) install $(REQUIREMENTS)
commit-hooks: pre-commit \
commit-msg
plugins: $(PMD)
$(PMD):
wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.31.0/pmd-bin-6.31.0.zip -O pmd.zip
unzip pmd.zip
mv pmd-bin-6.31.0 rvprio/pmd
rm pmd.zip
pre-commit:
$(PRE_COMMIT) install
commit-msg:
ln -s -f ../../hooks/commit-msg.sh .git/hooks/commit-msg
lint:
$(PYLINT) --verbose $(PYMODULE)
.PHONY: docs
docs: $(PLANTUML)
java -jar $(PLANTUML) docs/systemcontext.puml
java -jar $(PLANTUML) docs/rvprio.puml
.PHONY: plantuml
$(PLANTUML):
wget $(PLANTUML_JAR_URL) -O $(PLANTUML)
clean:
@find . -type d -name '__pycache__' -exec rm -rf {} +
@find . -type f -name '*.py[co]' -exec rm -rf {} +
@find . -type f -name '*.log' -exec rm -rf {} +
clean-all: clean
@rm -r $(VENV)
@rm .git/hooks/pre-commit
@rm .git/hooks/pre-commit