Ant build.xml: Generate grammars in a separate intermediate build output folder

This commit is contained in:
Sam Harwell 2013-01-05 05:35:55 -06:00
parent dac6355b45
commit 1f41537826
1 changed files with 10 additions and 3 deletions

View File

@ -34,14 +34,18 @@ build.sysclasspath=ignore
<target name="init">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}/gen/org/antlr/v4" />
<property name="antlr3.gen.dir" value="${build.dir}/generated-sources/antlr3" />
<mkdir dir="${antlr3.gen.dir}" />
</target>
<target name="antlr" depends="init">
<echo>parse grammars</echo>
<java classname="org.antlr.Tool" fork="true" failonerror="true" maxmemory="300m"
dir="${basedir}/tool/src/org/antlr/v4/parse">
<arg value="-verbose"/>
<arg value="-make"/>
<arg value="-o"/>
<arg value="${antlr3.gen.dir}/org/antlr/v4/parse"/>
<arg value="ANTLRParser.g"/>
<arg value="ANTLRLexer.g"/>
<arg value="ActionSplitter.g"/>
@ -58,9 +62,12 @@ build.sysclasspath=ignore
<echo>codegen grammars</echo>
<java classname="org.antlr.Tool" fork="true" failonerror="true" maxmemory="300m"
dir="${basedir}/tool/src/org/antlr/v4/codegen">
<arg value="-verbose"/>
<arg value="-make"/>
<arg value="-o"/>
<arg value="${antlr3.gen.dir}/org/antlr/v4/codegen"/>
<arg value="-lib"/>
<arg value="../parse"/>
<arg value="${antlr3.gen.dir}/org/antlr/v4/parse"/>
<arg value="SourceGenTriggers.g"/>
<classpath>
<pathelement location="${antlr3.jar}"/>
@ -87,7 +94,7 @@ build.sysclasspath=ignore
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-serial"/>
<classpath refid="classpath"/>
<src path="${build.dir}/src:${build.dir}/gen"/>
<src path="${build.dir}/src:${antlr3.gen.dir}"/>
</javac>
</target>