Skip to content
Permalink
Browse files

Build: Fix for #3576, adding headers to minified and packed files; cu…

…rrent solution is rather ugly, need to refactor; also removed unnecessary files from old build scripts, while adding ant-contrib-0.6.jar
  • Loading branch information
jzaefferer committed Dec 22, 2008
1 parent 9d4bfd8 commit 9f75fb8231e9443fd7d6bbb792612381843932d5
@@ -10,8 +10,14 @@
-->

<project name="jquery-ui" default="deploy-release" basedir=".">

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="build/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>

<target name="deploy-release" depends="load.properties, concatenate, minify, pack, copy, replace-version, zip" description="Release builder">
<target name="deploy-release" depends="load.properties, concatenate, minify, pack, copy, replace-version, prepend-header, zip" description="Release builder">
</target>

<target name="load.properties">
@@ -40,11 +46,49 @@
<target name="replace-version" depends="load.properties">
<replaceregexp match="@VERSION" replace="${release.version}" flags="g" byline="true">
<fileset dir="${dist.dir}/ui/" includes="*.js"/>
<fileset dir="${dist.dir}/ui/packed/" includes="*.js"/>
<fileset dir="${dist.dir}/ui/minified/" includes="*.js"/>
</replaceregexp>
<echo message="Replaced all @VERSION to ${release.version}." />
</target>

<target name="prepend-header" depends="load.properties">
<!-- TODO: refactor this ugly mess -->
<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="${dist.dir}/ui/minified/" 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="${dist.dir}/ui/minified">
<fileset dir="${dist.dir}/ui-headered/" includes="*.js" />
</copy>
<delete dir="${dist.dir}/ui-headered/" />
<for param="file">
<path><fileset dir="${dist.dir}/ui/packed/" includes="*.js" /></path>
<sequential>
<propertyregex override="yes" property="target" input="@{file}" regexp=".+\\(.+)\.packed\.js$" replace="\1"/>
<concat destfile="${dist.dir}/ui-headered/${target}.packed.js">
<header file="${dist.dir}/headers/${target}.js" />
<fileset file="@{file}" />
</concat>
</sequential>
</for>
<copy todir="${dist.dir}/ui/packed">
<fileset dir="${dist.dir}/ui-headered/" includes="*.js" />
</copy>
<delete dir="${dist.dir}/ui-headered/" />
<delete dir="${dist.dir}/headers/" />
</target>

<target description="Zip the package" name="zip">
<zip destfile="${dist.dir}/../${release.filename}.zip">
Binary file not shown.
BIN -794 KB release/build/js.jar
Binary file not shown.

This file was deleted.

This file was deleted.

0 comments on commit 9f75fb8

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