You can use the bool target::has-executed(name) function inside of the
process-traces target instead of a dependency check.
Ie, the process-traces target would also contain a chain of 'call'
tasks, but each would contain this 'unless' test.
For example, inside process-traces, you'd have:
<call target="check-trends-dir" unless="${target::has-executed('check-
trends-dir')}"/>
you could wrap this in a custom task (callonce?) that essentially
performs:
<call target="${targetname}" unless="${target::has-
executed(targetname)}"/>
Hope that helps.
dominic
On Sep 3, 2008, at 8:56 PM, Steve Kapinos wrote:
> Found my own answer...
>
> http://nant.sourceforge.net/release/0.85-rc1/help/fundamentals/targets.h
> tml
>
> " A target gets executed only once, even when more than one target
> depends on it (see the previous example). However, when the <call>
> task
> is used to execute a target, both the target and all its dependent
> targets will be re-executed."
>
> Since I'm trying to use targets as basically functions... I'm stuck in
> this way due to call. Any better ideas on how to structure this
> where I
> have a reusable block of code that I want to run again with simply
> different inputs?
>
> -Steve
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Steve
> Kapinos
> Sent: Wednesday, September 03, 2008 8:53 AM
> To: [email protected]
> Subject: [NAnt-users] dependancy persistance or resetting?
>
> I have a build file setup where one main body, calls several other
> targets acting like functions. It was setup this way because the
> sequence of the events was critical, and the job was specified it
> had to
> run in a single pass.
>
> So my main target looks like this
>
> <target name="all" depends="" description="runs full test
> suite">
> <!-- Run average test -->
> <call target="cleandatabase"/>
> <property name="testtype" value="average"/>
> <call target="jmetertest-average"/>
> <!-- Call process-traces to parse logdir output
> and tag with testtype -->
> <call target="process-traces"/>
>
> <!-- Run peak test -->
> <call target="cleandatabase"/>
> <property name="testtype" value="peak"/>
> <call target="jmetertest-peak"/>
> <!-- Call process-traces to parse logdir output
> and tag with testtype -->
> <call target="process-traces"/>
>
> <!-- Create trending graphs as both runs are now in
> accumulated.data.dir -->
> <call target="create-trend-graphs"/>
> </target>
>
> Note the call target to 'process-traces' is called twice and at the
> end,
> 'create-trend-graphs' is called. My question comes from the
> dependencies set on those targets. 'process-traces' is defined as
>
> <target name="process-traces"
> depends="check-trends-dir,build-processing-tool,get-svn-revision"
> description="Processing of trace from test run">
>
> This runs fine.. but when 'process-traces' is ran the second time for
> the peak part of the test, the dependant targets are all ran again.
> The
> fact they were ran the first time 'process-traces' was called, seems
> to
> be forgotten.
>
> I have the same problem with create-trend-graphs, which has a
> dependency
> set for process-traces (for manual runs outside of the larger test
> target). Even tho process-traces was called twice, when the last
> <call
> target="create-trend-graphs"/> was ran, 'process-traces' would be run
> again.
>
> Does dependency tracking not persist across an entire run of nant?
> Does
> using call target change its behavior?
>
> I've solved the problem for now simply by removing dependancies where
> they were causing problems if they ran twice, and ignoring those that
> are harmless, but it makes the individual targets less robust.
>
>
> ------------------------------------------------------------------------
> -
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> NAnt-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> NAnt-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nant-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users