Created
September 26, 2010 05:02
-
-
Save eriwen/597619 to your computer and use it in GitHub Desktop.
YUI Compressor ant build for static content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="eriwen-static" default="prod" basedir="."> | |
<property name="src.dir" location="${basedir}/static" /> | |
<property name="js.version" value="2" /> | |
<property name="css.version" value="17" /> | |
<target name="prod" depends="js.concatenate, js.minify, css.minify" | |
description="Full production build"> | |
</target> | |
<target name="load.properties"> | |
<property file="ant.properties"/> | |
</target> | |
<target name="js.concatenate"> | |
<concat destfile="${src.dir}/js/all.${js.version}.js"> | |
<filelist dir="${src.dir}/js" files="main.${js.version}.js, stacktrace.js"/> | |
</concat> | |
</target> | |
<target name="js.minify" depends="js.concatenate"> | |
<apply executable="java" parallel="false"> | |
<fileset dir="." includes="static/js/all.${js.version}.js"/> | |
<arg line="-jar"/> | |
<arg path="${basedir}/yuicompressor-2.4.2.jar"/> | |
<srcfile/> | |
<arg line="-o"/> | |
<mapper type="glob" from="*.js" to="*-min.js"/> | |
<targetfile/> | |
</apply> | |
</target> | |
<target name="css.minify" depends="js.concatenate"> | |
<apply executable="java" parallel="false"> | |
<fileset dir="." includes="static/css/style.${css.version}.css"/> | |
<arg line="-jar"/> | |
<arg path="${basedir}/yuicompressor-2.4.2.jar"/> | |
<arg line="--line-break 0"/> | |
<srcfile/> | |
<arg line="-o"/> | |
<mapper type="glob" from="*.css" to="*-min.css"/> | |
<targetfile/> | |
</apply> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is decently old. Recommend using the Gradle plugins for this very thing http://git.io/gradlejs and http://git.io/gradlecss