-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (34 loc) · 1.35 KB
/
Makefile
File metadata and controls
46 lines (34 loc) · 1.35 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
.PHONY: all java_parser python_parser js_parser python_prepare_package clean test dev
all: java_parser python_parser js_parser
LIB_FLAG = -lib
LIB_PATH = uvl
ROOT_DIR = $(shell pwd)
PYTHON_OUTPUT_DIR = python/uvl
JAVASCRIPT_OUTPUT_DIR = js/src/lib
java_parser:
cd java && mvn package
cd java && mvn install
js_parser:
mkdir -p $(JAVASCRIPT_OUTPUT_DIR)
cd uvl/JavaScript && \
ANTLR4_TOOLS_ANTLR_VERSION=4.13.2 antlr4 $(LIB_FLAG) $(ROOT_DIR)/$(LIB_PATH) -Dlanguage=JavaScript -o $(ROOT_DIR)/$(JAVASCRIPT_OUTPUT_DIR) UVLJavaScriptLexer.g4 UVLJavaScriptParser.g4
python_parser:
cd uvl/Python && \
ANTLR4_TOOLS_ANTLR_VERSION=4.13.2 antlr4 $(LIB_FLAG) $(ROOT_DIR)/$(LIB_PATH) -Dlanguage=Python3 -o $(ROOT_DIR)/$(PYTHON_OUTPUT_DIR) UVLPythonLexer.g4 UVLPythonParser.g4
python_prepare_package:
cd python && python3 -m build
clean:
# Clean Java build artifacts
cd java && mvn clean
# Remove generated Python files except custom_lexer.py and main.py
find python/uvl/ -type f ! -name 'UVLCustomLexer.py' ! -name 'main.py' -delete
# Remove compiled Python files
find . -name "*.pyc" -exec rm {} \;
# Remove Python build artifacts
rm -rf python/build python/dist
# Clean JavaScript generated files
rm -rf js/src/lib
test:
python3 ./python/main.py ./tests/parsing/boolean.uvl
dev:
pip install antlr4-tools antlr4-python3-runtime setuptools wheel twine build