/** * Execute the task. * @throws BuildException if errors occur. */ @Override public void execute() throws BuildException { if (sources == null) { throw new BuildException( "At least one set of source resources must be specified"); } if (targets == null) { throw new BuildException( "At least one set of target files must be specified"); } //no sources = nothing to compare; no targets = nothing to delete: if (!sources.isEmpty() && !targets.isEmpty() && !uptodate(sources, targets)) { log("Deleting all target files.", Project.MSG_VERBOSE); if (verbose) { for (String t : targets.list()) { log("Deleting " + t); } } Delete delete = new Delete(); delete.bindToOwner(this); delete.add(targets); delete.perform(); } }