FIX:forced using of java1.4 (like processing.org) NEW:added documentation
[capturemjpeg.git] / build.xml
blob5d460c544741fc0309546e1544e0fff6eaa0bd85
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         </path>
14         <!-- 
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.
19         -->
20         <target name="build" depends="init">
21                 <javac srcdir="${src}" 
22                         destdir="${build}"
23                         debug="${compile.debug}"
24                         source="1.4"
25                         target="1.4">
26                         <classpath refid="classpath"/>
27                 </javac>
28                 <copy todir="${build}">
29                         <fileset dir="${src}" excludes="**/*.java"/>
30                 </copy>
31         </target>
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}">
39                         <patternset>
40                                 <include name="commons-httpclient-3.1/commons-httpclient-3.1.jar"/>
41                         </patternset>
42                 </untar>
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}">
51                         <patternset>
52                                 <include name="commons-logging-1.0.4/commons-logging.jar"/>
53                         </patternset>
54                 </untar>
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}">
63                         <patternset>
64                                 <include name="commons-codec-1.2/commons-codec-1.2.jar"/>
65                         </patternset>
66                 </untar>
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" />
71 </target>
72         <!--
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.
76         -->
77         <target name="init">
78                 <mkdir dir="${release}"/>
79                 <mkdir dir="${build}"/>
80                 <mkdir dir="${docs}" />
81                 <mkdir dir="${docs}/api" />
82         </target>
85         <!--
86         <target name="run" depends="build">
87                 <java classname="${main.class}" 
88                         fork="true" 
89                         dir="." 
90                         classpath="${build}" 
91                         maxmemory="500m">
92                         <classpath refid="classpath"/>
93                         <arg value="-g"/>
94                 </java>
95         </target>
96         -->
97         <!--
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.
102         -->
103         <target name="clean" description="Removes previous build">
104                 <delete verbose="true">
105                         <fileset dir="${build}"/>
106                         <fileset dir="${release}"/>
107                 </delete>
108         </target>
112 <!--    <target name="jar" depends="build">
113                 <jar jarfile="${out.jar}">
114                         <fileset dir="${build}"/>
115                         <manifest>
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}"/>
119                         </manifest>
120                 </jar>
121         </target> -->
122         
123         
124         
125 <!--
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/"/>
131           </fatjar.filesource>
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"/>
136       </fatjar.build>
137   </target>
139         <target name="doc" depends="init" description="generate docs">
140           <javadoc packagenames="it.lilik.capturemjpeg.*"
141                    sourcepath="${src}"
142                    defaultexcludes="yes"
143                    destdir="${docs}/api"
144                            access="private"
145                            source="1.4"
146                    author="true"
147                    version="true"
148                    use="true"
149                    windowtitle="CaptureMJPEG API">
150                 <classpath refid="classpath"/>
151             <doctitle><![CDATA[<h1>CaptureMJPEG</h1>]]></doctitle>
152             <bottom><![CDATA[<i>Copyright &#169; 2008 Alessio Caiazza, Cosimo Cecchi All Rights Reserved.</i>]]></bottom>
153             <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
154           </javadoc>
155         </target>
157 </project>