1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <project name="image-test" default="main" basedir=".">
|
---|
4 |
|
---|
5 | <target name="main" depends="testSimpleScale">
|
---|
6 | </target>
|
---|
7 |
|
---|
8 | <target name="init">
|
---|
9 | <property name="src.dir" location="${basedir}/src"/>
|
---|
10 | <property name="dest.dir" location="${basedir}/dest"/>
|
---|
11 | <mkdir dir="${dest.dir}"/>
|
---|
12 | </target>
|
---|
13 |
|
---|
14 | <target name="cleanup">
|
---|
15 | <delete dir="${dest.dir}"/>
|
---|
16 | </target>
|
---|
17 |
|
---|
18 | <!-- this should produce a single file in the dest dir -->
|
---|
19 | <target name="testSimpleScale" depends="init">
|
---|
20 | <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="no" failonerror="no">
|
---|
21 | <scale width="300" proportions="width"/>
|
---|
22 | </image>
|
---|
23 | </target>
|
---|
24 |
|
---|
25 | <!-- this should put some text in the log -->
|
---|
26 | <target name="testEchoToLog" depends="init">
|
---|
27 | <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="no" failonerror="no">
|
---|
28 | <scale width="300" proportions="width"/>
|
---|
29 | </image>
|
---|
30 | </target>
|
---|
31 |
|
---|
32 | <!-- this should produce a single file in the dest dir -->
|
---|
33 | <target name="testFailOnError" depends="init">
|
---|
34 | <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="no" failonerror="yes">
|
---|
35 | <scale width="300" proportions="width"/>
|
---|
36 | </image>
|
---|
37 | </target>
|
---|
38 |
|
---|
39 | <!-- this should produce a single file in the dest dir, overwriting any existing file -->
|
---|
40 | <target name="testOverwriteTrue" depends="init">
|
---|
41 | <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="true" failonerror="no">
|
---|
42 | <scale width="300" proportions="width"/>
|
---|
43 | </image>
|
---|
44 | </target>
|
---|
45 |
|
---|
46 | <!-- this should not overwrite the existing file -->
|
---|
47 | <target name="testOverwriteFalse" depends="init">
|
---|
48 | <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="false" failonerror="no">
|
---|
49 | <scale width="300" proportions="width"/>
|
---|
50 | </image>
|
---|
51 | </target>
|
---|
52 |
|
---|
53 | </project>
|
---|