forked from jasder/antlr
make runtime jar and minimal runtime jar, improve manifests. Fixes #576
This commit is contained in:
parent
d6c1fa152d
commit
74573c2eed
40
bild.py
40
bild.py
|
@ -50,9 +50,14 @@ def mkjar():
|
||||||
require(compile)
|
require(compile)
|
||||||
copytree(src="tool/resources", dst="out") # messages, Java code gen, etc...
|
copytree(src="tool/resources", dst="out") # messages, Java code gen, etc...
|
||||||
manifest = \
|
manifest = \
|
||||||
"""Version: %s
|
"""Main-Class: org.antlr.v4.Tool
|
||||||
Main-Class: org.antlr.v4.Tool
|
Implementation-Vendor: ANTLR
|
||||||
""" % VERSION
|
Implementation-Title: ANTLR 4 Tool
|
||||||
|
Implementation-Version: %s
|
||||||
|
Built-By: %s
|
||||||
|
Build-Jdk: 1.6
|
||||||
|
Created-By: http://www.bildtool.org
|
||||||
|
""" % (VERSION,os.getlogin())
|
||||||
# unjar required libraries
|
# unjar required libraries
|
||||||
unjar("runtime/Java/lib/org.abego.treelayout.core.jar", trgdir="out")
|
unjar("runtime/Java/lib/org.abego.treelayout.core.jar", trgdir="out")
|
||||||
unjar(os.path.join(JARCACHE,"antlr-3.5.1-complete.jar"), trgdir="out")
|
unjar(os.path.join(JARCACHE,"antlr-3.5.1-complete.jar"), trgdir="out")
|
||||||
|
@ -64,6 +69,35 @@ Main-Class: org.antlr.v4.Tool
|
||||||
trgdir)
|
trgdir)
|
||||||
jar("dist/antlr-"+VERSION+"-complete.jar", srcdir="out", manifest=manifest)
|
jar("dist/antlr-"+VERSION+"-complete.jar", srcdir="out", manifest=manifest)
|
||||||
|
|
||||||
|
mkruntimejar()
|
||||||
|
|
||||||
|
def mkruntimejar():
|
||||||
|
# out/... dir is full of tool-related stuff, make special dir out/runtime
|
||||||
|
cp = uniformpath("out/runtime")+os.pathsep+ \
|
||||||
|
"runtime/Java/lib/org.abego.treelayout.core.jar"
|
||||||
|
args = ["-Xlint", "-Xlint:-serial", "-g"]
|
||||||
|
javac("runtime/JavaAnnotations/src/", "out/runtime", version="1.6", cp=cp, args=args)
|
||||||
|
javac("runtime/Java/src", "out/runtime", version="1.6", cp=cp, args=args)
|
||||||
|
manifest = \
|
||||||
|
"""Implementation-Vendor: ANTLR
|
||||||
|
Implementation-Title: ANTLR 4 Runtime
|
||||||
|
Implementation-Version: %s
|
||||||
|
Built-By: %s
|
||||||
|
Build-Jdk: 1.6
|
||||||
|
Created-By: http://www.bildtool.org
|
||||||
|
""" % (VERSION,os.getlogin())
|
||||||
|
# unjar required library
|
||||||
|
unjar("runtime/Java/lib/org.abego.treelayout.core.jar", trgdir="out/runtime")
|
||||||
|
jar("dist/antlr-runtime-"+VERSION+".jar", srcdir="out/runtime", manifest=manifest)
|
||||||
|
|
||||||
|
# now remove org/antlr/v4/runtime/tree/gui/* and tree lib to make minimal jar
|
||||||
|
rmdir("out/runtime/org/antlr/v4/runtime/tree/gui")
|
||||||
|
rmdir("out/runtime/org/abego")
|
||||||
|
rmdir("out/runtime/META-INF/maven")
|
||||||
|
manifest = manifest.replace("ANTLR 4 Runtime", "ANTLR 4 Min Runtime")
|
||||||
|
jar("dist/antlr-min-runtime-"+VERSION+".jar", srcdir="out/runtime", manifest=manifest)
|
||||||
|
|
||||||
|
|
||||||
def tests():
|
def tests():
|
||||||
require(mkjar)
|
require(mkjar)
|
||||||
junit_jar, hamcrest_jar = load_junitjars()
|
junit_jar, hamcrest_jar = load_junitjars()
|
||||||
|
|
Loading…
Reference in New Issue