2011-06-15 08:30:40 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2011-09-06 05:05:58 +08:00
|
|
|
|
|
|
|
<!--
|
|
|
|
|
|
|
|
Make build.properties like this:
|
|
|
|
|
2012-09-30 03:53:44 +08:00
|
|
|
version=4.0b2
|
2011-09-06 05:05:58 +08:00
|
|
|
|
2012-09-19 02:25:06 +08:00
|
|
|
antlr3.jar=/usr/local/lib/antlr-3.5-complete.jar
|
2011-09-06 05:05:58 +08:00
|
|
|
build.sysclasspath=ignore
|
|
|
|
-->
|
|
|
|
|
2011-06-21 09:34:57 +08:00
|
|
|
<project name="ANTLR4" default="distribute" basedir=".">
|
2011-06-15 08:22:05 +08:00
|
|
|
|
2011-06-21 09:34:57 +08:00
|
|
|
<property file="build.properties" />
|
|
|
|
|
|
|
|
<property name="src.dir" value="${basedir}/src" />
|
|
|
|
<property name="dist.dir" value="${basedir}/dist" />
|
|
|
|
<property name="build.dir" value="${basedir}/build" />
|
|
|
|
<property name="lib.dir" value="${basedir}/lib" />
|
|
|
|
<property name="install.root.dir" value="${dist.dir}/antlr-${version}" />
|
2012-01-02 03:24:26 +08:00
|
|
|
<property name="jar.file" value="${dist.dir}/antlr-${version}-complete.jar" />
|
2011-06-21 09:34:57 +08:00
|
|
|
|
|
|
|
<path id="classpath">
|
|
|
|
<pathelement location="${antlr3.jar}"/> <!-- general setup -->
|
|
|
|
<pathelement location="${ant-antlr3.jar}"/>
|
2011-11-01 22:37:35 +08:00
|
|
|
<pathelement location="${basedir}/runtime/Java/lib/org.abego.treelayout.core.jar"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
</path>
|
|
|
|
|
|
|
|
<target name="clean">
|
|
|
|
<delete dir="${build.dir}"/>
|
|
|
|
<delete dir="${dist.dir}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="init">
|
|
|
|
<!-- Create the build directory structure used by compile -->
|
2013-01-05 19:35:55 +08:00
|
|
|
<property name="antlr3.gen.dir" value="${build.dir}/generated-sources/antlr3" />
|
|
|
|
<mkdir dir="${antlr3.gen.dir}" />
|
2011-06-21 09:34:57 +08:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="antlr" depends="init">
|
2011-07-07 05:42:35 +08:00
|
|
|
<echo>parse grammars</echo>
|
2013-01-05 19:38:01 +08:00
|
|
|
<java classname="org.antlr.Tool" fork="false" failonerror="true">
|
2013-01-05 19:35:55 +08:00
|
|
|
<arg value="-verbose"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<arg value="-make"/>
|
2013-01-05 19:35:55 +08:00
|
|
|
<arg value="-o"/>
|
|
|
|
<arg value="${antlr3.gen.dir}/org/antlr/v4/parse"/>
|
2013-01-05 19:38:01 +08:00
|
|
|
<arg value="-in"/>
|
|
|
|
<arg value="${basedir}/tool/src/org/antlr/v4/parse"/>
|
|
|
|
<arg value="-lib"/>
|
|
|
|
<arg value="${basedir}/tool/src/org/antlr/v4/parse"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<arg value="ANTLRParser.g"/>
|
|
|
|
<arg value="ANTLRLexer.g"/>
|
|
|
|
<arg value="ActionSplitter.g"/>
|
|
|
|
<arg value="ATNBuilder.g"/>
|
2011-09-06 05:05:58 +08:00
|
|
|
<arg value="BlockSetTransformer.g"/>
|
|
|
|
<arg value="GrammarTreeVisitor.g"/>
|
|
|
|
<arg value="LeftRecursiveRuleWalker.g"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<classpath>
|
|
|
|
<pathelement location="${antlr3.jar}"/>
|
|
|
|
<pathelement path="${java.class.path}"/>
|
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
|
|
|
|
<echo>codegen grammars</echo>
|
2013-01-05 19:38:01 +08:00
|
|
|
<java classname="org.antlr.Tool" fork="false" failonerror="true">
|
2013-01-05 19:35:55 +08:00
|
|
|
<arg value="-verbose"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<arg value="-make"/>
|
2013-01-05 19:35:55 +08:00
|
|
|
<arg value="-o"/>
|
|
|
|
<arg value="${antlr3.gen.dir}/org/antlr/v4/codegen"/>
|
2013-01-05 19:38:01 +08:00
|
|
|
<arg value="-in"/>
|
|
|
|
<arg value="${basedir}/tool/src/org/antlr/v4/codegen"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<arg value="-lib"/>
|
2013-01-05 19:35:55 +08:00
|
|
|
<arg value="${antlr3.gen.dir}/org/antlr/v4/parse"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<arg value="SourceGenTriggers.g"/>
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="${antlr3.jar}"/>
|
|
|
|
<pathelement path="${java.class.path}"/>
|
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" depends="antlr" description="Compile for generic OS">
|
|
|
|
<mkdir dir="${build.dir}/classes"/>
|
|
|
|
<javac
|
|
|
|
destdir="${build.dir}/classes"
|
|
|
|
source="1.5"
|
|
|
|
target="1.5"
|
|
|
|
debug="true"
|
|
|
|
excludes="org/antlr/v4/test/**">
|
2013-01-05 19:27:48 +08:00
|
|
|
<compilerarg value="-Xlint"/>
|
|
|
|
<compilerarg value="-Xlint:-serial"/>
|
|
|
|
<classpath refid="classpath"/>
|
2013-01-05 19:38:54 +08:00
|
|
|
<src path="${basedir}/tool/src:${basedir}/runtime/Java/src:${antlr3.gen.dir}"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
</javac>
|
2011-06-15 08:30:40 +08:00
|
|
|
</target>
|
2011-06-21 09:34:57 +08:00
|
|
|
|
|
|
|
<target name="build-jar" depends="compile" description="Build ANTLR 4.jar">
|
|
|
|
<mkdir dir="${dist.dir}"/>
|
|
|
|
|
|
|
|
<jar jarfile="${jar.file}">
|
|
|
|
<fileset dir="${build.dir}/classes" includes="**/*.class"/>
|
2012-01-02 03:53:57 +08:00
|
|
|
<fileset dir="${basedir}/tool/resources">
|
|
|
|
<include name="**/*.st"/>
|
|
|
|
<include name="**/*.stg"/>
|
|
|
|
</fileset>
|
2012-01-03 09:11:39 +08:00
|
|
|
<zipfileset includes="org/antlr/**, org/antlr/stringtemplate/**, org/stringtemplate/v4/**" src="${antlr3.jar}"/>
|
2012-01-02 03:24:26 +08:00
|
|
|
<zipfileset includes="**/*.class" src="${basedir}/runtime/Java/lib/org.abego.treelayout.core.jar"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<manifest>
|
|
|
|
<attribute name="Version" value="${version}"/>
|
2012-01-02 06:41:44 +08:00
|
|
|
<attribute name="Main-Class" value="org.antlr.v4.Tool"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
</manifest>
|
|
|
|
</jar>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="zip-source" depends="compile">
|
|
|
|
<mkdir dir="${install.root.dir}"/>
|
|
|
|
|
|
|
|
<mkdir dir="${install.root.dir}/src"/>
|
|
|
|
<copy todir="${install.root.dir}/src">
|
2011-07-07 05:42:35 +08:00
|
|
|
<fileset dir="${basedir}/tool/src/">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
<include name="**/*.g"/>
|
|
|
|
<include name="**/*.st"/>
|
|
|
|
<include name="**/*.stg"/>
|
|
|
|
</fileset>
|
2012-01-02 03:53:57 +08:00
|
|
|
<fileset dir="${basedir}/tool/resources/">
|
|
|
|
<include name="**/*.st"/>
|
|
|
|
<include name="**/*.stg"/>
|
|
|
|
</fileset>
|
2011-07-07 05:42:35 +08:00
|
|
|
<fileset dir="${basedir}/runtime/Java/src/">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
<include name="**/*.g"/>
|
|
|
|
<include name="**/*.st"/>
|
|
|
|
<include name="**/*.stg"/>
|
|
|
|
</fileset>
|
2013-01-05 19:36:54 +08:00
|
|
|
<fileset dir="${antlr3.gen.dir}"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
</copy>
|
|
|
|
|
|
|
|
<copy todir="${install.root.dir}">
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="build.properties"/>
|
|
|
|
<include name="build.xml"/>
|
|
|
|
<include name="LICENSE.txt"/>
|
|
|
|
<include name="README.txt"/>
|
|
|
|
<include name="doxyfile"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<copy todir="${install.root.dir}/lib" file="${antlr3.jar}">
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<zip destfile="${dist.dir}/antlr-${version}-src.zip">
|
|
|
|
<zipfileset dir="${install.root.dir}" prefix="antlr-${version}"/>
|
|
|
|
</zip>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="distribute" depends="clean, zip-source, build-jar">
|
|
|
|
</target>
|
|
|
|
|
2011-06-15 08:22:05 +08:00
|
|
|
</project>
|