forked from CoinFabrik/stacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (46 loc) · 1.95 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
REPO_ROOT = .
.PHONY: venv fish bash ps1 csh install test_ci
.SILENT: unittest
# ANSI escape codes for colors
GREEN = \033[0;32m
BLUE = \033[0;34m
NC = \033[0m
default: bash
venv:
python3 -m venv venv > /dev/null 2>&1
install: venv
@echo -e "${GREEN}======== Removing previous install of Stacy ========${NC}"
./venv/bin/pip uninstall stacy-analyzer -y
@echo -e "${GREEN}======== Cloning tree-sitter grammar for Clarity ========${NC}"
git submodule update --recursive
@echo -e "${GREEN}======== Installing tree-sitter grammar for Clarity ========${NC}"
./venv/bin/pip install ts-clarity==0.0.4
@echo -e "${GREEN}======== Installing Stacy for Clarity ========${NC}"
./venv/bin/pip install $(REPO_ROOT)
test_ci: venv
@echo -e "${GREEN}======== Cloning tree-sitter grammar for Clarity ========${NC}"
git submodule update --init --remote --recursive
@echo -e "${GREEN}======== Installing tree-sitter grammar for Clarity ========${NC}"
./venv/bin/pip install ts-clarity==0.0.4
@echo -e "${GREEN}======== Installing Stacy for Clarity ========${NC}"
./venv/bin/pip install $(REPO_ROOT)
@echo -e "${GREEN}======== Testing detectors ========${NC}"
cd tests && ../venv/bin/python3 -m unittest test_module1 > $(GITHUB_WORKSPACE)/test.out 2>&1 && cd ..
unittest: venv
./venv/bin/pip uninstall stacy-analyzer -y > /dev/null 2>&1
git submodule update --recursive > /dev/null 2>&1
./venv/bin/pip install ts-clarity==0.0.4 > /dev/null 2>&1
./venv/bin/pip install $(REPO_ROOT) > /dev/null 2>&1
cd tests/ && python3 -m unittest test_module1
fish: venv
@echo -e "${BLUE}======== Using Fish shell ========${NC}"
. venv/bin/activate.fish && make install
bash: venv
@echo -e "${BLUE}======== Using Bash shell ========${NC}"
. venv/bin/activate && make install
ps1: venv
@echo -e "${BLUE}======== Using PowerShell ========${NC}"
venv\Scripts\Activate.ps1; make install
csh: venv
@echo -e "${BLUE}======== Using C shell ========${NC}"
. venv/bin/activate.csh && make install