[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Grammatica-users] small problem: ant action always fires
From: |
Per Cederberg |
Subject: |
Re: [Grammatica-users] small problem: ant action always fires |
Date: |
Fri, 11 Mar 2005 20:03:01 +0100 |
With some small modifications to your build.xml, this should be
possible to do. I think something like this should work (no time
to test right now... :)
<taskdef name="grammatica"
classname="net.percederberg.grammatica.ant.GrammaticaTask"
classpath="grammatica.jar" />
<target name="build-java">
<uptodate property="subscript.uptodate"
srcfile="subscript.grammar"
targetfile="src/subscript/language/grammar/SubscriptParser.java" />
<antcall target="build-codegen" />
...
</target>
<target name="build-codegen" unless="subscript.uptodate">
<grammatica grammar="subscript.grammar">
<java dir="src"
package="subscript.language.grammar"
public="true" />
</grammatica>
</target>
The reason for the codegen being run always, is that you didn't
place the <grammatica> task inside a target. That meant that it
was called every time the build file was run.
Cheers,
/Per
On fri, 2005-03-11 at 11:48 -0500, Edwin Olson wrote:
> 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
>
>
> _______________________________________________
> Grammatica-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/grammatica-users