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