Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: perlover/requi…
Fetching contributors…

Cannot retrieve contributors at this time

executable file 99 lines (83 sloc) 3.315 kB
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="jquery-validation" default="release" basedir=".">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="build/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>
<property file="ant.properties" />
<loadfile failonerror="no" srcFile="version.txt" property="release.version">
<filterchain><striplinebreaks/></filterchain>
</loadfile>
<property name="release.filename" value="jquery-validation-${release.version}" />
<property name="dist.dir" value="dist/${release.filename}/" />
<property description="Google Closure" name="closure-jar" value="build/google-compiler-20110320.jar" />
<target name="release" depends="clean, copy, minify, replace-version, prepend-header, zip" description="Release builder">
</target>
<target name="replace-version">
<replaceregexp match="@VERSION" replace="${release.version}" flags="g" byline="true">
<fileset dir="${dist.dir}/" includes="*.js"/>
</replaceregexp>
<echo message="Replaced all @VERSION to ${release.version}." />
</target>
<target name="prepend-header">
<copy todir="${dist.dir}/headers/">
<fileset dir="${dist.dir}/" includes="*.js" excludes="*.min.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}/" includes="*.min.js" /></path>
<sequential>
<propertyregex override="yes" property="target" input="@{file}" regexp=".*[\\/](.+)\.min\.js$" replace="\1"/>
<concat destfile="${dist.dir}/headered/${target}.min.js">
<header file="${dist.dir}/headers/${target}.js" />
<fileset file="@{file}" />
</concat>
</sequential>
</for>
<copy todir="${dist.dir}" overwrite="true">
<fileset dir="${dist.dir}/headered/" includes="*.js" />
</copy>
<delete dir="${dist.dir}/headers/" />
<delete dir="${dist.dir}/headered/" />
</target>
<target description="Zip the package" name="zip">
<zip destfile="${dist.dir}/../${release.filename}.zip">
<zipfileset dir="dist/" />
</zip>
</target>
<target name="minify">
<echo message="Building minified" />
<apply executable="java" parallel="false">
<fileset dir="${dist.dir}" 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="${dist.dir}/*.min.js" />
</apply>
</target>
<target description="Copy needed folders" name="copy">
<echo message="Copying files" />
<mkdir dir="${dist.dir}" />
<copy overwrite="true" todir="${dist.dir}/">
<fileset dir="." excludes="**/.*, .*/, dist/, build/, build.xml" />
</copy>
</target>
<target name="clean">
<delete dir="${dist.dir}" />
<delete file="${dist.dir}/../${release.filename}.zip" />
</target>
<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>
</project>
Jump to Line
Something went wrong with that request. Please try again.