2 <!-- build file for CaptureMJPEG library -->
3 <!-- Created by: Alessio Caiazza <ac@abisso.org> -->
5 <project name="CaptureMJPEG" default="build" basedir=".">
6 <import file="user_pref.xml"/>
9 <pathelement location="${commons-httpclient}"/>
10 <pathelement location="${commons-logging}"/>
11 <pathelement location="${commons-codec}"/>
15 Build all Java source files into destdir. This is common in Java
16 projects: the compile target is trivial, since it just says to build
17 everything. Fancier compiler targets are easy if you want to build
18 just one file at a time.
20 <target name="build" depends="init">
21 <javac srcdir="${src}"
23 debug="${compile.debug}">
24 <classpath refid="classpath"/>
26 <copy todir="${build}">
27 <fileset dir="${src}" excludes="**/*.java"/>
31 <target name="download_deps">
32 <mkdir dir="${libs}"/>
33 <!--<get src="http://www.bouncycastle.org/download/bcprov-jdk15-136.jar" dest="${bcprov}" verbose="on" usetimestamp="on" />
34 <get src="http://prdownloads.sourceforge.net/itext/itext-2.0.4.jar" dest="${itext}" verbose="on" usetimestamp="on" /> -->
35 <!-- commons-httpclient -->
36 <get src="http://mirror.tomato.it/apache/httpcomponents/commons-httpclient/binary/commons-httpclient-3.1.tar.gz" dest="${libs}/commons-httpclient-3.1.tar.gz" verbose="on" usetimestamp="on" />
37 <gunzip src="${libs}/commons-httpclient-3.1.tar.gz" />
38 <untar src="${libs}/commons-httpclient-3.1.tar" dest="${libs}">
40 <include name="commons-httpclient-3.1/commons-httpclient-3.1.jar"/>
43 <move file="${libs}/commons-httpclient-3.1/commons-httpclient-3.1.jar" todir="${libs}" />
44 <delete file="${libs}/commons-httpclient-3.1.tar.gz" />
45 <delete file="${libs}/commons-httpclient-3.1.tar" />
46 <delete dir="${libs}/commons-httpclient-3.1" />
47 <!-- commons-logging -->
48 <get src="http://archive.apache.org/dist/commons/logging/binaries/commons-logging-1.0.4.tar.gz" dest="${libs}/commons-logging-1.0.4.tar.gz" verbose="on" usetimestamp="on" />
49 <gunzip src="${libs}/commons-logging-1.0.4.tar.gz" />
50 <untar src="${libs}/commons-logging-1.0.4.tar" dest="${libs}">
52 <include name="commons-logging-1.0.4/commons-logging.jar"/>
55 <move file="${libs}/commons-logging-1.0.4/commons-logging.jar" todir="${libs}" />
56 <delete file="${libs}/commons-logging-1.0.4.tar.gz" />
57 <delete file="${libs}/commons-logging-1.0.4.tar" />
58 <delete dir="${libs}/commons-logging-1.0.4" />
59 <!-- commons-codec -->
60 <get src="http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.2.tar.gz" dest="${libs}/commons-codec-1.2.tar.gz" verbose="on" usetimestamp="on" />
61 <gunzip src="${libs}/commons-codec-1.2.tar.gz" />
62 <untar src="${libs}/commons-codec-1.2.tar" dest="${libs}">
64 <include name="commons-codec-1.2/commons-codec-1.2.jar"/>
67 <move file="${libs}/commons-codec-1.2/commons-codec-1.2.jar" todir="${libs}" />
68 <delete file="${libs}/commons-codec-1.2.tar.gz" />
69 <delete file="${libs}/commons-codec-1.2.tar" />
70 <delete dir="${libs}/commons-codec-1.2" />
73 init is a target that sets things up for the build. Since we use the
74 built-in ant function mkdir, it will only make the directory if it
75 does not already exist.
78 <mkdir dir="${release}"/>
79 <mkdir dir="${build}"/>
84 <target name="run" depends="build">
85 <java classname="${main.class}"
90 <classpath refid="classpath"/>
96 Always include a clean target to get rid of all the extra files
97 created by the build process, so you can save storage safely, without
98 thinking. Also: sometimes you'll want to do a completely fresh build,
99 such as when changing to a new version of the JDK.
101 <target name="clean" description="Removes previous build">
102 <delete verbose="true">
103 <fileset dir="${build}"/>
104 <fileset dir="${release}"/>
110 <!-- <target name="jar" depends="build">
111 <jar jarfile="${out.jar}">
112 <fileset dir="${build}"/>
114 <attribute name="Built-By" value="${user.name}"/>
115 <attribute name="Main-Class" value="${main.class}"/>
116 <attribute name="Class-Path" value=". ${itext} ${bcprov} ${commons-cli}"/>
124 <target name="deploy" depends="build">
125 <fatjar.build output="${out.fatjar}">
126 <fatjar.manifest mainclass="${main.class}"/>
127 <fatjar.filesource path="${build}" relpath="">
128 <fatjar.exclude relpath=".svn/"/>
130 <fatjar.jarsource file="${itext}" relpath=""/>
131 <fatjar.jarsource file="${commons-cli}" relpath=""/>
132 <fatjar.jarsource file="${bcprov}" relpath=""/>
133 <fatjar.filesource path="./images/Icon.png" relpath="images/Icon.png"/>