You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@bost.de> on 2000/09/04 10:54:08 UTC

Re: Path like structures (and extending their contents)

>>>>> "BT" == Barrie Treloar <Ba...@camtech.com.au> 

 BT> I have two classpaths; one for compiling the classes and another
 BT> for compiling the test classes.

 BT> If I want to include the first classpath in the test class path I
 BT> find that the existing <classpath> tag does not allow this.  This
 BT> is because Path is still being worked on.

I've been thinking of having a refid or similar attribute to
pathelement. What scared me of - and this is why I didn't want to
implement it right away - was how to avoid infinite recursion.

<path id="path1">
  <pathelement refid="path1" />
</path>

or even

<path id="path2">
  <pathelement refid="path1" />
</path>

<path id="path1">
  <pathelement refid="path2" />
</path>

It is quite easy to detect the first case though.

Comments?

Stefan

Re: Path like structures (and extending their contents)

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JG" == Jesse Glick <Je...@netbeans.com> writes:

 JG> Is avoiding infinite recursion really an immediate priority?

Sort of. 

I share your general point of view but if I've identified a potential
crash (and a StackOverflowError like this might be very difficult to
debug for the user), I prefer to avoid it.

Stefan

Re: Path like structures (and extending their contents)

Posted by Jesse Glick <Je...@netbeans.com>.
Stefan Bodewig wrote:
>  BT> I would like to be able to include a path within another path.
>  BT> This would be useful for all path like structures.
> 
> Hmm, guess I need to think about avoiding infinite recursion again.

Is avoiding infinite recursion really an immediate priority? If the
writer of the buildfile is dumb enough to do it, probably they will get
a StackOverflowException and have to fix it. Surely giving a more polite
error is a secondary concern relative to implementing basic
functionality?

-Jesse

-- 
Jesse Glick   <ma...@netbeans.com>
NetBeans, Open APIs  <http://www.netbeans.org/>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR

Re: Path like structures (and extending their contents)

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "BT" == Barrie Treloar <Ba...@camtech.com.au> writes:

 BT> I like the idea of being able to define paths globally instead of
 BT> in tasks.

Expect this functionality to appear rather soon.

 BT> I would like to be able to include a path within another path.
 BT> This would be useful for all path like structures.

Hmm, guess I need to think about avoiding infinite recursion again.

 BT> I'm not happy with all the *ref tags being created, they dont
 BT> feel right.

Your approach looks clearer and more readable. It might be a little
bit tricky to ensure <path refid="xyz"> won't have child elements but
it should be possible.

Stefan

Re: Path like structures (and extending their contents)

Posted by Barrie Treloar <Ba...@camtech.com.au>.
On 4 Sep 2000, Stefan Bodewig wrote:

> >>>>> "BT" == Barrie Treloar <Ba...@camtech.com.au> 
> 
>  BT> I have two classpaths; one for compiling the classes and another
>  BT> for compiling the test classes.
> 
>  BT> If I want to include the first classpath in the test class path I
>  BT> find that the existing <classpath> tag does not allow this.  This
>  BT> is because Path is still being worked on.
> 
> I've been thinking of having a refid or similar attribute to
> pathelement. What scared me of - and this is why I didn't want to
> implement it right away - was how to avoid infinite recursion.

I like the idea of being able to define paths globally instead of in
tasks. 

I would like to be able to include a path within another path.  This
would be useful for all path like structures.

I'm not happy with all the *ref tags being created, they dont feel
right.  I'm not sure what are the best alternatives to replace it.

A possible alternative is that path can include other path like
structures within it and this will cause the referenced path values to
be included in the final path.

This could be achieved by deleting the *ref tasks and moving the refid
tag into the actual task.  Paths with refid's are not allowed to have
any body, that is they must be one line tags.

For example:

<path id="firstPath">
        <pathelement .../>
</path>

# secondPath will include the path values from firstPath
<path id="secondPath>
        <path refid="firstPath"/>
        <pathelement .../>
</path>

# and to use it in a target
<target>
        <javac>
                <classpath>
                        <path refid="secondPath/>
                        # extend the path with more information
                        <pathelement .../>
                </classpath>
        </javac>
</target>

Barrie
--
Barrie Treloar
____________________________________________________________________

  Barrie Treloar                      Phone: +61 8 8303 3300
  Senior Analyst/Programmer           Fax:   +61 8 8303 4403 
  Electronic Commerce Division        Email: barrie@camtech.com.au
  Camtech (SA) Pty Ltd                http://www.camtech.com.au
 --- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---
____________________________________________________________________