You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Mark D. Anderson" <md...@discerning.com> on 2001/12/13 18:31:03 UTC

some new ant user questions

i didn't see these in the faq or manual:

- is "." relative to the build.xml file, or relative to the current working directory?
- is that true for all relative paths?
- is there a simple recipe to get ant to only build in my current directory or below
(javac might decide to compile some other dirs, but that is fine)
- is there a simple recipe to use a different classpath depending on what machine on
or on what OS i'm on?

-mda



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some new ant user questions

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 13 Dec 2001, Mark D. Anderson <md...@discerning.com> wrote:

> - is "." relative to the build.xml file, or relative to the current
> working directory?

Neither nor, it depends on where you find the ".".

A "." in the basedir attribute of <project> is relative to the build
file, in all other cases it is relative to the value of that basedir.

> - is that true for all relative paths?

Yes.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some new ant user questions

Posted by Diane Holt <ho...@yahoo.com>.
--- "Mark D. Anderson" <md...@discerning.com> wrote:
> i'd rather just have one build.xml file at the top of my src tree, and
> use the ant feature to walk up the tree looking for it.
> then wherever i am in the tree i'd like a command that just builds the
> current subtree, even though it would be default walk to the top, then
> interpret "." as meaning the top, not cwd. so my desiderata are:
> - one build.xml at the top
> - a shell command to just build in the cwd
> - a shell command to build the whole tree

Use -find to run the buildfile at the top of the tree. If you always want
to use it, you can set it in ANT_ARGS, if you pick up the latest bin
scripts from CVS -- just be sure to also include the buildfile name, even
if it's build.xml, since -find expects any arg that follows it to be the
name of the buildfile (a bug, IMO -- I don't think -find should have
anything to do with the buildfile name).

If you want "basedir" to be equal to your cwd, set it on the command-line
(eg., 'ant -Dbasedir=$PWD -find').

> that describes some syntax, but has no recipes, and no discussion of
> getting a conditional effect.
> although i don't think i want to use "<condition>".
> i think what i want can be achieved by including an external xml file
> named after the
> current machine name (or named after a command line -D which i might
> supply).

What is it you're trying to achieve?

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some new ant user questions

Posted by "Mark D. Anderson" <md...@discerning.com>.
> > - is there a simple recipe to get ant to only build in my current
> > directory or below
> as opossed to what? ant, by default, will look for a build.xml file in the
> current directory (or the supplied buildfile through the -buildfile command
> line option). It will then do execute whatever is specifed in the build
> file.

i'd rather just have one build.xml file at the top of my src tree, and use the ant
feature to walk up the tree looking for it.
then wherever i am in the tree i'd like a command that just builds the current
subtree, even though it would be default walk to the top, then interpret "."
as meaning the top, not cwd. so my desiderata are:
- one build.xml at the top
- a shell command to just build in the cwd
- a shell command to build the whole tree

> > - is there a simple recipe to use a different classpath depending
> > on what machine on
> > or on what OS i'm on?
> For path and classpath stuctures, check the manual in the sectiom Using Ant
> > Path-like structures. The section should answer most of your questions
> regarding claspaths.

that describes some syntax, but has no recipes, and no discussion of getting a conditional effect.
although i don't think i want to use "<condition>".
i think what i want can be achieved by including an external xml file named after the
current machine name (or named after a command line -D which i might supply).
however, using XML entities for inclusion happens prior to any ant-level processing.
i don't see any other higher-level include operation for ant ("<include>" is
for filesets, not external build.xml files). perhaps subprojects could be used,
but i don't think that has the desired effect (does not effect the parent project).

so i guess i'm left with just commenting out portions of the build.xml file according
to the desired configuration.

-mda



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: some new ant user questions

Posted by Ylan Segal <yl...@digiworks.tv>.
> - is "." relative to the build.xml file, or relative to the
> current working directory?
It is relative to the buildfile.
> - is that true for all relative paths?
Yes, as far as I know.
> - is there a simple recipe to get ant to only build in my current
> directory or below
as opossed to what? ant, by default, will look for a build.xml file in the
current directory (or the supplied buildfile through the -buildfile command
line option). It will then do execute whatever is specifed in the build
file.
> - is there a simple recipe to use a different classpath depending
> on what machine on
> or on what OS i'm on?
For path and classpath stuctures, check the manual in the sectiom Using Ant
> Path-like structures. The section should answer most of your questions
regarding claspaths.

Hope this helps.

Ylan Segal.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>