aboutsummaryrefslogtreecommitdiffstats
path: root/release/build.xml
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2008-12-22 18:26:26 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2008-12-22 18:26:26 +0000
commit9f75fb8231e9443fd7d6bbb792612381843932d5 (patch)
tree74635bf40c4e33a07014fa88736b1575ce1304f3 /release/build.xml
parent9d4bfd8c80ce5daa360d79dd5e557c86c83cab94 (diff)
downloadjquery-ui-9f75fb8231e9443fd7d6bbb792612381843932d5.tar.gz
jquery-ui-9f75fb8231e9443fd7d6bbb792612381843932d5.zip
Build: Fix for #3576, adding headers to minified and packed files; current solution is rather ugly, need to refactor; also removed unnecessary files from old build scripts, while adding ant-contrib-0.6.jar
Diffstat (limited to 'release/build.xml')
-rw-r--r--release/build.xml48
1 files changed, 46 insertions, 2 deletions
diff --git a/release/build.xml b/release/build.xml
index a12fe49b9..f0830fc46 100644
--- a/release/build.xml
+++ b/release/build.xml
@@ -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">