You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Tim Visher <ti...@gmail.com> on 2010/04/11 05:53:07 UTC

`ant -find build.xml` and compile/recompile

Hello Everyone,

With `basedir="."`, how is `ant -find` supposed to work?  With it set
to `/absolute/path/to/build.xml`, how is the build script supposed to
be box independent?

We use ant to build our system and I would like to be able to use `ant
-find` to allow myself (and Emacs) to build the system from any
subdirectory.  Currently, we build from the command line and always
need to be in the directory that houses build.xml.  The reason is that
we have relative paths littered all over the build script in order to
package things up and move them around.  I can't figure out how to get
around this.  It also leads me to wonder why `-find` is even available
if the only way it can be used is if all of your paths are absolute
(which is not on anyone's best practices list).

I'm cross posting this between Emacs and Ant.  In your reply please
attach to both as I couldn't find a relevant thread in either list via
the archives.  Of course, that could have been my fault, in which case
it'd be awesome to cross post with a link to the solution. :)

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

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


Re: `ant -find build.xml` and compile/recompile

Posted by Tim Visher <ti...@gmail.com>.
On Mon, Apr 12, 2010 at 1:02 AM,  <Ja...@rzf.fin-nrw.de> wrote:
> '.' in Ant is the dir where the build.xml is.
> I tried "ant -find" from deep inside a project structure and "ant -f ..." from
> outside and both resolve <project basedir="."/> to the same path.

/me blushes.

The problem was in a groovy script I'd written.  I'd used `.` instead
of `${properties.basedir}` which meant that groovy was looking from
wherever I had executed `ant -find`.

Thanks for your help!

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

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


AW: `ant -find build.xml` and compile/recompile

Posted by Ja...@rzf.fin-nrw.de.
'.' in Ant is the dir where the build.xml is.
I tried "ant -find" from deep inside a project structure and "ant -f ..." from
outside and both resolve <project basedir="."/> to the same path.


Jan

> -----Ursprüngliche Nachricht-----
> Von: Daniel Becroft [mailto:djcbecroft@gmail.com] 
> Gesendet: Montag, 12. April 2010 00:07
> An: Ant Users List
> Betreff: Re: `ant -find build.xml` and compile/recompile
> 
> On Sun, Apr 11, 2010 at 1:53 PM, Tim Visher 
> <ti...@gmail.com> wrote:
> 
> > Hello Everyone,
> >
> > With `basedir="."`, how is `ant -find` supposed to work?  
> With it set
> > to `/absolute/path/to/build.xml`, how is the build script 
> supposed to
> > be box independent?
> >
> > We use ant to build our system and I would like to be able 
> to use `ant
> > -find` to allow myself (and Emacs) to build the system from any
> > subdirectory.  Currently, we build from the command line and always
> > need to be in the directory that houses build.xml.  The 
> reason is that
> > we have relative paths littered all over the build script 
> in order to
> > package things up and move them around.  I can't figure out 
> how to get
> > around this.  It also leads me to wonder why `-find` is 
> even available
> > if the only way it can be used is if all of your paths are absolute
> > (which is not on anyone's best practices list).
> >
> 
> We don't use 'ant -find' for our builds, but we do have 
> pseudo-relative
> paths throughout our build script. We achieved this by 
> putting the build.xml
> file at the root of the folder structure, and then using the 
> following:
> 
> <dirname property="base.dir" file="${ant.file}" />
> 
> This sets the base.dir property to the directory containing 
> the build.xml
> file (or whatever build file is used). All of our paths are 
> then specified
> as "${base.dir}/foo", and "${base.dir}/foo/bar". I'm not sure 
> if this would
> still work using the "ant -find" command. (I'm not at work 
> atm, but will
> check when I get in).
> 
> I'm cross posting this between Emacs and Ant.  In your reply please
> > attach to both as I couldn't find a relevant thread in 
> either list via
> > the archives.  Of course, that could have been my fault, in 
> which case
> > it'd be awesome to cross post with a link to the solution. :)
> >
> >
> Sorry, I believe it's base practice to cross-post between 
> mailing lists.
> Besides, this is an Apache Ant question, not an Emacs question.
> 
> Cheers,
> Daniel B.
> 

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


Re: `ant -find build.xml` and compile/recompile

Posted by Daniel Becroft <dj...@gmail.com>.
On Sun, Apr 11, 2010 at 1:53 PM, Tim Visher <ti...@gmail.com> wrote:

> Hello Everyone,
>
> With `basedir="."`, how is `ant -find` supposed to work?  With it set
> to `/absolute/path/to/build.xml`, how is the build script supposed to
> be box independent?
>
> We use ant to build our system and I would like to be able to use `ant
> -find` to allow myself (and Emacs) to build the system from any
> subdirectory.  Currently, we build from the command line and always
> need to be in the directory that houses build.xml.  The reason is that
> we have relative paths littered all over the build script in order to
> package things up and move them around.  I can't figure out how to get
> around this.  It also leads me to wonder why `-find` is even available
> if the only way it can be used is if all of your paths are absolute
> (which is not on anyone's best practices list).
>

We don't use 'ant -find' for our builds, but we do have pseudo-relative
paths throughout our build script. We achieved this by putting the build.xml
file at the root of the folder structure, and then using the following:

<dirname property="base.dir" file="${ant.file}" />

This sets the base.dir property to the directory containing the build.xml
file (or whatever build file is used). All of our paths are then specified
as "${base.dir}/foo", and "${base.dir}/foo/bar". I'm not sure if this would
still work using the "ant -find" command. (I'm not at work atm, but will
check when I get in).

I'm cross posting this between Emacs and Ant.  In your reply please
> attach to both as I couldn't find a relevant thread in either list via
> the archives.  Of course, that could have been my fault, in which case
> it'd be awesome to cross post with a link to the solution. :)
>
>
Sorry, I believe it's base practice to cross-post between mailing lists.
Besides, this is an Apache Ant question, not an Emacs question.

Cheers,
Daniel B.