Concatenating CSS files in a specific order

Viewed 1823

I have a series of CSS files that I am concatenating and minfying (using the YUI Compressor) with an Ant build script. The CSS files are:

  • Reset.css
  • Formalize.css
  • Typography.css
  • Site.css

There are other CSS files like ie.css and editor.css that I don't want to include in the minification. I have my build script working with the following code, but the problem now is that the files need to be concatenated in the order posted above.

<target name="minifycss">
    <!-- Combine all CSS files except for ones specified for IE or the content editor -->
    <concat destfile="css/e123-1.css">
        <fileset dir="css" includes="*.css" excludes="ie.css editor.css print.css" />
    </concat>

    <!-- Minify the css -->
    <java fork="true" jar="${yuicompressor.lib}" dir="css" output="css/e123-1.min.css">
        <arg value="e123-1.css" />
    </java>
</target>

I assume that the files are added alphabetically, but I was wondering if there was a way to tell Ant what order to concatenate the files without renaming them to 1reset.css, 2formalize.css, etc.

2 Answers
Related