Skip to content

Commit

Permalink
Build: Switching to uglify.js instead of closure compilier. Saves 4 m…
Browse files Browse the repository at this point in the history
…inutes per build, and actually produces slightly smaller files
  • Loading branch information
gnarf committed Oct 18, 2011
1 parent efe964d commit bd71f24
Show file tree
Hide file tree
Showing 9 changed files with 8,804 additions and 65 deletions.
68 changes: 4 additions & 64 deletions build/build.xml
Expand Up @@ -39,7 +39,6 @@
<property name="core.files" value="jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.effects.core.js" />
<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-20110320.jar" />
<property description="YUI Compressor" name="yuicompressor-jar" value="${build.dir}/yuicompressor-2.4.2.jar" />

<target name="deploy-release" depends="clean, docs-download, copy, minify, replace-version, prepend-header, zip" description="Release builder">
Expand All @@ -55,26 +54,6 @@
</target>

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

<copy todir="${dist.dir}/headers/">
<fileset dir="${dist.dir}/themes/base" includes="*.css" />
</copy>
Expand All @@ -95,29 +74,6 @@
<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/">
<fileset dir="${dist.dir}/ui/i18n/" includes="*.js" />
</copy>
<replaceregexp match="^(\/\*.*?\*\/\s).+" replace="\1" flags="s">
<fileset dir="${dist.dir}/headers/i18n/" includes="*.js"/>
</replaceregexp>
<for param="file">
<path><fileset dir="${min.dir}/i18n/" includes="*.js" /></path>
<sequential>
<propertyregex override="yes" property="target" input="@{file}" regexp=".*[\\/](.+)\.min\.js$" replace="\1"/>
<concat destfile="${dist.dir}/ui-headered/i18n/${target}.min.js">
<header file="${dist.dir}/headers/i18n/${target}.js" />
<fileset file="@{file}" />
</concat>
</sequential>
</for>
<copy todir="${min.dir}/i18n/">
<fileset dir="${dist.dir}/ui-headered/i18n/" includes="*.js" />
</copy>
-->

<delete dir="${dist.dir}/headers/" />
<delete dir="${dist.dir}/ui-headered/" />
</target>
Expand Down Expand Up @@ -161,27 +117,11 @@
<mkdir dir="${min.dir}/i18n/" />
<mkdir dir="${dist.dir}/themes/base/minified" />
<parallel threadsperprocessor="1">
<apply executable="java" parallel="false">
<fileset dir="${dist.dir}/ui" includes="*.js" />
<arg line="-jar" />
<arg path="${closure-jar}" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
<apply executable="build/minify-js.sh">
<fileset dir="${dist.dir}/ui" includes="**.js" />
<srcfile />
<mapper type="glob" from="*.js" to="${min.dir}/*.min.js" />
</apply>
<apply executable="java" parallel="false">
<fileset dir="${dist.dir}/ui/i18n" includes="*.js" />
<arg line="-jar" />
<arg path="${closure-jar}" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
<mapper type="glob" from="*.js" to="${min.dir}/i18n/*.min.js" />
<targetfile/>
</apply>
<apply executable="java" parallel="false">
<fileset dir="${dist.dir}/themes/base" includes="*.css" />
Expand Down
Binary file removed build/build/google-compiler-20110320.jar
Binary file not shown.

0 comments on commit bd71f24

Please sign in to comment.