grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Grammatica-users] small problem: ant action always fires


From: Edwin Olson
Subject: [Grammatica-users] small problem: ant action always fires
Date: Fri, 11 Mar 2005 11:48:18 -0500
User-agent: Mozilla Thunderbird (X11/20041216)

Hi!

First off, grammatica is good stuff. I'm using it to build a matlab-like environment, since both octave and matlab have major issues as far as I'm concerned. :)

I'm working in pure java, and everything's going great, except for a small annoyance: anytime I invoke ant on my build.xml file, the grammatica task "fires" and regenerates its source code. It does this even if the grammar file has not changed, and even if I invoked 'ant clean' (the generated files are then promptly deleted.)

This isn't a show stopper, but it is fairly annoying. It's entirely possible I'm doing something wrong with my build.xml file, so I've attached it.

Thanks for any advice,

-Ed


<?xml version="1.0" ?>

<project name="subscript" default="build" basedir=".">

<!-- Build everything -->
<target name="build" depends="build-java,build-jar"/>

<!-- Clean everything -->
<target name="clean" depends="clean-java"/>

<!-- Dist Clean everyting -->
<target name="distclean" depends="clean">
  <delete dir="docs"/>
  <delete file="build.jar"/>
  <delete dir="depcache"/>
</target>

<!-- Build docs -->
<target name="docs">
<javadoc sourcepath="src/"
         packagenames="subscript.*,Jama.*"
         defaultexcludes="yes"
         destdir="docs/api"
         Public="yes"
         source="1.5"
/>
</target>

<!-- Build Jar -->
<target name="build-jar">
<jar destfile="subscript.jar">
  <zipfileset src="grammatica.jar">
    <include name="**/*.class" />
  </zipfileset>
  <fileset dir="src">
    <include name="**/*.class" />
  </fileset>
  <manifest>
   <attribute name="Main-Class" value="subscript.Subscript" />
  </manifest>
 </jar>
 <copy file="subscript.jar" todir="." />
</target>

<target name="build-java">
 <!-- This does deep dependency checking on class files 
  <depend
   srcdir="."
   cache="depcache"
  closure="true"
  /> -->
 <!-- This compiles all the java -->
 <javac
  srcdir="src"
  includes="**/*.java"
  debug="on"
  optimize="off"
  compiler="extJavac"
  classpath="src:grammatica.jar:maslab.jar"
  source="1.5"
  >
  <compilerarg value="-Xlint"/>
</javac>
</target>

<target name="clean-java" >
 <delete>
  <fileset dir="." includes="**/*.class"/>
  <fileset dir="." includes="**/*~" defaultexcludes="no"/>
 </delete>
</target>

<taskdef name="grammatica"
  classname="net.percederberg.grammatica.ant.GrammaticaTask"
  classpath="grammatica.jar"
/>

<grammatica grammar="subscript.grammar">
 <java dir="src"
  package="subscript.language.grammar"
  public="true" />
</grammatica>

</project>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]