You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by xa...@apache.org on 2008/09/15 09:50:45 UTC

svn commit: r695368 - in /ant/ivy/core/trunk: doc/settings/triggers.html src/java/org/apache/ivy/ant/AntBuildTrigger.java

Author: xavier
Date: Mon Sep 15 00:50:45 2008
New Revision: 695368

URL: http://svn.apache.org/viewvc?rev=695368&view=rev
Log:
document the confusing onlyonce property on ant build trigger

Modified:
    ant/ivy/core/trunk/doc/settings/triggers.html
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java

Modified: ant/ivy/core/trunk/doc/settings/triggers.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/settings/triggers.html?rev=695368&r1=695367&r2=695368&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/settings/triggers.html (original)
+++ ant/ivy/core/trunk/doc/settings/triggers.html Mon Sep 15 00:50:45 2008
@@ -30,7 +30,12 @@
 <span class="tagdoc" id="ivysettings.triggers">Defines a list of triggers to activate on some Ivy events.</span>
 
 A trigger is an action which is performed whenever a particular event occurs.
-Ivy supports two type of triggers out of the box: ant-call and ant-build. The first calls a target in the same build as the original one whenever a particular event occurs, the second call an ant build which may be in another ant build script.
+Ivy supports 3 type of triggers out of the box: 
+<ul>
+<li>ant-call</li> calls a target in the same build as the original one whenever a particular event occurs. 
+<li>ant-build</li> calls an ant build which may be in another ant build script. 
+<li>log</li> echo a message, usually in a file
+</ul>
 
 If you want to use a different trigger, you can <a href="../extend.html">implement your own</a>.
 
@@ -219,14 +224,14 @@
 </table>
 
 <h1>Built-in Triggers</h1>
-Ivy comes with two built-in triggers: 
+Ivy comes with 3 built-in triggers: 
 
 <table class="ivy-attributes">
 <thead>
     <tr><th>Name</th><th>Description</th></tr>
 </thead>
 <tbody>
-<tr><td>ant-build</td><td>Triggers an ant build.</td></tr>
+<tr><td>ant-build</td><td>Triggers an ant build. Note that by default the ant build is triggered only once per build file, the property onlyonce can be set to false to change this.</td></tr>
 <tr><td>ant-call</td><td>Calls a target in the current ant build.</td></tr>
 <tr><td>log</td><td>Logs a message on the console or in a log file.</td></tr>
 </tbody>
@@ -266,6 +271,16 @@
 </triggers>
 </code>
 Triggers an ant build of the ant file ${ivy.settings.dir}/[module]/build.xml (where [module] is replaced by the name of the dependency resolved) with the target "publish", just before resolving a dependency with a latest.integration revision.
+Note that by default the ant build is triggered only once per build file. See below to see how to trigger the build more than once.
+<hr/>
+<code type="xml">
+<triggers>
+    <ant-build antfile="${ivy.settings.dir}/[module]/build.xml" target="publish"
+           event="pre-resolve-dependency" filter="revision=latest.integration"
+           onlyonce="false" />
+</triggers>
+</code>
+Same as before, but this time the builds will be triggered as many time as the dependency is resolved, instead of only once.
 <hr/>
 <code type="xml">
 <triggers>

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java?rev=695368&r1=695367&r2=695368&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java Mon Sep 15 00:50:45 2008
@@ -48,6 +48,11 @@
  * 
  * Triggers an ant build for any dependency in asked in latest.integration, just before resolving
  * the dependency.
+ * </p>
+ * <p>
+ * The onlyonce property is used to tell if the ant build should be triggered only once, or several
+ * times in the same build.
+ * </p>
  * 
  * @see AntCallTrigger
  * @since 1.4