-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
42 lines (28 loc) · 902 Bytes
/
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
ANTLRDIR=/opt/homebrew/Cellar/antlr/4.13.1
ANTLRLIB=$(ANTLRDIR)/antlr-4.13.1-complete.jar
ANTLR=$(ANTLRDIR)/bin/antlr
GRUN=$(ANTLRDIR)/bin/grun
ANTLRLANG=-Dlanguage=Python3
PYTHON=python
PIP=pip
export CLASSPATH:=.:$(ANTLRLIB)
all: testgrammar pytest
testgrammar: pddl.g4
mkdir -p tmp && \
$(ANTLR) -o tmp pddl.g4 && \
cd tmp && javac *.java && \
$(GRUN) pddl domain ../examples-pddl/domain-01.pddl && \
$(GRUN) pddl problem ../examples-pddl/problem-01.pddl
pyparser: pddl.g4
mkdir -p pddlpy && \
$(ANTLR) $(ANTLRLANG) -o pddlpy pddl.g4
pytest: pyparser pddlpy/pddl.py
$(PYTHON) -m pddlpy.test
pydist: pytest
$(PIP) wheel --no-deps -w dist .
pypitest: pydist
$(PYTHON) -m twine upload --repository testpypi dist/`ls -t dist | head -1`
pypipublish: pydist
$(PYTHON) -m twine upload dist/`ls -t dist | head -1`
pydemo: pytest
for i in 1 2 3 4 6; do $(PYTHON) demo.py $$i ; done