[14627] | 1 | <?xml version="1.0"?>
|
---|
| 2 |
|
---|
| 3 | <project name="zip-test" basedir="." default="test1">
|
---|
| 4 |
|
---|
| 5 | <target name="test1">
|
---|
| 6 | <zip/>
|
---|
| 7 | </target>
|
---|
| 8 |
|
---|
| 9 | <target name="test2">
|
---|
| 10 | <zip destFile="zip.tmp"/>
|
---|
| 11 | </target>
|
---|
| 12 |
|
---|
| 13 | <!-- Test when the zip file includes itself
|
---|
| 14 | when target file exists before the zip task is run -->
|
---|
| 15 | <target name="test3">
|
---|
| 16 | <touch file="test3.zip"/>
|
---|
| 17 | <zip destFile="test3.zip"
|
---|
| 18 | basedir="."/>
|
---|
| 19 | </target>
|
---|
| 20 |
|
---|
| 21 | <!-- Test when the zip file includes itself
|
---|
| 22 | when target file does not exist before the zip task is run
|
---|
| 23 | <target name="test4">
|
---|
| 24 | <zip destFile="test4.zip"
|
---|
| 25 | basedir="."/>
|
---|
| 26 | </target>
|
---|
| 27 | -->
|
---|
| 28 |
|
---|
| 29 | <target name="test5">
|
---|
| 30 | <zip zipfile="test5.zip" basedir="." >
|
---|
| 31 | <exclude name="test5.zip" />
|
---|
| 32 | </zip>
|
---|
| 33 | </target>
|
---|
| 34 |
|
---|
| 35 | <target name="test6">
|
---|
| 36 | <zip destFile="test6.zip" basedir=".">
|
---|
| 37 | <include name="*.xml" />
|
---|
| 38 | <exclude name="zip.*" />
|
---|
| 39 | </zip>
|
---|
| 40 | </target>
|
---|
| 41 |
|
---|
| 42 | <target name="test7">
|
---|
| 43 | <zip destFile="inner7.zip" basedir="." >
|
---|
| 44 | <exclude name="inner7.zip" />
|
---|
| 45 | </zip>
|
---|
| 46 | <zip destFile="test7.zip" basedir=".">
|
---|
| 47 | <exclude name="**/*.*" />
|
---|
| 48 | <zipfileset src="inner7.zip" />
|
---|
| 49 | </zip>
|
---|
| 50 | </target>
|
---|
| 51 |
|
---|
| 52 | <target name="feather">
|
---|
| 53 | <zip destFile="asf-logo.gif.zip"
|
---|
| 54 | basedir=".."
|
---|
| 55 | includes="asf-logo.gif" />
|
---|
| 56 | </target>
|
---|
| 57 |
|
---|
| 58 | <target name="uncompressed-feather">
|
---|
| 59 | <zip destFile="asf-logo.gif.zip"
|
---|
| 60 | basedir=".."
|
---|
| 61 | includes="asf-logo.gif" compress="false"/>
|
---|
| 62 | </target>
|
---|
| 63 |
|
---|
| 64 | <!-- legacy attribute support -->
|
---|
| 65 | <target name="test8">
|
---|
| 66 | <zip zipfile="test8.zip" basedir="." >
|
---|
| 67 | <exclude name="test8.zip" />
|
---|
| 68 | </zip>
|
---|
| 69 | </target>
|
---|
| 70 |
|
---|
| 71 | <target name="testZipgroupfileset">
|
---|
| 72 |
|
---|
| 73 | <zip zipfile="zipgroupfileset.zip" basedir=".">
|
---|
| 74 | <zipgroupfileset dir="zip"
|
---|
| 75 | includes="zipgroupfileset*.zip"
|
---|
| 76 | excludes="zipgroupfileset3.zip" />
|
---|
| 77 | <include name="zip/zipgroupfileset3.zip" />
|
---|
| 78 | </zip>
|
---|
| 79 | </target>
|
---|
| 80 |
|
---|
| 81 | <target name="testDuplicateFail">
|
---|
| 82 |
|
---|
| 83 | <zip zipfile="duplicateFail.zip" basedir="." duplicate="fail">
|
---|
| 84 | <zipgroupfileset dir="duplicate" includes="duplicate*.zip" />
|
---|
| 85 | </zip>
|
---|
| 86 | </target>
|
---|
| 87 |
|
---|
| 88 | <target name="testUpdateNotNecessary" depends="feather">
|
---|
| 89 | <zip destFile="asf-logo.gif.zip"
|
---|
| 90 | basedir=".."
|
---|
| 91 | includes="asf-logo.gif"
|
---|
| 92 | update="true" />
|
---|
| 93 | </target>
|
---|
| 94 |
|
---|
| 95 | <target name="testUpdateIsNecessary" depends="feather">
|
---|
| 96 | <sleep seconds="5" />
|
---|
| 97 | <touch file="../dummyfile" />
|
---|
| 98 | <zip destFile="asf-logo.gif.zip"
|
---|
| 99 | basedir=".."
|
---|
| 100 | includes="asf-logo.gif,dummyfile"
|
---|
| 101 | update="true" />
|
---|
| 102 | </target>
|
---|
| 103 |
|
---|
| 104 | <!-- Bugzilla Report 18403 -->
|
---|
| 105 | <target name="testPrefixAddsDir">
|
---|
| 106 | <zip destfile="test3.zip" filesonly="false">
|
---|
| 107 | <zipfileset dir="." prefix="test" includes="zip.xml"/>
|
---|
| 108 | </zip>
|
---|
| 109 | </target>
|
---|
| 110 |
|
---|
| 111 | <!-- Bugzilla Report 19449 -->
|
---|
| 112 | <target name="testFilesOnlyDoesntCauseRecreateSetup">
|
---|
| 113 | <mkdir dir="ziptest"/>
|
---|
| 114 | <touch file="ziptest/ziptest"/>
|
---|
| 115 | <zip destfile="test3.zip" basedir="."
|
---|
| 116 | includes="ziptest/**" filesonly="true"/>
|
---|
| 117 | </target>
|
---|
| 118 |
|
---|
| 119 | <!-- Bugzilla Report 19449 -->
|
---|
| 120 | <target name="testFilesOnlyDoesntCauseRecreate">
|
---|
| 121 | <zip destfile="test3.zip" basedir="."
|
---|
| 122 | includes="ziptest/**" filesonly="true"/>
|
---|
| 123 | </target>
|
---|
| 124 |
|
---|
| 125 | <!-- Bugzilla Report 22865 -->
|
---|
| 126 | <target name="testEmptySkip">
|
---|
| 127 | <mkdir dir="ziptest"/>
|
---|
| 128 | <zip destfile="test3.zip" basedir="ziptest" whenempty="skip"/>
|
---|
| 129 | </target>
|
---|
| 130 |
|
---|
| 131 | <!-- Bugzilla Report 30365 -->
|
---|
| 132 | <target name="zipEmptyDir">
|
---|
| 133 | <mkdir dir="empty/empty2"/>
|
---|
| 134 | <zip destfile="test3.zip" basedir="empty" update="true"/>
|
---|
| 135 | </target>
|
---|
| 136 |
|
---|
| 137 | <target name="zipEmptyCreate">
|
---|
| 138 | <mkdir dir="empty"/>
|
---|
| 139 | <zip destfile="test3.zip" basedir="empty" whenempty="create" includes="*.xyz"/>
|
---|
| 140 | </target>
|
---|
| 141 |
|
---|
| 142 | <target name="cleanup">
|
---|
| 143 | <delete file="test3.zip"/>
|
---|
| 144 | <delete file="test4.zip"/>
|
---|
| 145 | <delete file="test5.zip"/>
|
---|
| 146 | <delete file="test6.zip"/>
|
---|
| 147 | <delete file="inner7.zip"/>
|
---|
| 148 | <delete file="test7.zip"/>
|
---|
| 149 | <delete file="test8.zip"/>
|
---|
| 150 | <delete file="asf-logo.gif.zip"/>
|
---|
| 151 | <delete file="zipgroupfileset.zip"/>
|
---|
| 152 | <delete file="../dummyfile" />
|
---|
| 153 | <delete dir="ziptest"/>
|
---|
| 154 | <delete dir="empty"/>
|
---|
| 155 | </target>
|
---|
| 156 | </project>
|
---|