Permalink
Browse files

Added minification with YUI Compressor

  • Loading branch information...
1 parent 52f9518 commit 4b8d1d07d79c83204b23f800f4f4b15f275358d1 Nicholas C. Zakas committed Dec 8, 2011
Showing with 18 additions and 5 deletions.
  1. +18 −5 build.xml
  2. BIN lib/yuicompressor-2.4.7.jar
View
@@ -14,6 +14,9 @@
<!-- the directory containing library files -->
<property name="lib.dir" value="./lib" />
+
+ <!-- tools -->
+ <property name="yuicompressor" value="yuicompressor-2.4.7.jar" />
<!-- output filenames -->
<property name="core.build.file" value="clover-core.css"/>
@@ -44,6 +47,7 @@
<delete dir="${build.dir}" />
</target>
+ <!-- update the changelog automagically -->
<target name="changelog.update">
<exec executable="git" failonerror="true" outputproperty="git.tag">
<arg line="tag"/>
@@ -86,15 +90,24 @@
<!-- your customized arguments go here -->
<arg line="${cssfiles.clean} --errors=errors --quiet"/>
</exec>
- </target>
+ </target>
+
+ <!-- minify CSS files with YUI Compressor -->
+ <target name="minify">
+ <exec executable="java" failonerror="true">
+ <arg line="-jar"/>
+ <arg path="${lib.dir}/${yuicompressor}"/>
+ <arg line="-o '.css$:-min.css' ${build.dir}/*.css"/>
+ </exec>
+ </target>
<!-- build the core library -->
<target name="build.core">
<concat destfile="${build.dir}/${core.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
- /* Version v@VERSION@, Build time: ${RIGHT_NOW} */
+ /*! Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<filelist dir="${lib.dir}" files="libraries.css" />
<fileset dir="${src.core.dir}/template" includes="*.css" excludes="*_debug.css"/>
@@ -114,7 +127,7 @@
<header trimleading="yes">/*!
${license.text}
*/
- /* Version v@VERSION@, Build time: ${RIGHT_NOW} */
+ /*! Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${src.core.dir}/template" includes="*_debug.css"/>
<fileset dir="${src.core.dir}/grid" includes="*_debug.css"/>
@@ -132,7 +145,7 @@
<header trimleading="yes">/*!
${license.text}
*/
- /* Build time: ${RIGHT_NOW} */
+ /*! Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${src.plugins.dir}" includes="**/*.css" excludes="*_debug.css"/>
</concat>
@@ -156,7 +169,7 @@
</target>
<!-- Build all files -->
- <target name="build.all" depends="clean,lint,build.core,build.core.debug,build.plugins">
+ <target name="build.all" depends="clean,lint,build.core,build.core.debug,build.plugins,minify">
<concat destfile="${build.dir}/${all.build.file}" fixlastline="true">
<filelist dir="${build.dir}" files="${core.build.file},${plugins.build.file}"/>
</concat>
View
Binary file not shown.

0 comments on commit 4b8d1d0

Please sign in to comment.