davidB / yuicompressor-maven-plugin

maven's plugin to compress (Minify / Ofuscate / Aggregate) Javascript files and CSS files using YUI Compressor
http://davidb.github.io/yuicompressor-maven-plugin/
GNU Lesser General Public License v2.1
122 stars 48 forks source link

Permit automatic exclusions aggregation strategy #69

Closed dlh3 closed 10 years ago

dlh3 commented 10 years ago

It would be great to have an aggregation strategy that would omit files which were included in other aggregations.

Example (assume files A.css through H.css):

<aggregations>
    <aggregation>
        <includes>
            <include>**/A.css</include>
            <include>**/B.css</include>
            <include>**/C.css</include>
        </includes>
        <output>${project.build.outputDirectory}/A-C.css</output>
    </aggregation>
    <aggregation>
        <includes>
            <include>**/F.css</include>
            <include>**/G.css</include>
        </includes>
        <output>${project.build.outputDirectory}/F-G.css</output>
    </aggregation>
    <aggregation>
        <includes>
            <include>**/*.css</include>
        </includes>
        <excludes>
            <exclude>**/H.css</exclude>
        </excludes>
        <autoExclude>true</autoExclude>
        <output>${project.build.outputDirectory}/D-E.css</output>
    </aggregation>
    <aggregation>
        <includes>
            <include>**/*.css</include>
        </includes>
        <autoExclude>true</autoExclude>
        <output>${project.build.outputDirectory}/H.css</output>
    </aggregation>
</aggregations>

This would be a great convenience for the case where multiple special aggregations are needed (like A-C and F-G).

dlh3 commented 10 years ago

I will try to find the time to contribute with a pull request.

dlh3 commented 10 years ago

Added commit to implement requested feature. Includes an additional test case covering the change.