removed CaptureMJPEG#pop()
[capturemjpeg.git] / build.xml
blobbb23dacfd33a6fbf94665302b56bddad5e4215ef
1 <?xml version="1.0"?>
2 <!-- build file for CaptureMJPEG library -->
3 <!-- Created by: Alessio Caiazza &lt;ac@abisso.org&gt;  -->
5 <project name="CaptureMJPEG" default="build" basedir=".">
6         <import file="user_pref.xml"/>
8         <path id="classpath">
9                 <pathelement location="${commons-httpclient}"/>
10                 <pathelement location="${commons-logging}"/>
11                 <pathelement location="${commons-codec}"/>
12                 <pathelement location="${processing-core}"/>
13         </path>
15         <!-- 
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.
20         -->
21         <target name="build" depends="init">
22                 <javac srcdir="${src}" 
23                         destdir="${build}"
24                         debug="${compile.debug}"
25                         excludes="it/lilik/capturemjpeg/**/*Test.java,it/lilik/capturemjpeg/*Test.java" 
26                         source="1.4"
27                         target="1.4">
28                         <classpath refid="classpath"/>  
29                 </javac>
30                 <!-- <copy todir="${build}">
31                         <fileset dir="${src}" excludes="**/*.java"/>
32                 </copy> -->
33         </target>
35         <target name="download_deps">
36                 <mkdir dir="${libs}"/> 
37                 <!-- commons-httpclient -->
38                 <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" />
39                 <gunzip src="${libs}/commons-httpclient-3.1.tar.gz" />
40                 <untar src="${libs}/commons-httpclient-3.1.tar" dest="${libs}">
41                         <patternset>
42                                 <include name="commons-httpclient-3.1/commons-httpclient-3.1.jar"/>
43                         </patternset>
44                 </untar>
45                 <move file="${libs}/commons-httpclient-3.1/commons-httpclient-3.1.jar" todir="${libs}" />
46                 <delete file="${libs}/commons-httpclient-3.1.tar.gz" />
47                 <delete file="${libs}/commons-httpclient-3.1.tar" />
48                 <delete dir="${libs}/commons-httpclient-3.1" />
49                 <!-- commons-logging -->
50                 <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" />
51                 <gunzip src="${libs}/commons-logging-1.0.4.tar.gz" />
52                 <untar src="${libs}/commons-logging-1.0.4.tar" dest="${libs}">
53                         <patternset>
54                                 <include name="commons-logging-1.0.4/commons-logging.jar"/>
55                         </patternset>
56                 </untar>
57                 <move file="${libs}/commons-logging-1.0.4/commons-logging.jar" todir="${libs}" />
58                 <delete file="${libs}/commons-logging-1.0.4.tar.gz" />
59                 <delete file="${libs}/commons-logging-1.0.4.tar" />
60                 <delete dir="${libs}/commons-logging-1.0.4" />
61                 <!-- commons-codec -->
62                 <get 
63 src="http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.2.tar.gz" 
64                    dest="${libs}/commons-codec-1.2.tar.gz" 
65                    verbose="on" usetimestamp="on" />
66                 <gunzip src="${libs}/commons-codec-1.2.tar.gz" />
67                 <untar src="${libs}/commons-codec-1.2.tar" dest="${libs}">
68                         <patternset>
69                                 <include name="commons-codec-1.2/commons-codec-1.2.jar"/>
70                         </patternset>
71                 </untar>
72                 <move file="${libs}/commons-codec-1.2/commons-codec-1.2.jar" todir="${libs}" />
73                 <delete file="${libs}/commons-codec-1.2.tar.gz" />
74                 <delete file="${libs}/commons-codec-1.2.tar" />
75                 <delete dir="${libs}/commons-codec-1.2" />
76 </target>
77         <!--
78                 init is a target that sets things up for the build.      Since we use the
79                 built-in ant function mkdir, it will only make the directory if it
80                 does not already exist.
81         -->
82         <target name="init">
83                 <mkdir dir="${build}"/>
84                 <mkdir dir="${docs}" />
85                 <mkdir dir="${docs}/api" />
86         </target>
89         <!--
90         <target name="run" depends="build">
91                 <java classname="${main.class}" 
92                         fork="true" 
93                         dir="." 
94                         classpath="${build}" 
95                         maxmemory="500m">
96                         <classpath refid="classpath"/>
97                         <arg value="-g"/>
98                 </java>
99         </target>
100         -->
101         <!--
102                 Always include a clean target to get rid of all the extra files
103                 created by the build process, so you can save storage safely, without
104                 thinking.        Also: sometimes you'll want to do a completely fresh build,
105                 such as when changing to a new version of the JDK.
106         -->
107         <target name="clean" depends="clean-doc" description="Removes previous build">
108                 <delete dir="${build}"/>
109                 <delete dir="${release}"/>
110         </target>
114         <target name="jar" depends="build, deploy-init">
115                 <jar jarfile="${release}/capturemjpeg/library/capturemjpeg.jar">
116                         <fileset dir="${build}"
117                                          excludes="**/*Test.class,**/CaptureToFile.class"/>
118                         <manifest>
119                                 <attribute name="Built-By" value="${user.name}"/>
120                         </manifest>
121                 </jar>
122         </target> 
123         
124         
126   <target name="deploy-init" depends="">
127         <mkdir dir="${release}"/>
128         <mkdir dir="${release}/capturemjpeg"/>
129         <mkdir dir="${release}/capturemjpeg/library"/>
130         <mkdir dir="${release}/capturemjpeg/licenses"/>
131         <mkdir dir="${release}/capturemjpeg/documentation"/>
132   </target>
134   <target name="deploy" depends="jar, doc">
135     <!-- copy libs -->
136         <copy todir="${release}/capturemjpeg/library">
137           <fileset dir="${libs}"/>
138         </copy>
139         <!-- copy licenses -->
140         <copy todir="${release}/capturemjpeg/licenses">
141           <fileset dir="./licenses"/>
142         </copy>
143         <!-- copy documentation -->
144         <copy todir="${release}/capturemjpeg/documentation">
145           <fileset dir="${docs}/api"/>
146         </copy>
147         <!-- create zip file -->
148         <zip destfile="${release}/capturemjpeg.zip"
149                  basedir="${release}"
150                  excludes="capturemjpeg.zip"/>
151   </target>
153         <target name="doc" depends="init,clean-doc" description="generate docs">
154           <javadoc packagenames="it.lilik.capturemjpeg.*"
155                    destdir="${docs}/api"
156                            access="package"
157                            source="1.4"
158                    author="true"
159                    version="true"
160                    use="true"
161                    windowtitle="CaptureMJPEG API">
162                 <classpath refid="classpath"/>
163                 <fileset dir="${src}" defaultexcludes="yes">
164                         <include name="it/lilik/capturemjpeg/**"/>
165                         <!-- exclude JUnit from documentation -->
166                         <exclude name="it/lilik/capturemjpeg/**/*Test.java"/>
167                         <exclude name="it/lilik/capturemjpeg/*Test.java"/>  
168                 </fileset>
169             <doctitle><![CDATA[<h1>CaptureMJPEG</h1>]]></doctitle>
170             <bottom><![CDATA[<i>Copyright &#169; 2008 Alessio Caiazza, Cosimo Cecchi All Rights Reserved.</i>]]></bottom>
171             <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
172                 <link href="http://hc.apache.org/httpclient-3.x/apidocs/"/>
173                 <link href="http://dev.processing.org/reference/core/javadoc/"/>
174           </javadoc>
175         </target>
177         <target name="clean-doc">
178                 <delete dir="${docs}/api"/>
179         </target>
180 </project>