Skip to content

Commit

Permalink
added release target to Makefile and updated README for release info.…
Browse files Browse the repository at this point in the history
… Also added a VERSION.txt file
  • Loading branch information
godber committed Jan 18, 2015
1 parent ee96de2 commit 22a0a47
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,33 @@ This project includes a simple `test.sh` script that will loop over all
`*.lbl` files in the `data/` directory, excluding files with `invalid`
in the name. It will run the TestRig diagnostics function. If there
are no lexing or parsing errors, this will generate no output. Only
errors will generate output.
errors will generate output. See more in the **Developing** section.

*Note* that this is just a simple 'smoke test', it only indicates whether
**Note** that this is just a simple 'smoke test', it only indicates whether
or not the sample inputs lex and parse cleanly. It does not guarantee
that the parse trees or tokens are what they should be. More rigorous
testing could use the `tokenrun` and `treerun` functions. I will
probably be doing my testing at a higher level, at the python parser
level, where better testing tools are available.

## Releasing

At this point, I consider the generated Python code to be the release
product. However, these are not stored in the repo since they are
entirely generated products.

```
# Finish work and commit changes
# Update VERSION.txt
# Generates python code and makes the release tarball
make release
# Tag repo with version
git tag `cat VERSION.txt`
# Push repo
git push
# Manually upload tarball to github.
```

## Developing

The general development workflow is
Expand Down Expand Up @@ -91,6 +109,6 @@ Running the following:
guirun data/dates.lbl
```

will yeild:
will yield:

![Dates Parse Tree](/antlr_grammar/dates_gui.png?raw=true)
2 changes: 2 additions & 0 deletions antlr_grammar/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build-java
build-python
build
release
23 changes: 20 additions & 3 deletions antlr_grammar/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
antlr4 := java -jar /usr/local/lib/antlr-4.4-complete.jar

all: clean build-python build-java/ODLv21Lexer.java
PYTARGETS = build-python/ODLv21Lexer.py build-python/ODLv21Lexer.tokens \
build-python/ODLv21Listener.py build-python/ODLv21Parser.py \
build-python/ODLv21.tokens

# Release version used by release targets
VERSION = $(strip $(shell cat VERSION.txt))
PYVERSIONDIR = pds3_python-$(VERSION)
PYBUILDDIR = build/$(PYVERSIONDIR)

all: clean $(PYTARGETS) build-java/ODLv21Lexer.java
javac build-java/*.java

build-python: ODLv21.g4
$(PYTARGETS): ODLv21.g4
$(antlr4) ODLv21.g4 -o build-python -Dlanguage=Python2

build-java/ODLv21Lexer.java: ODLv21.g4
$(antlr4) ODLv21.g4 -o build-java

pds3_python.tar.gz: $(PYTARGETS)
mkdir -p $(PYBUILDDIR)
cp $(PYTARGETS) $(PYBUILDDIR)
cd build; tar -czf $@ $(PYVERSIONDIR); cd ..

release: pds3_python.tar.gz
mkdir -p release
mv build/pds3_python.tar.gz release/pds3_python-$(VERSION).tar.gz

.PHONY: clean
clean:
rm -rf build-java build-python
rm -rf build-java build-python build
1 change: 1 addition & 0 deletions antlr_grammar/VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.9.0

0 comments on commit 22a0a47

Please sign in to comment.