Skip to content
Permalink
Browse files

Build: Cleanup and adding CSS minimization. Fixes #5824 - Minify CSS

  • Loading branch information...
jzaefferer committed Oct 19, 2010
1 parent 25853be commit af582b97a70e955432fdf4123891b75d2f2c68c5
Showing with 37 additions and 18 deletions.
  1. +37 −18 build/build.xml
  2. BIN build/build/yuicompressor-2.4.2.jar
@@ -40,8 +40,9 @@
<property name="core.files.min" value="jquery.ui.core.min.js, jquery.ui.widget.min.js, jquery.ui.mouse.min.js, jquery.ui.draggable.min.js, jquery.ui.droppable.min.js, jquery.ui.resizable.min.js, jquery.ui.selectable.min.js, jquery.ui.sortable.min.js, jquery.effects.core.min.js" />

<property description="Google Closure" name="closure-jar" value="${build.dir}/google-compiler-20091218.jar" />
<property description="YUI Compressor" name="yuicompressor-jar" value="${build.dir}/yuicompressor-2.4.2.jar" />

<target name="deploy-release" depends="clean, docs-download, concatenate, minify, copy, replace-version, prepend-header, zip" description="Release builder">
<target name="deploy-release" depends="clean, docs-download, copy, minify, replace-version, prepend-header, zip" description="Release builder">
</target>

<target name="replace-version">
@@ -74,6 +75,26 @@
<fileset dir="${dist.dir}/ui-headered/" includes="*.js" />
</copy>

<copy todir="${dist.dir}/headers/">
<fileset dir="${dist.dir}/themes/base" includes="*.css" />
</copy>
<replaceregexp match="^(\/\*.*?\*\/\s).+" replace="\1" flags="s">
<fileset dir="${dist.dir}/headers/" includes="*.css"/>
</replaceregexp>
<for param="file">
<path><fileset dir="${dist.dir}/themes/base/minified" includes="*.css" /></path>
<sequential>
<propertyregex override="yes" property="target" input="@{file}" regexp=".*[\\/](.+)\.min\.css$" replace="\1"/>
<concat destfile="${dist.dir}/ui-headered/${target}.min.css">
<header file="${dist.dir}/headers/${target}.css" />
<fileset file="@{file}" />
</concat>
</sequential>
</for>
<copy todir="${dist.dir}/themes/base/minified" overwrite="true">
<fileset dir="${dist.dir}/ui-headered/" includes="*.css" />
</copy>

<!-- once more for the i18n files -->
<!-- need to clean up headers in those files first
<copy todir="${dist.dir}/headers/i18n/">
@@ -136,13 +157,12 @@

<target name="minify" depends="concatenate" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building minified" />
<delete dir="${min.dir}/" />
<mkdir dir="${min.dir}" />
<delete dir="${min.dir}/i18n/" />
<mkdir dir="${min.dir}/i18n/" />
<mkdir dir="${dist.dir}/themes/base/minified" />

<apply executable="java" parallel="false">
<fileset dir="${src.dir}/" includes="jquery.ui.*.js, jquery.effects.*.js" />
<fileset dir="${dist.dir}/ui" includes="*.js" />
<arg line="-jar" />
<arg path="${closure-jar}" />
<arg value="--warning_level" />
@@ -153,13 +173,8 @@
<mapper type="glob" from="*.js" to="${min.dir}/*.min.js" />
</apply>

<concat destfile="${min.dir}/${concatenated}.min.js">
<filelist dir="${min.dir}" files="${core.files.min}" />
<fileset dir="${min.dir}" includes="jquery.ui.*.js, jquery.effects.*.js" excludes="${core.files.min}" />
</concat>

<apply executable="java" parallel="false">
<fileset dir="${src.dir}/i18n/" includes="jquery.ui.*.js" />
<fileset dir="${dist.dir}/ui/i18n" includes="*.js" />
<arg line="-jar" />
<arg path="${closure-jar}" />
<arg value="--warning_level" />
@@ -170,9 +185,17 @@
<mapper type="glob" from="*.js" to="${min.dir}/i18n/*.min.js" />
</apply>

<concat destfile="${min.dir}/i18n/${concatenated.i18n}.min.js">
<fileset dir="${min.dir}/i18n" includes="jquery.ui.*.js" />
</concat>
<apply executable="java" parallel="false">
<fileset dir="${dist.dir}/themes/base" includes="*.css" />
<arg line="-jar" />
<arg path="${yuicompressor-jar}" />
<arg line="--charset utf-8" />
<arg line="-v" />
<srcfile />
<arg line="-o" />
<mapper type="glob" from="*.css" to="${dist.dir}/themes/base/minified/*.min.css" />
<targetfile/>
</apply>

<echo message="Minified ui/ built." />
</target>
@@ -219,7 +242,7 @@
<delete dir="dist" />
</target>

<target name="docs-download" depends="docs-clean">
<target name="docs-download">
<mkdir dir="${docs.dir}" />
<property name="url" value="http://docs.jquery.com/action/render/UI/API/${release.version}/" />

@@ -269,10 +292,6 @@
<get src="http://docs.jquery.com/action/render/UI/Effects/Transfer" dest="${docs.dir}effect-transfer.html" />
</target>

<target name="docs-clean">
<delete dir="${docs.dir}" />
</target>

<target name="themes-download">
<!-- to create/update query strings for the theme-file, execute this in Firebug on /download page:
$("select option[value!=none]").map(function() { $(this).parent().val(this.value).change(); return $(this).parents("form").serialize(); }).get().join(",");
Binary file not shown.

0 comments on commit af582b9

Please sign in to comment.
You can’t perform that action at this time.