ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <DDevie...@lgc.com>
Subject RE: Duplicate Class Error when Re-using Javac Task
Date Fri, 25 Feb 2005 19:12:49 GMT
This has been discussed in the past Robert, i.e. can one assume a task
that a task is safe to re-execute more than once with slightly different
parameters. I don't recall the answer, but I do recall than at least one
task was made safer to re-execution.

In your case, the safest might be to get at the UnknownElement of your
nested Javac task, and re-instanciate a fresh instance every time, from
the same "XML config". I don't even know if it's possible (I think it
should be, but YMMV), but it might be the only safe way to reuse a task,
or more specifically a task's configuration. --DD

> -----Original Message-----
> From: Robert Virkus [mailto:robert@enough.de]
> Sent: Friday, February 25, 2005 12:25 PM
> To: Ant Developers List
> Subject: Re: Duplicate Class Error when Re-using Javac Task
> 
> Hi Martin,
> 
> sorry, I forgot to mention that - fork does not help neither.
> 
> Thanks,
>     Robert
> 
> On Friday 25 February 2005 18:51, Martin Gainty wrote:
> > Robert
> > Did you enable the javac task fork="true"
> > Viel Gluck,
> > Martin-
> > ----- Original Message -----
> > From: "Robert Virkus" <robert@enough.de>
> > To: "Ant Developers List" <dev@ant.apache.org>
> > Sent: Friday, February 25, 2005 11:13 AM
> > Subject: Duplicate Class Error when Re-using Javac Task
> >
> > > Hi everyone,
> > >
> > > I'd like to re-use a Javac-task from within my own task but I
always
> get
> > > "duplicate class: ClassName"-errors when I compile the second set
of
> > > source
> > > code files.
> > >
> > > The background of this is that I have a preprocessor that creates
> > > different
> > > source code versions of the same project, which are then compiled
by
> the
> > > org.apache.tools.ant.taskdefs.Javac task. I use and set different
> > > directories
> > > for the source code and for the compiled classes in each run. The
> first
> > > round
> > > is compiled without any problems, but the following round fails
with
> the
> > > "duplicate class" error.
> > >
> > > When I create a new instance of the Javac task, it works without
> > > problems.
> > >
> > > I want to reuse the Javac task since I want to allow a nested
> > > <javac>-definition in my task (in the build.xml). (The project is
J2ME
> > > Polish
> > > by the way, www.j2mepolish.org).
> > >
> > > Is anyone aware what could be done in this case? I have seen that
the
> > > Javac
> > > task resets its internal file list for each execute() call, but
this
> > > doesn't
> > > seem to help. I could send a demonstrator project along with the
> source
> > > code
> > > to anyone interested.
> > >
> > > Thanks in advance,
> > >    Robert
> > > --
> > > Robert Virkus
> > > Enough Software
> > > Vor dem Steintor 218
> > > 28203 Bremen
> > > Germany
> > >
> > > www.enough.de
> > > +49-(0)421-9889131
> > > +49-(0)160-7788203
> > > robert@enough.de
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: dev-help@ant.apache.org
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
> 
> --
> Robert Virkus
> Enough Software
> Vor dem Steintor 218
> 28203 Bremen
> Germany
> 
> www.enough.de
> +49-(0)421-9889131
> +49-(0)160-7788203
> robert@enough.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message