Search in sources :

Example 1 with Intersect

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

the class Concat method getResources.

/**
 * Get the resources to concatenate.
 */
private ResourceCollection getResources() {
    if (rc == null) {
        return new StringResource(getProject(), textBuffer.toString());
    }
    if (dest != null) {
        Intersect checkDestNotInSources = new Intersect();
        checkDestNotInSources.setProject(getProject());
        checkDestNotInSources.add(rc);
        checkDestNotInSources.add(dest);
        if (checkDestNotInSources.size() > 0) {
            throw new BuildException("Destination resource %s was specified as an input resource.", dest);
        }
    }
    Restrict noexistRc = new Restrict();
    noexistRc.add(NOT_EXISTS);
    noexistRc.add(rc);
    for (Resource r : noexistRc) {
        log(r + " does not exist.", Project.MSG_ERR);
    }
    Restrict result = new Restrict();
    result.add(EXISTS);
    result.add(rc);
    return result;
}
Also used : StringResource(org.apache.tools.ant.types.resources.StringResource) Intersect(org.apache.tools.ant.types.resources.Intersect) Restrict(org.apache.tools.ant.types.resources.Restrict) FileResource(org.apache.tools.ant.types.resources.FileResource) LogOutputResource(org.apache.tools.ant.types.resources.LogOutputResource) Resource(org.apache.tools.ant.types.Resource) StringResource(org.apache.tools.ant.types.resources.StringResource) BuildException(org.apache.tools.ant.BuildException)

Aggregations

BuildException (org.apache.tools.ant.BuildException)1 Resource (org.apache.tools.ant.types.Resource)1 FileResource (org.apache.tools.ant.types.resources.FileResource)1 Intersect (org.apache.tools.ant.types.resources.Intersect)1 LogOutputResource (org.apache.tools.ant.types.resources.LogOutputResource)1 Restrict (org.apache.tools.ant.types.resources.Restrict)1 StringResource (org.apache.tools.ant.types.resources.StringResource)1