Oh, I could do that. The only difference is that with the compile target I can remove duplication if targets other than test need to have this type of dependency as well.

 


From: Felice Vittoria [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 16, 2004 11:31 AM
To: Castro, Edwin Gabriel (Firing Systems Engr.); McCullough, Gary; [EMAIL PROTECTED]
Subject: RE: [Nant-users] Target depending on one of two other targets

 

Why can't you put the code in the compile target in the test target ... so it would look like this:

 

<project name=”projectA”>

<target name=”build” />

 

<target name=”rebuild” />

 

<target name=”test">

  <ifnot test=”${target::has-executed(‘build’) or target::has-executed(‘rebuild’)}”>

    <call target=”build” />

  </ifnot>

</target>

 

</project>

 

Felice

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Castro, Edwin Gabriel (Firing Systems Engr.)
Sent: Thursday, September 16, 2004 12:21 PM
To: McCullough, Gary; [EMAIL PROTECTED]
Subject: RE: [Nant-users] Target depending on one of two other targets

Here is the way I was doing it so far:

 

<project name=”projectA”>

 

<target name=”build” />

 

<target name=”rebuild” />

 

<target name=”compile>

  <ifnot test=”${target::has-executed(‘build’) or target::has-executed(‘rebuild’)}”>

    <call target=”build” />

  </ifnot>

</target>

 

<target name=”test” depends=”compile” />

 

</project>

 

The solution is not too difficult. I am more curious as to whether there is a better way to do this. Thanks!

 

--

Edwin

 


From: McCullough, Gary [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 16, 2004 9:50 AM
To: Castro, Edwin Gabriel (Firing Systems Engr.); [EMAIL PROTECTED]
Subject: RE: [Nant-users] Target depending on one of two other targets

 

You could have your dependency projects set a property which your dependent could check.

 


Gary McCullough 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Castro, Edwin Gabriel (Firing Systems Engr.)
Sent: Thursday, September 16, 2004 12:36 PM
To: [EMAIL PROTECTED]
Subject: [Nant-users] Target depending on one of two other targets

 

Is there an easy way to have one target depend on one of two (or more) other targets?

 

I have a build file similar to the following:

 

<project name=”projectA”>

<target name=”build” />

<target name=”rebuild” />

<target name=”test” />

</project>

 

I would like my test target to make sure that either build or rebuild has been executed (I can set one as default if none has executed). I think in the past I had to use another target that ensured my dependency and I had test depend on this target.

 

--

Edwin

Reply via email to