Search in sources :

Example 1 with LogOutputResource

use of org.apache.tools.ant.types.resources.LogOutputResource in project ant by apache.

the class Concat method execute.

/**
 * Execute the concat task.
 */
@Override
public void execute() {
    validate();
    if (binary && dest == null) {
        throw new BuildException("dest|destfile attribute is required for binary concatenation");
    }
    ResourceCollection c = getResources();
    if (isUpToDate(c)) {
        log(dest + " is up-to-date.", Project.MSG_VERBOSE);
        return;
    }
    if (c.isEmpty() && ignoreEmpty) {
        return;
    }
    try {
        // most of these are defaulted because the concat-as-a-resource code hijacks a lot:
        ResourceUtils.copyResource(new ConcatResource(c), dest == null ? new LogOutputResource(this, Project.MSG_WARN) : dest, null, null, true, false, append, null, null, getProject(), force);
    } catch (IOException e) {
        throw new BuildException("error concatenating content to " + dest, e);
    }
}
Also used : BuildException(org.apache.tools.ant.BuildException) IOException(java.io.IOException) LogOutputResource(org.apache.tools.ant.types.resources.LogOutputResource) ResourceCollection(org.apache.tools.ant.types.ResourceCollection)

Aggregations

IOException (java.io.IOException)1 BuildException (org.apache.tools.ant.BuildException)1 ResourceCollection (org.apache.tools.ant.types.ResourceCollection)1 LogOutputResource (org.apache.tools.ant.types.resources.LogOutputResource)1