Find file
Fetching contributors…
Cannot retrieve contributors at this time
129 lines (113 sloc) 5.76 KB
<?xml version="1.0" encoding="UTF-8"?>
<project name="Plupload" default="build" basedir=".">
<!-- Properties -->
<property description="Temp directory" name="tmp_dir" value="tmp" />
<!-- Setup classpath for js-build-tools ant tasks -->
<path id="tasks.classpath">
<pathelement location="."/>
<fileset dir="tools/ant">
<include name="**/*.jar"/>
<!-- Exclude jslint since it also has the Rhino API -->
<exclude name="**/jslint4java.jar"/>
</fileset>
</path>
<!-- Task definitions - register new js-build-tools ant tasks -->
<taskdef name="preprocess" classname="com.moxiecode.ant.tasks.PreProcessTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="yuicompress" classname="com.moxiecode.ant.tasks.YuiCompressTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="moxiedoc" classname="com.moxiecode.ant.tasks.MoxieDocTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="jslint" classname="com.googlecode.jslint4java.ant.JSLintTask" classpath="tools/ant/jslint4java.jar" />
<!-- Generate JS documentation -->
<target name="moxiedoc" depends="" description="Generates HTML documentation out of js source">
<delete quiet="true">
<fileset dir="docs/api" includes="**/*"/>
</delete>
<mkdir dir="docs" />
<moxiedoc outdir="docs/api" templatedir="tools/templates" msintellisense="docs/api/plupload.vsdoc.js" title="Plupload API">
<fileset dir="src">
<exclude name="jquery.*" />
<exclude name="gears_init.js" />
<include name="javascript/**/*.js" />
</fileset>
</moxiedoc>
</target>
<target name="jslint">
<jslint options="browser,undef,forin">
<formatter type="plain" />
<formatter type="xml" destfile="jslint.xml" />
<fileset dir="src/javascript" includes="*.js" excludes="gears_init.js" />
</jslint>
</target>
<target name="build-flash">
<exec executable="mxmlc">
<arg value="-compiler.source-path=./src/flash/plupload/src" />
<arg value="-target-player=10.1.0" />
<!-- <arg value="-compiler.debug" /> -->
<arg value="-output=./bin/plupload.flash.swf" />
<arg value="./src/flash/plupload/src/com/plupload/Plupload.as" />
</exec>
</target>
<target name="build">
<!-- Concat multuple JS files together -->
<concat destfile="js/plupload.full.tmp.js">
<fileset dir="src/javascript" includes="plupload.js" />
<fileset dir="src/javascript" includes="plupload.gears.js" />
<fileset dir="src/javascript" includes="plupload.silverlight.js" />
<fileset dir="src/javascript" includes="plupload.flash.js" />
<fileset dir="src/javascript" includes="plupload.browserplus.js" />
<fileset dir="src/javascript" includes="plupload.html5.js" />
<fileset dir="src/javascript" includes="plupload.html4.js" />
</concat>
<!-- Compress Plupload full and base using the YUI Compressor -->
<yuicompress infile="js/plupload.full.tmp.js" outfile="js/plupload.full.min.js" />
<yuicompress infile="src/javascript/jquery.plupload.queue.js" outfile="js/jquery.plupload.queue.min.js" />
<yuicompress infile="src/javascript/jquery.ui.plupload.js" outfile="js/jquery.ui.plupload.min.js" />
<yuicompress infile="src/javascript/plupload.js" outfile="js/plupload.min.js" />
<yuicompress infile="src/javascript/plupload.gears.js" outfile="js/plupload.gears.min.js" />
<yuicompress infile="src/javascript/plupload.silverlight.js" outfile="js/plupload.silverlight.min.js" />
<yuicompress infile="src/javascript/plupload.flash.js" outfile="js/plupload.flash.min.js" />
<yuicompress infile="src/javascript/plupload.browserplus.js" outfile="js/plupload.browserplus.min.js" />
<yuicompress infile="src/javascript/plupload.html5.js" outfile="js/plupload.html5.min.js" />
<yuicompress infile="src/javascript/plupload.html4.js" outfile="js/plupload.html4.min.js" />
<delete file="js/plupload.full.tmp.js" quiet="true" />
<copy file="src/javascript/gears_init.js" todir="js" />
</target>
<target name="release" depends="build">
<!-- Copy the current repos and start processing it -->
<delete dir="${tmp_dir}" quiet="true" />
<copy todir="${tmp_dir}/plupload">
<fileset dir=".">
<include name="**"/>
<exclude name="**/.git/**"/>
<exclude name="**/.*"/>
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="**/tmp/**"/>
<exclude name="**/jslint.xml"/>
</fileset>
</copy>
<!-- Parse minor version, major version and release date from changelog -->
<loadfile property="changelog" srcFile="${tmp_dir}/plupload/changelog.txt" />
<propertyregex property="version" input="${changelog}" regexp="^Version ([0-9xabrc.]+)" select="\1" />
<propertyregex property="release_date" input="${changelog}" regexp="^Version [^\(]+\(([^\)]+)\)" select="\1" />
<propertyregex property="file_version" input="${version}" regexp="\." replace="_" />
<!-- Compress production package -->
<delete file="${tmp_dir}/plupload_${file_version}.zip" quiet="true" />
<zip destfile="${tmp_dir}/plupload_${file_version}.zip">
<zipfileset dir="${tmp_dir}/plupload" prefix="plupload">
<include name="*/**" />
<exclude name="tools/**" />
<exclude name="build.xml" />
<exclude name="build.bat" />
<exclude name="tests/**" />
</zipfileset>
</zip>
<!-- Compress dev package -->
<delete file="${tmp_dir}/plupload_${file_version}_dev.zip" quiet="true" />
<zip destfile="${tmp_dir}/plupload_${file_version}_dev.zip">
<zipfileset dir="${tmp_dir}/plupload" prefix="plupload">
<include name="*/**" />
</zipfileset>
</zip>
</target>
</project>