cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <ovi...@cup.hp.com>
Subject Re: [C2 Vote]: Test of available classes
Date Wed, 26 Sep 2001 18:19:40 GMT
Carsten,

On Wed, 26 Sep 2001 10:23:01 +0200, "Carsten Ziegeler" <cziegeler@sundn.de> wrote:

> the ant task "available" is not suitable for our needs. It does
> not only test the specified path for a given class, but also
> the classpath set by the user/jvm.
> Our "available" test should only check the jars in the ./lib
> directory.

I looked at the implementation of <available> in ant, and I think I
found a bug. It doesn't seem to have an addClasspath() method, which
would add a classpath created using a <classpath> child.

It does however seem to correctly handle the classpath and
classpathref attributes. So how about if you try rewriting the
<available> tasks in Cocoon2's build.xml from

    <available property="naming.present" classname="javax.naming.Context">
      <classpath refid="classpath"/>
    </available>

to

    <available property="naming.present"
               classname="javax.naming.Context">
               classpathref="classpath"/>

> I wrote a simple ant task which does exactly this, so please
> vote, if we should add this task and use it instead of the
> build-in task. Of course I am +1 on this :-)
> 
> The second decision is where the src and the class file for
> this task should be stored:
> I suggest:
> ./bin/anttasks: for the compiled class file
> ./bin/src     : for the source

I agree with John that we should fix ant rather than come up with a
similar task.

> I think we should separate this src from the cocoon src
> as it is only used by the build system.
> 
> Last think for this topic:
> Should we convert the simple sitemap tool to an ant task?
> I'm +1 on this!

I agree.

The only problem I found so far is that you cannot use the main
build.xml to drive the compilation of the ant tasks in another
directory.

The reason for this has to do with the way ant deals with
<taskdef>. If you want to make use of the sitemap tool task in the
main build.xml, you would have to include the following line in it:

<taskdef name="sitemap" classname="st"/>

The problem is that at the time the main build.xml is read, the st
class is not compiled, and ant will barf about it.

We would have to add the compilation rules for all the ant tasks in a
build.xml located in the ant tasks source directory. We should then
use the build.{sh,bat} to drive the whole process. A little ugly as we
split the build between build.xml and build.{sh|bat}, but we can live
with it.


Greetings,
-- 
Ovidiu Predescu <ovidiu@cup.hp.com>
http://orion.rgv.hp.com/ (inside HP's firewall only)
http://sourceforge.net/users/ovidiu/ (my SourceForge page)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

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


Mime
View raw message