WARNING: updated ant config files. (user_pref.xml.template)
[capturemjpeg.git] / build.xml
blob0005d7039da52294659405f8cbae60b50385c661
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                         source="1.4"
26                         target="1.4">
27                         <classpath refid="classpath"/>
28                 </javac>
29                 <copy todir="${build}">
30                         <fileset dir="${src}" excludes="**/*.java"/>
31                 </copy>
32         </target>
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}">
40                         <patternset>
41                                 <include name="commons-httpclient-3.1/commons-httpclient-3.1.jar"/>
42                         </patternset>
43                 </untar>
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}">
52                         <patternset>
53                                 <include name="commons-logging-1.0.4/commons-logging.jar"/>
54                         </patternset>
55                 </untar>
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}">
64                         <patternset>
65                                 <include name="commons-codec-1.2/commons-codec-1.2.jar"/>
66                         </patternset>
67                 </untar>
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" />
72 </target>
73         <!--
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.
77         -->
78         <target name="init">
79                 <mkdir dir="${release}"/>
80                 <mkdir dir="${build}"/>
81                 <mkdir dir="${docs}" />
82                 <mkdir dir="${docs}/api" />
83         </target>
86         <!--
87         <target name="run" depends="build">
88                 <java classname="${main.class}" 
89                         fork="true" 
90                         dir="." 
91                         classpath="${build}" 
92                         maxmemory="500m">
93                         <classpath refid="classpath"/>
94                         <arg value="-g"/>
95                 </java>
96         </target>
97         -->
98         <!--
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.
103         -->
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"/>
109                 </delete>
110         </target>
114 <!--    <target name="jar" depends="build">
115                 <jar jarfile="${out.jar}">
116                         <fileset dir="${build}"/>
117                         <manifest>
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}"/>
121                         </manifest>
122                 </jar>
123         </target> -->
124         
125         
126         
127 <!--
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/"/>
133           </fatjar.filesource>
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"/>
138       </fatjar.build>
139   </target>
141         <target name="doc" depends="init" description="generate docs">
142           <javadoc packagenames="it.lilik.capturemjpeg.*"
143                    destdir="${docs}/api"
144                            access="package"
145                            source="1.4"
146                    author="true"
147                    version="true"
148                    use="true"
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"/>  
156                 </fileset>
157             <doctitle><![CDATA[<h1>CaptureMJPEG</h1>]]></doctitle>
158             <bottom><![CDATA[<i>Copyright &#169; 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/"/>
162           </javadoc>
163         </target>
165 </project>