|
1 | | -<?xml version="1.0" encoding="ISO-8859-1"?> |
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <project name="html2canvas" basedir="." default="build"> |
3 | 3 | <property name="src.dir" location="src"/> |
4 | 4 | <property name="lib.dir" location="../lib"/> |
|
11 | 11 | <property name="JQUERY_PLUGIN_NAME" value="jquery.plugin.html2canvas.js"/> |
12 | 12 | <loadfile property="version" srcfile="version.txt" /> |
13 | 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> |
| 14 | + <path id="sourcefiles"> |
| 15 | + <filelist dir="${src.dir}"> |
| 16 | + <file name="LICENSE"/> |
| 17 | + <file name="html2canvas-pre.txt"/> |
| 18 | + <file name="Core.js"/> |
| 19 | + <file name="Generate.js"/> |
| 20 | + <file name="Parse.js"/> |
| 21 | + <file name="Preload.js"/> |
| 22 | + <file name="Queue.js"/> |
| 23 | + <file name="Renderer.js"/> |
| 24 | + <file name="Util.js"/> |
| 25 | + <file name="html2canvas-post.txt"/> |
| 26 | + </filelist> |
| 27 | + </path> |
23 | 28 |
|
24 | 29 | <path id="jquery-plugin"> |
25 | 30 | <fileset dir="${src.dir}" includes="LICENSE"/> |
26 | | - <fileset dir="${src.dir}/plugins" includes="${JQUERY_PLUGIN_NAME}"/> |
| 31 | + <fileset dir="${src.dir}/plugins" includes="${JQUERY_PLUGIN_NAME}"/> |
27 | 32 | </path> |
28 | 33 |
|
29 | | - <target name="plugins"> |
| 34 | + <target name="build-dir"> |
| 35 | + <echo>Creating directory ${build.dir}...</echo> |
| 36 | + <mkdir dir="${build.dir}"/> |
| 37 | + </target> |
| 38 | + |
| 39 | + <target name="plugins" depends="build-dir"> |
| 40 | + <echo>Creating ${JQUERY_PLUGIN_NAME}...</echo> |
30 | 41 | <concat fixlastline="yes" destfile="${build.dir}/${JQUERY_PLUGIN_NAME}"> |
31 | 42 | <path refid="jquery-plugin"/> |
32 | 43 | </concat> |
33 | 44 | <replaceregexp match="@VERSION@" replace="${version}" flags="g" byline="true" file="${build.dir}/${JQUERY_PLUGIN_NAME}" /> |
34 | 45 | </target> |
35 | 46 |
|
| 47 | + <pathconvert property="prettty-sourcefiles" pathsep="${line.separator}" refid="sourcefiles"></pathconvert> |
36 | 48 |
|
37 | | - <target name="build" depends="plugins"> |
| 49 | + <target name="build" depends="build-dir,plugins"> |
| 50 | + <echo>Concatenating files:${line.separator}${prettty-sourcefiles}${line.separator}into ${build.dir}/${JS_NAME}...</echo> |
38 | 51 | <concat fixlastline="yes" destfile="${build.dir}/${JS_NAME}"> |
39 | | - <fileset refid="sourcefiles"/> |
| 52 | + <path refid="sourcefiles"/> |
40 | 53 | </concat> |
41 | 54 | <replaceregexp match="@VERSION@" replace="${version}" flags="g" byline="true" file="${build.dir}/${JS_NAME}" /> |
42 | 55 | </target> |
43 | 56 |
|
44 | | - |
45 | 57 | <taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" |
46 | 58 | classpath="${lib.dir}/compiler.jar" onerror="report"/> |
47 | 59 |
|
48 | | - <target name="release" depends="build"> |
| 60 | + <target name="syntaxcheck" depends="build-dir,build"> |
49 | 61 | <jscomp compilationLevel="simple" warning="verbose" |
50 | 62 | debug="false" |
51 | | - output="${build.dir}/${JS_NAME_MIN}"> |
| 63 | + output="${build.dir}/${JS_NAME_MIN}.tmp"> |
52 | 64 | <externs dir="${lib.dir}"> |
53 | 65 | <file name="${jquery-externs}"/> |
54 | 66 | </externs> |
|
61 | 73 | <file name="Preload.js"/> |
62 | 74 | <file name="Queue.js"/> |
63 | 75 | <file name="Renderer.js"/> |
| 76 | + <file name="Util.js"/> |
| 77 | + </sources> |
| 78 | + </jscomp> |
| 79 | + <delete file="${build.dir}/${JS_NAME_MIN}.tmp"></delete> |
| 80 | + </target> |
| 81 | + |
| 82 | + <target name="release" depends="build-dir,build,syntaxcheck"> |
| 83 | + <jscomp compilationLevel="simple" warning="verbose" |
| 84 | + debug="false" |
| 85 | + output="${build.dir}/${JS_NAME_MIN}"> |
| 86 | + <externs dir="${lib.dir}"> |
| 87 | + <file name="${jquery-externs}"/> |
| 88 | + </externs> |
| 89 | + <sources dir="${build.dir}"> |
| 90 | + <file name="${JS_NAME}"/> |
64 | 91 | </sources> |
65 | 92 | </jscomp> |
66 | 93 | <replaceregexp match="@VERSION@" replace="${version}" flags="g" byline="true" file="${build.dir}/${JS_NAME_MIN}" /> |
67 | 94 | </target> |
68 | 95 |
|
69 | 96 | <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> |
| 97 | + <delete dir="${build.dir}"></delete> |
73 | 98 | </target> |
74 | 99 | </project> |
75 | 100 |
|
0 commit comments