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}"
26 <classpath refid="classpath"/>
28 <copy todir="${build}">
29 <fileset dir="${src}" excludes="**/*.java"/>
33 <target name="download_deps">
34 <mkdir dir="${libs}"/>
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}"/>
80 <mkdir dir="${docs}" />
81 <mkdir dir="${docs}/api" />
86 <target name="run" depends="build">
87 <java classname="${main.class}"
92 <classpath refid="classpath"/>
98 Always include a clean target to get rid of all the extra files
99 created by the build process, so you can save storage safely, without
100 thinking. Also: sometimes you'll want to do a completely fresh build,
101 such as when changing to a new version of the JDK.
103 <target name="clean" description="Removes previous build">
104 <delete verbose="true">
105 <fileset dir="${build}"/>
106 <fileset dir="${release}"/>
112 <!-- <target name="jar" depends="build">
113 <jar jarfile="${out.jar}">
114 <fileset dir="${build}"/>
116 <attribute name="Built-By" value="${user.name}"/>
117 <attribute name="Main-Class" value="${main.class}"/>
118 <attribute name="Class-Path" value=". ${itext} ${bcprov} ${commons-cli}"/>
126 <target name="deploy" depends="build">
127 <fatjar.build output="${out.fatjar}">
128 <fatjar.manifest mainclass="${main.class}"/>
129 <fatjar.filesource path="${build}" relpath="">
130 <fatjar.exclude relpath=".svn/"/>
132 <fatjar.jarsource file="${itext}" relpath=""/>
133 <fatjar.jarsource file="${commons-cli}" relpath=""/>
134 <fatjar.jarsource file="${bcprov}" relpath=""/>
135 <fatjar.filesource path="./images/Icon.png" relpath="images/Icon.png"/>
139 <target name="doc" depends="init" description="generate docs">
140 <javadoc packagenames="it.lilik.capturemjpeg.*"
142 defaultexcludes="yes"
143 destdir="${docs}/api"
149 windowtitle="CaptureMJPEG API">
150 <classpath refid="classpath"/>
151 <doctitle><![CDATA[<h1>CaptureMJPEG</h1>]]></doctitle>
152 <bottom><![CDATA[<i>Copyright © 2008 Alessio Caiazza, Cosimo Cecchi All Rights Reserved.</i>]]></bottom>
153 <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>