aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-10-19 17:28:11 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-10-19 17:28:11 +0200
commitaf582b97a70e955432fdf4123891b75d2f2c68c5 (patch)
treefb75d841d0eb565acc7f4918697590e55480a499 /build
parent25853beb68aaae8e7828bff609ef2a26836e721d (diff)
downloadjquery-ui-af582b97a70e955432fdf4123891b75d2f2c68c5.tar.gz
jquery-ui-af582b97a70e955432fdf4123891b75d2f2c68c5.zip
Build: Cleanup and adding CSS minimization. Fixes #5824 - Minify CSS
Diffstat (limited to 'build')
-rw-r--r--build/build.xml55
-rw-r--r--build/build/yuicompressor-2.4.2.jarbin0 -> 851219 bytes
2 files changed, 37 insertions, 18 deletions
diff --git a/build/build.xml b/build/build.xml
index 5f956b1fa..96a828a11 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -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(",");
diff --git a/build/build/yuicompressor-2.4.2.jar b/build/build/yuicompressor-2.4.2.jar
new file mode 100644
index 000000000..c29470bd0
--- /dev/null
+++ b/build/build/yuicompressor-2.4.2.jar
Binary files differ