[17387] | 1 | <project name="test-7z-task" default="all">
|
---|
| 2 |
|
---|
| 3 | <path id="compile.classpath">
|
---|
| 4 | <pathelement path="."/>
|
---|
| 5 | </path>
|
---|
| 6 | <path id="test.classpath">
|
---|
| 7 | <pathelement path="build"/>
|
---|
| 8 | <pathelement path="lib/7z.jar"/>
|
---|
| 9 | </path>
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | <target name="compile">
|
---|
| 13 | <mkdir dir="build"/>
|
---|
| 14 | <javac srcdir="src\SevenZip\Compression\LZ" destdir="build" classpathref="compile.classpath" debug="on"/>
|
---|
| 15 | <javac srcdir="src\SevenZip\Compression\RangeCoder" destdir="build" classpathref="compile.classpath" debug="on"/>
|
---|
| 16 | <javac srcdir="src\SevenZip" destdir="build" classpathref="compile.classpath" debug="on" includes="ICodeProgress.java"/>
|
---|
| 17 | <javac srcdir="src\SevenZip\Compression\LZMA" destdir="build" classpathref="compile.classpath" debug="on"/>
|
---|
| 18 | <javac srcdir="src\SevenZip" destdir="build" classpathref="compile.classpath" debug="on"/>
|
---|
| 19 | <javac srcdir="src\org\apache\tools\ant" destdir="build" classpathref="compile.classpath" debug="on"/>
|
---|
| 20 | <javac srcdir="src\LZMA" destdir="build" classpathref="compile.classpath" debug="on"/>
|
---|
| 21 | <javac srcdir="src" destdir="build" classpathref="compile.classpath" debug="on" includes="UnLzma.java"/>
|
---|
| 22 | </target>
|
---|
| 23 |
|
---|
| 24 | <target name="jar">
|
---|
| 25 | <mkdir dir="lib"/>
|
---|
| 26 | <jar destfile="lib/7z.jar" basedir="build"/>
|
---|
| 27 | </target>
|
---|
| 28 |
|
---|
| 29 | <target name="all">
|
---|
| 30 | <antcall target="compile"/>
|
---|
| 31 | <antcall target="jar"/>
|
---|
| 32 | </target>
|
---|
| 33 |
|
---|
| 34 | <target name="test">
|
---|
| 35 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpath="build"/>
|
---|
| 36 | <echo>------------------------------------------------------------------------------------------------</echo>
|
---|
| 37 | <echo>NOTE: To run the test requires some extra memory to be allocated to the Java Virtual Machine.</echo>
|
---|
| 38 | <echo>This can be done by setting the environment variable 'ANT_OPTS' to '-Xmx256M' before running ant</echo>
|
---|
| 39 | <echo>Otherwise you might find the test fails with 'java.lang.OutOfMemoryError: Java heap space'</echo>
|
---|
| 40 | <echo>------------------------------------------------------------------------------------------------</echo>
|
---|
| 41 | <echo/>
|
---|
| 42 | <mkdir dir="test"/>
|
---|
| 43 | <echo>Compressing resources/test.zip to test/test.lzma</echo>
|
---|
| 44 | <sevenzip task="encode" input="resources/test.zip" output="test/test.lzma"/>
|
---|
| 45 | <echo>Uncompressing test/test.lzma to test/test.zip</echo>
|
---|
| 46 | <sevenzip task="decode" input="test/test.lzma" output="test/test.zip"/>
|
---|
| 47 | </target>
|
---|
| 48 |
|
---|
| 49 | <target name="test-clean">
|
---|
| 50 | <delete dir="test"/>
|
---|
| 51 | </target>
|
---|
| 52 |
|
---|
| 53 | <target name="compile-clean">
|
---|
| 54 | <delete dir="lib"/>
|
---|
| 55 | <delete dir="build"/>
|
---|
| 56 | </target>
|
---|
| 57 |
|
---|
| 58 | <target name="clean">
|
---|
| 59 | <antcall target="compile-clean"/>
|
---|
| 60 | <antcall target="test-clean"/>
|
---|
| 61 | </target>
|
---|
| 62 | </project> |
---|