]> source.dussan.org Git - jquery-ui.git/commitdiff
Build: Cleanup and adding CSS minimization. Fixes #5824 - Minify CSS
authorjzaefferer <joern.zaefferer@gmail.com>
Tue, 19 Oct 2010 15:28:11 +0000 (17:28 +0200)
committerjzaefferer <joern.zaefferer@gmail.com>
Tue, 19 Oct 2010 15:28:11 +0000 (17:28 +0200)
build/build.xml
build/build/yuicompressor-2.4.2.jar [new file with mode: 0644]

index 5f956b1fa3dd79f47cb70f29991dd30534242974..96a828a110968146d2412b75ca56c14d6e378fb8 100644 (file)
@@ -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">
                        <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/">
 
        <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" />
                        <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" />
                        <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>
                <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}/" />
 
                <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 (file)
index 0000000..c29470b
Binary files /dev/null and b/build/build/yuicompressor-2.4.2.jar differ