2008-06-07 20:02:49 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
jQuery UI Release!
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
Call task called 'deploy-release' to build a full release.
|
|
|
|
The release built will be stored on 'dist' dir.
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
-->
|
|
|
|
|
|
|
|
<project name="jquery-ui" default="deploy-release" basedir=".">
|
2008-12-22 18:26:26 +00:00
|
|
|
|
|
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="build/ant-contrib-0.6.jar"/>
|
|
|
|
</classpath>
|
|
|
|
</taskdef>
|
2009-01-08 19:01:26 +00:00
|
|
|
|
|
|
|
<property file="ant.properties" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2009-01-16 11:19:18 +00:00
|
|
|
<loadfile failonerror="no" srcFile="../version.txt" property="release.version" />
|
2009-01-08 19:01:26 +00:00
|
|
|
<property name="release.filename" value="jquery.ui-${release.version}" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<property name="dist.dir" value="dist/${release.filename}/" />
|
|
|
|
<property name="build.dir" value="build" />
|
|
|
|
<property name="ui.dir" value="../" />
|
|
|
|
<property name="src.dir" value="${ui.dir}/ui/" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<property name="min.folder" value="${dist.dir}/ui/minified" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<property name="concatenated" value="jquery.ui.all" />
|
|
|
|
<property name="concatenated.i18n" value="jquery.ui.i18n.all" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<property name="core.files" value="ui.core.js, ui.draggable.js, ui.droppable.js, ui.resizable.js, ui.selectable.js, ui.sortable.js, effects.core.js" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<property description="YUI Compressor" name="yui-jar" value="${build.dir}/yuicompressor-2.4.2.jar" />
|
|
|
|
|
2009-01-19 14:27:26 +00:00
|
|
|
<target name="deploy-release" depends="docs-process, concatenate, minify, copy, replace-version, prepend-header, zip" description="Release builder">
|
2008-11-20 05:07:42 +00:00
|
|
|
</target>
|
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<target name="replace-version">
|
2008-11-20 13:42:56 +00:00
|
|
|
<replaceregexp match="@VERSION" replace="${release.version}" flags="g" byline="true">
|
2008-11-20 05:07:42 +00:00
|
|
|
<fileset dir="${dist.dir}/ui/" includes="*.js"/>
|
2008-12-18 19:02:36 +00:00
|
|
|
<fileset dir="${dist.dir}/ui/minified/" includes="*.js"/>
|
2008-11-20 05:07:42 +00:00
|
|
|
</replaceregexp>
|
2008-11-20 13:42:56 +00:00
|
|
|
<echo message="Replaced all @VERSION to ${release.version}." />
|
|
|
|
</target>
|
2008-12-22 18:26:26 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<target name="prepend-header">
|
2008-12-22 18:26:26 +00:00
|
|
|
<!-- 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/" />
|
|
|
|
</target>
|
2008-11-20 13:42:56 +00:00
|
|
|
|
|
|
|
<target description="Zip the package" name="zip">
|
|
|
|
<zip destfile="${dist.dir}/../${release.filename}.zip">
|
2009-01-01 01:24:55 +00:00
|
|
|
<zipfileset dir="dist/" />
|
2008-11-20 13:42:56 +00:00
|
|
|
</zip>
|
2008-06-07 20:02:49 +00:00
|
|
|
</target>
|
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<target name="concatenate">
|
2008-06-07 20:02:49 +00:00
|
|
|
<echo message="Building concatenated" />
|
|
|
|
<mkdir dir="${dist.dir}/ui/" />
|
|
|
|
<delete file="${dist.dir}/ui/${concatenated}.js" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<concat destfile="${dist.dir}/ui/${concatenated}.js">
|
|
|
|
<filelist dir="${src.dir}/" files="${core.files}" />
|
|
|
|
<fileset dir="${src.dir}/" includes="ui.*.js, effects.*.js" excludes="${core.files}" />
|
|
|
|
</concat>
|
|
|
|
<echo message="Concatenated built." />
|
2008-09-10 00:26:11 +00:00
|
|
|
|
|
|
|
<mkdir dir="${dist.dir}/ui/i18n/" />
|
|
|
|
<delete file="${dist.dir}/ui/i18n/${concatenated.i18n}.js" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-09-10 00:26:11 +00:00
|
|
|
<concat destfile="${dist.dir}/ui/i18n/${concatenated.i18n}.js" encoding="utf-8">
|
|
|
|
<fileset dir="${src.dir}/i18n/" includes="ui.*.js" />
|
|
|
|
</concat>
|
|
|
|
<echo message="Concatenated i18n built." />
|
2008-06-07 20:02:49 +00:00
|
|
|
</target>
|
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<target name="minify" depends="concatenate" description="Remove all comments and whitespace, no compression, great in combination with GZip">
|
2008-06-07 20:02:49 +00:00
|
|
|
<echo message="Building minified" />
|
|
|
|
<delete dir="${min.folder}/" />
|
|
|
|
<mkdir dir="${min.folder}" />
|
2008-11-20 05:07:42 +00:00
|
|
|
<delete dir="${min.folder}/i18n/" />
|
|
|
|
<mkdir dir="${min.folder}/i18n/" />
|
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<apply executable="java" parallel="false">
|
|
|
|
<filelist dir="${dist.dir}/ui/" files="${concatenated}.js" />
|
|
|
|
<fileset dir="${src.dir}/" includes="ui.*.js, effects.*.js" />
|
|
|
|
<arg line="-jar" />
|
|
|
|
<arg path="${yui-jar}" />
|
2008-12-18 19:02:36 +00:00
|
|
|
<arg value="--charset" />
|
|
|
|
<arg value="UTF-8" />
|
2008-06-07 20:02:49 +00:00
|
|
|
<srcfile />
|
|
|
|
<arg line="-o" />
|
|
|
|
<mapper type="glob" from="*.js" to="${min.folder}/*.min.js" />
|
|
|
|
<targetfile />
|
|
|
|
</apply>
|
|
|
|
<echo message="Minified built." />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
|
|
|
<apply executable="java" parallel="false">
|
|
|
|
<filelist dir="${dist.dir}/ui/i18n/" files="${concatenated.i18n}.js" />
|
|
|
|
<fileset dir="${src.dir}/i18n/" includes="ui.*.js" />
|
|
|
|
<arg line="-jar" />
|
|
|
|
<arg path="${yui-jar}" />
|
2008-12-18 19:02:36 +00:00
|
|
|
<arg value="--charset" />
|
|
|
|
<arg value="UTF-8" />
|
2008-06-07 20:02:49 +00:00
|
|
|
<srcfile />
|
2008-11-20 05:07:42 +00:00
|
|
|
<arg line="-o" />
|
|
|
|
<mapper type="glob" from="*.js" to="${min.folder}/i18n/*.min.js" />
|
2008-06-07 20:02:49 +00:00
|
|
|
<targetfile />
|
|
|
|
</apply>
|
2008-11-20 05:07:42 +00:00
|
|
|
<echo message="Minified i18n built." />
|
2008-06-07 20:02:49 +00:00
|
|
|
</target>
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<target description="Copy needed folders" name="copy">
|
2008-06-07 20:02:49 +00:00
|
|
|
<echo message="Copying files" />
|
|
|
|
<mkdir dir="${dist.dir}" />
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-09 08:06:59 +00:00
|
|
|
<copy overwrite="true" todir="${dist.dir}/">
|
|
|
|
<fileset dir="${ui.dir}/" includes="jquery-*.js" />
|
|
|
|
</copy>
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<copy overwrite="true" todir="${dist.dir}/ui/">
|
|
|
|
<fileset dir="${src.dir}/" includes="ui.*.js, effects.*.js" />
|
|
|
|
</copy>
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<copy overwrite="true" todir="${dist.dir}/ui/i18n/" >
|
|
|
|
<fileset dir="${src.dir}/i18n/" />
|
|
|
|
</copy>
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<copy overwrite="true" todir="${dist.dir}/">
|
|
|
|
<fileset dir="${ui.dir}/" includes="*.txt" />
|
|
|
|
</copy>
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<copy overwrite="true" todir="${dist.dir}/demos/" >
|
|
|
|
<fileset dir="${ui.dir}/demos/" />
|
|
|
|
</copy>
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<copy overwrite="true" todir="${dist.dir}/tests/" >
|
|
|
|
<fileset dir="${ui.dir}/tests/" />
|
|
|
|
</copy>
|
2008-11-20 05:07:42 +00:00
|
|
|
|
2008-06-07 20:02:49 +00:00
|
|
|
<copy overwrite="true" todir="${dist.dir}/themes/" >
|
|
|
|
<fileset dir="${ui.dir}/themes/" />
|
|
|
|
</copy>
|
|
|
|
<echo message="Files copied." />
|
|
|
|
</target>
|
2008-11-20 13:42:56 +00:00
|
|
|
|
2009-01-08 19:01:26 +00:00
|
|
|
<target name="clean">
|
2009-01-03 14:47:12 +00:00
|
|
|
<delete dir="dist" />
|
2008-06-07 20:02:49 +00:00
|
|
|
</target>
|
2009-01-08 19:01:26 +00:00
|
|
|
|
2009-01-08 21:51:13 +00:00
|
|
|
<target name="docs-download">
|
|
|
|
<property name="url" value="http://www.exfer.net/jquery/createjQueryXMLDocs.py?start=UI/" />
|
2009-01-08 21:57:49 +00:00
|
|
|
<get src="${url}Accordion" dest="docs-accordion.xml" />
|
|
|
|
<get src="${url}Datepicker" dest="docs-datepicker.xml" />
|
|
|
|
<get src="${url}Dialog" dest="docs-dialog.xml" />
|
|
|
|
<get src="${url}Draggable" dest="docs-draggable.xml" />
|
|
|
|
<get src="${url}Droppable" dest="docs-droppable.xml" />
|
|
|
|
<get src="${url}Progressbar" dest="docs-progressbar.xml" />
|
|
|
|
<get src="${url}Resizable" dest="docs-resizable.xml" />
|
|
|
|
<get src="${url}Selectable" dest="docs-selectable.xml" />
|
|
|
|
<get src="${url}Slider" dest="docs-slider.xml" />
|
|
|
|
<get src="${url}Sortable" dest="docs-sortable.xml" />
|
|
|
|
<get src="${url}Tabs" dest="docs-tabs.xml" />
|
2009-01-08 21:51:13 +00:00
|
|
|
</target>
|
|
|
|
|
2009-01-08 21:53:08 +00:00
|
|
|
<target name="docs-process" depends="docs-download">
|
2009-01-19 14:27:26 +00:00
|
|
|
<property name="docs.dir" value="${ui.dir}/demos/documentation" />
|
2009-01-08 21:51:13 +00:00
|
|
|
<delete dir="${docs.dir}" />
|
|
|
|
<mkdir dir="${docs.dir}" />
|
2009-01-08 21:57:49 +00:00
|
|
|
<xslt includes="docs-*.xml" destdir="${docs.dir}" style="build/style.xsl" />
|
2009-01-08 21:51:13 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="docs-clean">
|
2009-01-08 21:53:08 +00:00
|
|
|
<delete>
|
|
|
|
<fileset file="*.xml" excludes="build.xml" />
|
|
|
|
</delete>
|
2009-01-08 21:51:13 +00:00
|
|
|
</target>
|
|
|
|
|
2009-01-22 13:09:18 +00:00
|
|
|
<target name="whitespace">
|
|
|
|
<replaceregexp match="[\t ]+$" replace="" flags="g" byline="true">
|
|
|
|
<fileset dir="${src.dir}" includes="*.js"/>
|
|
|
|
<fileset dir="${src.dir}/i18n/" includes="*.js"/>
|
|
|
|
</replaceregexp>
|
|
|
|
<echo message="All trailing spaces removed." />
|
|
|
|
</target>
|
|
|
|
|
2009-01-08 21:51:13 +00:00
|
|
|
</project>
|