You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2007/06/07 10:51:45 UTC
svn commit: r545144 - in
/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant: AntBuildTrigger.java
AntCallTrigger.java
Author: xavier
Date: Thu Jun 7 03:51:41 2007
New Revision: 545144
URL: http://svn.apache.org/viewvc?view=rev&rev=545144
Log:
code cleanup
Modified:
incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntCallTrigger.java
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java?view=diff&rev=545144&r1=545143&r2=545144
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntBuildTrigger.java Thu Jun 7 03:51:41 2007
@@ -36,10 +36,19 @@
import org.apache.tools.ant.taskdefs.Property;
/**
- * Triggers an ant build on an event occurence. Example of use: <ant-build-trigger
- * event="pre-resolve-dependency" filter="revision=latest.integration"
- * antfile="/path/to/[module]/build.xml" target="compile"/> Triggers an ant build for any dependency
- * in asked in latest.integration, just before resolving the dependency.
+ * Triggers an ant build on an event occurence.
+ * <p>
+ * Example of use:
+ *
+ * <pre>
+ * <ant-build-trigger event="pre-resolve-dependency"
+ * filter="revision=latest.integration"
+ * antfile="/path/to/[module]/build.xml"
+ * target="compile"/>
+ * </pre>
+ *
+ * Triggers an ant build for any dependency in asked in latest.integration, just before resolving
+ * the dependency.
*
* @see AntCallTrigger
* @since 1.4
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntCallTrigger.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntCallTrigger.java?view=diff&rev=545144&r1=545143&r2=545144
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntCallTrigger.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/AntCallTrigger.java Thu Jun 7 03:51:41 2007
@@ -34,22 +34,30 @@
import org.apache.tools.ant.taskdefs.Property;
/**
- * Triggers an call to an ant target on an event occurence. This trigger only works when ivy is
- * called from an ant build file, otherwise the trigger only log a failure. Example of use in an
- * ivysettings file: <ant-call-trigger event="post-download-artifact" filter="type=zip"
- * target="unzip"/> Triggers a call to the target "unzip" for any downloaded artifact of type zip
+ * Triggers an call to an ant target on an event occurence.
+ * <p>
+ * This trigger only works when ivy is called from an ant build file, otherwise the trigger only log
+ * a failure.
+ * <p>
+ * Example of use in an ivysettings file:
+ *
+ * <pre>
+ * <ant-call-trigger event="post-download-artifact" filter="type=zip"
+ * target="unzip"/>
+ * </pre>
+ * Triggers a call to the target "unzip" for any downloaded artifact of type zip
*
* @see AntBuildTrigger
* @since 1.4
*/
public class AntCallTrigger extends AbstractTrigger implements Trigger {
- private boolean _onlyonce = true;
+ private boolean onlyonce = true;
- private String _target = null;
+ private String target = null;
- private Collection _calls = new ArrayList();
+ private Collection calls = new ArrayList();
- private String _prefix;
+ private String prefix;
public void progress(IvyEvent event) {
Project project = (Project) IvyContext.getContext().peek(IvyTask.ANT_PROJECT_CONTEXT_KEY);
@@ -57,7 +65,7 @@
Message.info("ant call trigger can only be used from an ant build. Ignoring.");
return;
}
- if (_onlyonce && isTriggered(event)) {
+ if (onlyonce && isTriggered(event)) {
Message.verbose("call already triggered for this event, skipping: " + event);
} else {
CallTarget call = new CallTarget();
@@ -73,7 +81,7 @@
String key = (String) iter.next();
String value = (String) attributes.get(key);
Property p = call.createParam();
- p.setName(_prefix == null ? key : _prefix + key);
+ p.setName(prefix == null ? key : prefix + key);
p.setValue(value == null ? "" : value);
}
@@ -92,37 +100,37 @@
}
private void markTriggered(IvyEvent event) {
- _calls.add(event);
+ calls.add(event);
}
private boolean isTriggered(IvyEvent event) {
- return _calls.contains(event);
+ return calls.contains(event);
}
public String getTarget() {
- return _target;
+ return target;
}
public void setTarget(String target) {
- _target = target;
+ this.target = target;
}
public boolean isOnlyonce() {
- return _onlyonce;
+ return onlyonce;
}
public void setOnlyonce(boolean onlyonce) {
- _onlyonce = onlyonce;
+ this.onlyonce = onlyonce;
}
public String getPrefix() {
- return _prefix;
+ return prefix;
}
public void setPrefix(String prefix) {
- _prefix = prefix;
+ this.prefix = prefix;
if (!prefix.endsWith(".")) {
- _prefix += ".";
+ prefix += ".";
}
}
}