|
| 1 | +<?xml version="1.0" encoding="ISO-8859-1"?> |
| 2 | +<project name="html2canvas" basedir="." default="build"> |
| 3 | + <property name="src.dir" location="src"/> |
| 4 | + <property name="lib.dir" location="../lib"/> |
| 5 | + <property name="build.dir" location="build"/> |
| 6 | + <property name="dist" location="dist"/> |
| 7 | + <property name="jquery-externs" value="jquery-1.4.4.externs.js"/> |
| 8 | + |
| 9 | + <property name="JS_NAME" value="html2canvas.js"/> |
| 10 | + <property name="JS_NAME_MIN" value="html2canvas.min.js"/> |
| 11 | + <property name="JQUERY_PLUGIN_NAME" value="jquery.plugin.html2canvas.js"/> |
| 12 | + <loadfile property="version" srcfile="version.txt" /> |
| 13 | + |
| 14 | + <fileset id="sourcefiles" dir="${src.dir}"> |
| 15 | + <include name="LICENSE"/> |
| 16 | + <include name="Core.js"/> |
| 17 | + <include name="Generate.js"/> |
| 18 | + <include name="Parse.js"/> |
| 19 | + <include name="Preload.js"/> |
| 20 | + <include name="Queue.js"/> |
| 21 | + <include name="Renderer.js"/> |
| 22 | + </fileset> |
| 23 | + |
| 24 | + <path id="jquery-plugin"> |
| 25 | + <fileset dir="${src.dir}" includes="LICENSE"/> |
| 26 | + <fileset dir="${src.dir}/plugins" includes="${JQUERY_PLUGIN_NAME}"/> |
| 27 | + </path> |
| 28 | + |
| 29 | + <target name="plugins"> |
| 30 | + <concat fixlastline="yes" destfile="${build.dir}/${JQUERY_PLUGIN_NAME}"> |
| 31 | + <path refid="jquery-plugin"/> |
| 32 | + </concat> |
| 33 | + <replaceregexp match="@VERSION@" replace="${version}" flags="g" byline="true" file="${build.dir}/${JQUERY_PLUGIN_NAME}" /> |
| 34 | + </target> |
| 35 | + |
| 36 | + |
| 37 | + <target name="build" depends="plugins"> |
| 38 | + <concat fixlastline="yes" destfile="${build.dir}/${JS_NAME}"> |
| 39 | + <fileset refid="sourcefiles"/> |
| 40 | + </concat> |
| 41 | + <replaceregexp match="@VERSION@" replace="${version}" flags="g" byline="true" file="${build.dir}/${JS_NAME}" /> |
| 42 | + </target> |
| 43 | + |
| 44 | + |
| 45 | + <taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" |
| 46 | + classpath="${lib.dir}/compiler.jar" onerror="report"/> |
| 47 | + |
| 48 | + <target name="release" depends="build"> |
| 49 | + <jscomp compilationLevel="simple" warning="verbose" |
| 50 | + debug="false" |
| 51 | + output="${build.dir}/${JS_NAME_MIN}"> |
| 52 | + <externs dir="${lib.dir}"> |
| 53 | + <file name="${jquery-externs}"/> |
| 54 | + </externs> |
| 55 | + <sources dir="${src.dir}"> |
| 56 | + <!-- need to write them again here since the closure compiler doesn't understand filesets,... --> |
| 57 | + <file name="LICENSE"/> |
| 58 | + <file name="Core.js"/> |
| 59 | + <file name="Generate.js"/> |
| 60 | + <file name="Parse.js"/> |
| 61 | + <file name="Preload.js"/> |
| 62 | + <file name="Queue.js"/> |
| 63 | + <file name="Renderer.js"/> |
| 64 | + </sources> |
| 65 | + </jscomp> |
| 66 | + <replaceregexp match="@VERSION@" replace="${version}" flags="g" byline="true" file="${build.dir}/${JS_NAME_MIN}" /> |
| 67 | + </target> |
| 68 | + |
| 69 | + <target name="clean"> |
| 70 | + <delete file="${build.dir}/${JS_NAME}"></delete> |
| 71 | + <delete file="${build.dir}/${JS_NAME_MIN}"></delete> |
| 72 | + <delete file="${build.dir}/${JQUERY_PLUGIN_NAME}"></delete> |
| 73 | + </target> |
| 74 | +</project> |
| 75 | + |
0 commit comments