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:
|
|
|
|
|
|
|
|
version=4.0ea
|
|
|
|
|
|
|
|
antlr3.jar=/usr/local/lib/antlr-3.4-complete.jar
|
|
|
|
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 -->
|
|
|
|
<mkdir dir="${build.dir}/gen/org/antlr/v4" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<target name="antlr" depends="init">
|
2011-07-07 05:42:35 +08:00
|
|
|
<echo>parse grammars</echo>
|
2011-06-21 09:34:57 +08:00
|
|
|
<java classname="org.antlr.Tool" fork="true" failonerror="false" maxmemory="300m"
|
|
|
|
dir="${basedir}/tool/src/org/antlr/v4/parse">
|
|
|
|
<arg value="-make"/>
|
|
|
|
<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>
|
|
|
|
|
2011-09-06 05:05:58 +08:00
|
|
|
<!--
|
2011-06-21 09:34:57 +08:00
|
|
|
<echo>semantics grammars</echo>
|
|
|
|
<java classname="org.antlr.Tool" fork="true" failonerror="false" maxmemory="300m"
|
|
|
|
dir="${basedir}/tool/src/org/antlr/v4/semantics">
|
|
|
|
<arg value="-make"/>
|
|
|
|
<arg value="-lib"/>
|
|
|
|
<arg value="../parse"/>
|
|
|
|
<arg value="BasicSemanticTriggers.g"/>
|
|
|
|
<arg value="CollectSymbols.g"/>
|
2011-07-07 05:42:35 +08:00
|
|
|
<arg value="Refs.g"/>
|
2011-06-21 09:34:57 +08:00
|
|
|
<classpath>
|
|
|
|
<pathelement location="${antlr3.jar}"/>
|
|
|
|
<pathelement path="${java.class.path}"/>
|
|
|
|
</classpath>
|
|
|
|
</java>
|
2011-09-06 05:05:58 +08:00
|
|
|
-->
|
2011-06-21 09:34:57 +08:00
|
|
|
|
|
|
|
<echo>codegen grammars</echo>
|
|
|
|
<java classname="org.antlr.Tool" fork="true" failonerror="false" maxmemory="300m"
|
|
|
|
dir="${basedir}/tool/src/org/antlr/v4/codegen">
|
|
|
|
<arg value="-make"/>
|
|
|
|
<arg value="-lib"/>
|
|
|
|
<arg value="../parse"/>
|
|
|
|
<arg value="SourceGenTriggers.g"/>
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="${antlr3.jar}"/>
|
|
|
|
<pathelement path="${java.class.path}"/>
|
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
|
2012-04-07 11:21:11 +08:00
|
|
|
<!--
|
2011-06-21 09:34:57 +08:00
|
|
|
<echo>gunit grammars</echo>
|
|
|
|
<java classname="org.antlr.Tool" fork="true" failonerror="false" maxmemory="300m"
|
|
|
|
dir="${basedir}/gunit/src/org/antlr/v4/gunit">
|
|
|
|
<arg value="-make"/>
|
|
|
|
<arg value="ASTVerifier.g"/>
|
|
|
|
<arg value="gUnit.g"/>
|
|
|
|
<arg value="jUnitGen.g"/>
|
|
|
|
<arg value="Semantics.g"/>
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="${antlr3.jar}"/>
|
|
|
|
<pathelement path="${java.class.path}"/>
|
|
|
|
</classpath>
|
|
|
|
</java>
|
2012-04-07 11:21:11 +08:00
|
|
|
-->
|
2011-06-21 09:34:57 +08:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" depends="antlr" description="Compile for generic OS">
|
|
|
|
<mkdir dir="${build.dir}/classes"/>
|
|
|
|
<mkdir dir="${build.dir}/src"/>
|
|
|
|
<copy todir="${build.dir}/src" >
|
2011-07-07 05:42:35 +08:00
|
|
|
<fileset dir="${basedir}/tool/src/"/>
|
|
|
|
<fileset dir="${basedir}/runtime/Java/src/"/>
|
2012-04-07 11:21:11 +08:00
|
|
|
<!-- <fileset dir="${basedir}/gunit/src/"/> -->
|
2011-06-21 09:34:57 +08:00
|
|
|
</copy>
|
|
|
|
<replace dir="${build.dir}/src" token="@version@" value="${version}"/>
|
|
|
|
<javac
|
|
|
|
destdir="${build.dir}/classes"
|
|
|
|
source="1.5"
|
|
|
|
target="1.5"
|
|
|
|
debug="true"
|
|
|
|
excludes="org/antlr/v4/test/**">
|
|
|
|
<classpath refid="classpath"/>
|
|
|
|
<src path="${build.dir}/src:${build.dir}/gen"/>
|
|
|
|
</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>
|
2012-04-07 11:21:11 +08:00
|
|
|
<!--
|
2011-07-07 05:42:35 +08:00
|
|
|
<fileset dir="${basedir}/gunit/src/">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
<include name="**/*.g"/>
|
|
|
|
<include name="**/*.st"/>
|
|
|
|
<include name="**/*.stg"/>
|
|
|
|
</fileset>
|
2012-04-07 11:21:11 +08:00
|
|
|
-->
|
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>
|