Try to change Build1.build to:
<project name="build1" default="build" basedir=".">
<ifnot propertyexists="project.name">
<property name="project.name" value="build1" />
</ifnot>
<target name="build">
<echo message="Child project name ${project.name}" />
</target>
</project>
Eberhard
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 11:01 AM
> To: Ian MacLean
> Cc: [EMAIL PROTECTED]
> Subject: RE: [Nant-users] Passing attributes when calling <nant... >?
>
>
> Thanks hugely for this Ian - that's exactly the functionality
> I was looking for, so I guess it's not there yet.
> Unfortunately I seem to have misunderstood inheritall too!
> What I'm trying to do is effectively have default parameters
> in a build file that can be overridden when called from
> another build file. For example:
>
> build1.build:
>
> <project name="build1" default="build" basedir=".">
> <property name="project.name" value="build1" />
> <target name="build">
> <echo message="Child project name ${project.name}" />
> </target>
> </project>
>
> build2.build:
>
> <project name="build2" default="build" basedir=".">
> <property name="project.name" value="build2" />
> <target name="build">
> <echo message="Parent project name ${project.name}" />
> <nant buildfile="build1.build" inheritall="true" />
> </target>
> </project>
>
> When calling nant on build1.build, as expected it returns
> "Child project name build1".
>
> I would have hoped that when build2 calls nant on build1, it
> would return "Child project name build2" - unfortunately when
> you run this, it's still "build1". I'm using version 0.8.2.
>
> Can you or anyone think of a way of doing what I'm trying to do?
>
> Many thanks
>
> Kenton Price
>
> -----Original Message-----
> From: Ian MacLean [mailto:[EMAIL PROTECTED]
> Sent: Tue 08/07/2003 15:43
> To: Kenton Price
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Nant-users] Passing attributes when
> calling <nant... >?
>
>
>
> Kenton,
> right now you can use the inheritall attribute to get
> all of them. There
> is no way right now of passing selected properties.
> Maybe it would be
> useful to have an optionset under the nant task so you could do:
>
> <nant buildfile="[buildfile2]" target="build >
> <properties>
> <property name="attribute1"
> value="${attribute1}" />
> </properties>
>
> </nant>
>
> Ian
>
> >Hi
> >
> >Apologies if this has been answered before, but I'm
> trying to pass selected specific attributes when calling
> <nant>. I don't want to inherit all attributes, just some of
> them. I was hoping to be able to do something like this:
> >
> > <nant buildfile="[buildfile2]" target="build
> -D:attribute1=${attribute1} -D:attribute3=${attribute3} />
> >
> >but it falls over. Is there a way of doing what I'm
> trying to do?
> >
> >Many thanks
> >
> >Kenton Price
>
> >?????????????????????????????????????????ӆ+?^?隊[)?{(??[??ky
> [EMAIL PROTECTED];"??"??nv)?
>
> >?ZE?h????(?g?q?Ϣ?Z??ڝ?h??j?????i?^????'?????Zɩ?z{^??0?v?\?
> ??b??J?????????w???brO?_ܢo??lkM5?M4???ثy??j?ڲ???]???5?M?????
> ???????????????????????????????Z????왨??x%??Mj{??ǫ??b??????q??
> ???a??l????l??.?ǟ???w??X?????b????????
> >
> >
>
>
>
>
> NHznȴ4ixjjzzɮ\JNr ӽ XX֧ b,ۢ y+ m +-.ʭǟ+-떳b ~j{n
>
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users