Mercurial > public > ssdtant
view src/org/ssdt_ohio/tools/ant/AddDependencyTask.java @ 3:af958c5027b1
add test junit summary xsl
author | smith@nwoca.org |
---|---|
date | Thu, 09 Jun 2011 11:57:09 -0400 |
parents | 82fc5e17cc59 |
children | de1522a9d4bc |
line wrap: on
line source
package org.ssdt_ohio.tools.ant; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Target; import org.apache.tools.ant.Task; /** @author smith */ public class AddDependencyTask extends Task { private String target; private String depends; @Override public void execute() throws BuildException { if (target == null) { throw new BuildException("'target' attribute is required"); } if (depends == null) { throw new BuildException("'depends' attribute is required"); } Target t = (Target) getProject().getTargets().get(target); if (t.dependsOn(depends)) { log(target + " already depends on " + depends, Project.MSG_VERBOSE); } else { log("Adding \"" + depends + "\" dependency to \"" + target + "\"", Project.MSG_VERBOSE); t.addDependency(depends); } } public void setTarget(String target) { this.target = target; } public void setDepends(String depends) { this.depends = depends; } }