ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <DDevie...@lgc.com>
Subject RE: Ant + Hibernate: two solutions
Date Fri, 08 Oct 2004 14:58:54 GMT
> From: Greg Wilson [mailto:gvwilson@cs.toronto.edu]
> 
> Hi everyone.  Many thanks to William Lopez and Eric Burke for finding
two
> different solutions to my Ant + Hibernate grief.  I've blogged their
> findings here:
> 
>     http://pyre.third-bit.com/blog/archives/000112.html
> 
> and you can find the files here:
> 
>     http://pyre.third-bit.com/hb1/index.html
> 
> Is it Ant's fault?  Is it Hibernate's?  I don't know;

I've read with interest your problem, and with even more interest
the two solutions. Maybe it's my Ant bias, but I'd say it's an Hibernate
design bug for their task.

Erik is most likely right in his analysis. When executed, the taskdef
instantiates an Ant Path object, which drops all non-existent path
entries, like the not-yet created classes output dir.

William's solution just ensures the directory exists before the
taskdef, side-stepping the issue.

Erik is also right when he says that the Hibernate task should
accept a classpath. As far as I'm concern, Ant task should always
take an explicit classpath to process their input.

The classpath provided in the taskdef of the hibernate task is meant
to resolve the task's own class dependencies, not the class dependencies
of what it has to process. Requiring the task's taskdef to be dependent
of its runtime input is wrong IMHO.

Assume you have src/schema1 and src/schema2, both compiled in a separate
build/classes1 / build/classes2 directories. To use the task as of now,
you'd have to taskdef it with both classes dir (+ Hibernate I guess)
just
so you can process both schemas. The correct way to do it is to have the
taskdef take neither classes dirs, and each invocation take to one
appropriate explicit classpath.

All tasks that I know of work like this.
To me, it's a design bug in Hibernate. --DD

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


Mime
View raw message