After gen of antlr 4.4 jar, rebuild XPathLexer with 4.4 then remake jars.

This commit is contained in:
Terence Parr 2014-07-10 21:44:54 -07:00
parent c22706135d
commit ee0345c1e2
1 changed files with 18 additions and 6 deletions

24
bild.py
View File

@ -53,7 +53,7 @@ def compile():
for t in TARGETS: for t in TARGETS:
javac(TARGETS[t]+"/tool/src", "out", version="1.6", cp=cp, args=args) javac(TARGETS[t]+"/tool/src", "out", version="1.6", cp=cp, args=args)
def mkjar(): def mkjar_complete():
require(compile) require(compile)
copytree(src="tool/resources", trg="out") # messages, Java code gen, etc... copytree(src="tool/resources", trg="out") # messages, Java code gen, etc...
manifest = \ manifest = \
@ -74,11 +74,11 @@ Created-By: http://www.bildtool.org
mkdir(trgdir) mkdir(trgdir)
copyfile(TARGETS[t]+"/tool/resources/org/antlr/v4/tool/templates/codegen/"+t+"/"+t+".stg", copyfile(TARGETS[t]+"/tool/resources/org/antlr/v4/tool/templates/codegen/"+t+"/"+t+".stg",
trgdir) trgdir)
jar("dist/antlr-"+VERSION+"-complete.jar", srcdir="out", manifest=manifest) jarfile = "dist/antlr-"+VERSION+"-complete.jar"
jar(jarfile, srcdir="out", manifest=manifest)
print "Generated "+jarfile
mkruntimejar() def mkjar_runtime():
def mkruntimejar():
# out/... dir is full of tool-related stuff, make special dir out/runtime # out/... dir is full of tool-related stuff, make special dir out/runtime
cp = uniformpath("out/runtime")+os.pathsep+ \ cp = uniformpath("out/runtime")+os.pathsep+ \
"runtime/Java/lib/org.abego.treelayout.core.jar" "runtime/Java/lib/org.abego.treelayout.core.jar"
@ -97,8 +97,20 @@ Created-By: http://www.bildtool.org
""" % (VERSION,os.getlogin()) """ % (VERSION,os.getlogin())
# unjar required library # unjar required library
unjar("runtime/Java/lib/org.abego.treelayout.core.jar", trgdir="out/runtime") unjar("runtime/Java/lib/org.abego.treelayout.core.jar", trgdir="out/runtime")
jar("dist/antlr-runtime-"+VERSION+".jar", srcdir="out/runtime", manifest=manifest) jarfile = "dist/antlr-runtime-" + VERSION + ".jar"
jar(jarfile, srcdir="out/runtime", manifest=manifest)
print "Generated "+jarfile
def mkjar():
mkjar_complete()
# put it in JARCARCHE too so bild can find it during antlr4()
copyfile(src="dist/antlr-4.4-complete.jar", trg=JARCACHE)
# rebuild/bootstrap XPath with 4.4 so it can use 4.4 runtime (gen'd with 4.3 at this point)
rmdir("gen4/org/antlr/v4/runtime/tree/xpath") # kill 4.3-generated version
antlr4("runtime/Java/src/org/antlr/v4/runtime/tree/xpath", "gen4", version="4.4", package="org.antlr.v4.runtime.tree.xpath")
compile()
mkjar_complete() # make it again with up to date XPath lexer
mkjar_runtime() # now build the runtime jar
def tests(): def tests():
require(mkjar) require(mkjar)