antlr/bild.py

42 lines
1.2 KiB
Python
Raw Normal View History

2014-07-02 09:18:17 +08:00
import sys
import os
sys.path.append(os.path.abspath("/Users/parrt/github/bild"))
from bilder import *
2014-07-02 12:33:26 +08:00
VERSION = "4.4"
2014-07-02 09:18:17 +08:00
def parsers():
antlr3("tool/src/org/antlr/v4/parse", "gen", package="org.antlr.v4.parse")
antlr3("tool/src/org/antlr/v4/codegen", "gen", package="org.antlr.v4.codegen", args=["-lib","tool/src/org/antlr/v4/parse"])
antlr4("runtime/Java/src/org/antlr/v4/runtime/tree/xpath", "gen", package="org.antlr.v4.runtime.tree.xpath")
def compile():
2014-07-02 12:33:26 +08:00
require(parsers)
cp = uniformpath("out")+os.pathsep+\
os.path.join(JARCACHE,"antlr-3.5.1-complete.jar")+os.pathsep+\
"runtime/Java/lib/org.abego.treelayout.core.jar"
javac("runtime/JavaAnnotations/src/", "out", cp=cp)
javac("runtime/Java/src", "out", cp=cp)
javac("tool/src", "out", cp=cp)
javac("gen", "out", cp=cp)
2014-07-02 09:18:17 +08:00
def mkjar():
2014-07-02 12:33:26 +08:00
require(compile)
copytree(src="tool/resources", dst="out")
manifest = """Version: %s
Main-Class: org.antlr.v4.Tool
2014-07-02 09:18:17 +08:00
""" % VERSION
2014-07-02 12:33:26 +08:00
# copy 3.5.1 in there
unjar("runtime/Java/lib/org.abego.treelayout.core.jar", trgdir="out")
jar("dist/antlr-"+VERSION+"-complete.jar", srcdir="out", manifest=manifest)
2014-07-02 09:18:17 +08:00
def all():
2014-07-02 12:33:26 +08:00
mkjar()
2014-07-02 09:18:17 +08:00
def clean():
2014-07-02 12:33:26 +08:00
rmdir("out")
rmdir("gen")
2014-07-02 09:18:17 +08:00
2014-07-02 12:33:26 +08:00
mkjar()