diff --git a/WHATSNEW b/WHATSNEW index 00b65fcd3..5ab9b9c27 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -128,7 +128,11 @@ Other changes: * has new attributes fileMode and dirMode that control the permissions on the remote side when sending data via SSH. - Bugzilla Report 43271 + Bugzilla Report 43271. + + * New and resource collections can be used + to select all but a given subset of a resource collection. + Bugzilla Report 57834. Changes from Ant 1.9.3 TO Ant 1.9.4 =================================== diff --git a/manual/Types/resources.html b/manual/Types/resources.html index 061168fc6..76d313bbb 100644 --- a/manual/Types/resources.html +++ b/manual/Types/resources.html @@ -359,6 +359,10 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections: nested collection
  • last - last n resources from a nested collection
  • +
  • allbutfirst - all except the + first n resources from a nested collection
  • +
  • last - all except the last n + resources from a nested collection
  • tokens - string tokens gathered from a nested collection
  • union - set union of nested resource collections
  • @@ -964,6 +968,64 @@ larger collection. Since Ant 1.7.1.

    A single resource collection is required.

    +

    allbutfirst

    +

    Includes all elements except for the first count resources +from a nested resource collection. This can be used in conjunction +with the sort collection, for example, to select +all but the first few oldest, largest, etc. resources from a larger +collection. Since Ant 1.9.5.

    +
    + + + + + + + + + + + + + + + + +
    AttributeDescriptionRequired
    countThe number of resources to excludeNo, default 1
    cacheWhether to cache results; disabling + may seriously impact performanceNo, default true
    +

    Parameters specified as nested elements

    +

    A single resource collection is required.

    +
    + +

    allbutlast

    +

    Includes all elements except for the last count resources +from a nested resource collection. This can be used in conjunction +with the sort collection, for example, to select +all but the last few oldest, largest, etc. resources from a larger +collection. Since Ant 1.9.5.

    +
    + + + + + + + + + + + + + + + + +
    AttributeDescriptionRequired
    countThe number of resources to excludeNo, default 1
    cacheWhether to cache results; disabling + may seriously impact performanceNo, default true
    +

    Parameters specified as nested elements

    +

    A single resource collection is required.

    +
    +

    tokens

    Includes the string tokens gathered from a nested resource collection. Uses the same tokenizers supported by the diff --git a/src/main/org/apache/tools/ant/types/resources/AllButFirst.java b/src/main/org/apache/tools/ant/types/resources/AllButFirst.java index d9ea50648..ffa665f83 100644 --- a/src/main/org/apache/tools/ant/types/resources/AllButFirst.java +++ b/src/main/org/apache/tools/ant/types/resources/AllButFirst.java @@ -33,7 +33,7 @@ import org.apache.tools.ant.types.Resource; public class AllButFirst extends SizeLimitCollection { /** - * Take the first count elements. + * Take all elements except for the first count elements. * @return a Collection of Resources. */ protected Collection getCollection() {