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}"/>
12 <pathelement location="${processing-core}"/>
16 Build all Java source files into destdir. This is common in Java
17 projects: the compile target is trivial, since it just says to build
18 everything. Fancier compiler targets are easy if you want to build
19 just one file at a time.
21 <target name="build" depends="init">
22 <javac srcdir="${src}"
24 debug="${compile.debug}"
27 <classpath refid="classpath"/>
29 <copy todir="${build}">
30 <fileset dir="${src}" excludes="**/*.java"/>
34 <target name="download_deps">
35 <mkdir dir="${libs}"/>
36 <!-- commons-httpclient -->
37 <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" />
38 <gunzip src="${libs}/commons-httpclient-3.1.tar.gz" />
39 <untar src="${libs}/commons-httpclient-3.1.tar" dest="${libs}">
41 <include name="commons-httpclient-3.1/commons-httpclient-3.1.jar"/>
44 <move file="${libs}/commons-httpclient-3.1/commons-httpclient-3.1.jar" todir="${libs}" />
45 <delete file="${libs}/commons-httpclient-3.1.tar.gz" />
46 <delete file="${libs}/commons-httpclient-3.1.tar" />
47 <delete dir="${libs}/commons-httpclient-3.1" />
48 <!-- commons-logging -->
49 <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" />
50 <gunzip src="${libs}/commons-logging-1.0.4.tar.gz" />
51 <untar src="${libs}/commons-logging-1.0.4.tar" dest="${libs}">
53 <include name="commons-logging-1.0.4/commons-logging.jar"/>
56 <move file="${libs}/commons-logging-1.0.4/commons-logging.jar" todir="${libs}" />
57 <delete file="${libs}/commons-logging-1.0.4.tar.gz" />
58 <delete file="${libs}/commons-logging-1.0.4.tar" />
59 <delete dir="${libs}/commons-logging-1.0.4" />
60 <!-- commons-codec -->
61 <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" />
62 <gunzip src="${libs}/commons-codec-1.2.tar.gz" />
63 <untar src="${libs}/commons-codec-1.2.tar" dest="${libs}">
65 <include name="commons-codec-1.2/commons-codec-1.2.jar"/>
68 <move file="${libs}/commons-codec-1.2/commons-codec-1.2.jar" todir="${libs}" />
69 <delete file="${libs}/commons-codec-1.2.tar.gz" />
70 <delete file="${libs}/commons-codec-1.2.tar" />
71 <delete dir="${libs}/commons-codec-1.2" />
74 init is a target that sets things up for the build. Since we use the
75 built-in ant function mkdir, it will only make the directory if it
76 does not already exist.
79 <mkdir dir="${release}"/>
80 <mkdir dir="${build}"/>
81 <mkdir dir="${docs}" />
82 <mkdir dir="${docs}/api" />
87 <target name="run" depends="build">
88 <java classname="${main.class}"
93 <classpath refid="classpath"/>
99 Always include a clean target to get rid of all the extra files
100 created by the build process, so you can save storage safely, without
101 thinking. Also: sometimes you'll want to do a completely fresh build,
102 such as when changing to a new version of the JDK.
104 <target name="clean" description="Removes previous build">
105 <delete verbose="true">
106 <fileset dir="${build}"/>
107 <fileset dir="${release}"/>
108 <fileset dir="${docs}/api"/>
114 <!-- <target name="jar" depends="build">
115 <jar jarfile="${out.jar}">
116 <fileset dir="${build}"/>
118 <attribute name="Built-By" value="${user.name}"/>
119 <attribute name="Main-Class" value="${main.class}"/>
120 <attribute name="Class-Path" value=". ${itext} ${bcprov} ${commons-cli}"/>
128 <target name="deploy" depends="build">
129 <fatjar.build output="${out.fatjar}">
130 <fatjar.manifest mainclass="${main.class}"/>
131 <fatjar.filesource path="${build}" relpath="">
132 <fatjar.exclude relpath=".svn/"/>
134 <fatjar.jarsource file="${itext}" relpath=""/>
135 <fatjar.jarsource file="${commons-cli}" relpath=""/>
136 <fatjar.jarsource file="${bcprov}" relpath=""/>
137 <fatjar.filesource path="./images/Icon.png" relpath="images/Icon.png"/>
141 <target name="doc" depends="init" description="generate docs">
142 <javadoc packagenames="it.lilik.capturemjpeg.*"
143 destdir="${docs}/api"
149 windowtitle="CaptureMJPEG API">
150 <classpath refid="classpath"/>
151 <fileset dir="${src}" defaultexcludes="yes">
152 <include name="it/lilik/capturemjpeg/**"/>
153 <!-- exclude JUnit from documentation -->
154 <exclude name="it/lilik/capturemjpeg/**/*Test.java"/>
155 <exclude name="it/lilik/capturemjpeg/*Test.java"/>
157 <doctitle><![CDATA[<h1>CaptureMJPEG</h1>]]></doctitle>
158 <bottom><![CDATA[<i>Copyright © 2008 Alessio Caiazza, Cosimo Cecchi All Rights Reserved.</i>]]></bottom>
159 <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
160 <link href="http://hc.apache.org/httpclient-3.x/apidocs/"/>
161 <link href="http://dev.processing.org/reference/core/"/>