You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Francisco Tolmasky <to...@gmail.com> on 2008/02/04 00:14:47 UTC

Using -buildfile without setting the basedir?

I'm trying to use a build file that is located in a different  
directory by doing the following:

ant -f a/b/thebuild.xml

However, this has the side effect of changing my basedir to a/b/ as  
well, which I don't want,
I just want to run ant in my current directory with the build file of  
a different directory. Any
thoughts?

Thanks,

Francisco

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


Re: Using -buildfile without setting the basedir?

Posted by Martin Ficker <m....@googlemail.com>.
You could set the basedir property:

 ant -f a/b/thebuild.xml -Dbasedir=<pathToTheDir>

On a unix shell you could use:

 ant -f a/b/thebuild.xml -Dbasedir=$(pwd)

The system indipendent way would of course be placing an antfile in the
top dir that calls a/b/thebuild.xml using the ant task.
This is what David Brown pointed out.

Best regards,

Martin
>
> However, this has the side effect of changing my basedir to a/b/ as
> well, which I don't want,
> I just want to run ant in my current directory with the build file of
> a different directory. Any
> thoughts?
>
> Thanks,
>
> Francisco
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


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


Re: Using -buildfile without setting the basedir?

Posted by David Weintraub <qa...@gmail.com>.
basedir is set in the <project> attribute in the build.xml file. Try
setting it on the command line:

    $ ant -Dbasedir=$PWD -f /a/b/build.xml

That *should* override the setting.

On Feb 3, 2008 6:14 PM, Francisco Tolmasky <to...@gmail.com> wrote:
> I'm trying to use a build file that is located in a different
> directory by doing the following:
>
> ant -f a/b/thebuild.xml
>
> However, this has the side effect of changing my basedir to a/b/ as
> well, which I don't want,
> I just want to run ant in my current directory with the build file of
> a different directory. Any
> thoughts?
>
> Thanks,
>
> Francisco
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 
--
David Weintraub
qazwart@gmail.com

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


Re: Using -buildfile without setting the basedir?

Posted by David Brown <da...@davidwbrown.name>.
Take a look at the following link. This link has examples. HTH.

http://ant.apache.org/manual/CoreTasks/ant.html


Francisco Tolmasky wrote ..
> I'm trying to use a build file that is located in a different  
> directory by doing the following:
> 
> ant -f a/b/thebuild.xml
> 
> However, this has the side effect of changing my basedir to a/b/ as  
> well, which I don't want,
> I just want to run ant in my current directory with the build file of  
> a different directory. Any
> thoughts?
> 
> Thanks,
> 
> Francisco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

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