By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,672 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,672 IT Pros & Developers. It's quick & easy.

Nested buildfiles with Nant.

P: n/a
Hi all,

I'm having a problem with <nant> tasks to build sub-projects into an
overall solution. I have the following directory structure:

JobManagerSolution
|_
| JobManager
|_
JobManagerController

where the overall build file is in JobManagerSolution and the
sub-project build files are in JobManager and JobManagerControl. This
is the JobmanagerSolution build file:

<?xml version="1.0"?>
<project name="JobManager" default="build" basedir=".">
<target name="build" description="Clean and build entire solution.">
<nant buildfile="JobManager/JobManager.build" target="clean"
failonerror="false" />
<nant buildfile="JobManager/JobManager.build" />
<nant buildfile="JobManagerControl/JobManagerControl.build"
target="clean" failonerror="false" />
<nant buildfile="JobManagerControl/JobManagerControl.build" />
</target>
</project>

The problem I'm having is that the basedir of the parent build is
being inherited by JobManager and JobManagerControl, and so the paths
are all wrong. I know ant has a dir attribute which can be used to
determine which basedir the child build will have, but there seems to
be no equivalent in Nant. Also I've tried explicitly setting
inheritall="false", but the parent project directory is still used by
the children.

Anyone else come across this?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ni****@nopworld.com (Nigel Currie) wrote in message news:<54**************************@posting.google. com>...
The problem I'm having is that the basedir of the parent build is
being inherited by JobManager and JobManagerControl, and so the paths
are all wrong. I know ant has a dir attribute which can be used to
determine which basedir the child build will have, but there seems to
be no equivalent in Nant. Also I've tried explicitly setting
inheritall="false", but the parent project directory is still used by
the children.


Have you tried using ${nant.project.basedir} ?

It appears to be relative to the project build file and will be
correct in your child builds.

HTH,

Jonathan Cogley
Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.