-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
188 lines (171 loc) · 8.44 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
186
187
188
<?xml version="1.0"?>
<!--
~ Copyright 2002-2013 Drew Noakes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
~ More information about this project is available at:
~
~ http://drewnoakes.com/code/exif/
~ http://code.google.com/p/metadata-extractor/
-->
<!--suppress XmlUnboundNsPrefix -->
<project name="metadata-extractor" default="test" basedir=".">
<description>metadata-extractor build file</description>
<property name="library-version" value="2.7.0"/>
<property name="java-version" value="1.5"/>
<property name="dist" location="Releases"/>
<property name="src" value="Source"/>
<property name="output" value="Output/Source"/>
<property name="test-src" value="Tests"/>
<property name="test-output" value="Output/Tests"/>
<property name="sample-src" value="Samples"/>
<property name="javadoc" value="../javadoc/${library-version}"/>
<property name="sample-images" value="../sample-images/"/>
<property name="sample-images-output" value="../sample-images/metadata"/>
<property name="lib" value="Libraries"/>
<property name="verbose" value="true"/>
<property name="debug" value="off"/>
<property name="lib-xmp" value="${lib}/xmpcore-5.1.2.jar"/>
<property name="lib-junit" value="${lib}/junit-4.11.jar"/>
<property name="classpath" value="${lib-junit};${lib-xmp}"/>
<target name="clean" description="deletes and recreates the destination directory">
<delete verbose="${verbose}" dir="${output}"/>
<mkdir dir="${output}"/>
<delete verbose="${verbose}" dir="${test-output}"/>
<mkdir dir="${test-output}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" description="compile the source">
<echo message="Using Java version ${ant.java.version}"/>
<javac classpath="${classpath}"
srcdir="${src}"
destdir="${output}"
source="${java-version}"
target="${java-version}"
debug="${debug}"
verbose="${verbose}"
includeantruntime="false"/>
<javac classpath="${classpath};${output}"
srcdir="${test-src}"
destdir="${test-output}"
source="${java-version}"
target="${java-version}"
debug="${debug}"
verbose="${verbose}"
includeantruntime="false"/>
</target>
<target name="test" depends="clean, compile" description="run all junit tests">
<junit printsummary="yes" logfailedtests="true" fork="yes" haltonfailure="yes" forkmode="once">
<formatter type="plain" usefile="false" />
<classpath>
<pathelement location="${output}"/>
<pathelement location="${test-output}"/>
<pathelement path="${java.class.path}"/>
<pathelement path="${lib-junit}"/>
<pathelement path="${lib-xmp}"/>
</classpath>
<batchtest>
<fileset dir="${test-src}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="process-sample-files" depends="compile" description="extract metadata from all sample images, and update output text files">
<delete verbose="${verbose}" dir="${sample-images-output}"/>
<mkdir dir="${sample-images-output}"/>
<java classname="com.drew.tools.ProcessAllImagesInFolderUtility"
classpath="${output};${lib-xmp}">
<arg value="${sample-images}"/>
<arg value="-text"/>
</java>
<java classname="com.drew.tools.ProcessAllImagesInFolderUtility"
classpath="${output};${lib-xmp}">
<arg value="${sample-images}"/>
<arg value="-wiki"/>
</java>
</target>
<target name="dist-binaries" depends="clean, compile, test" description="generate binary distribution">
<property name="bin-jar" value="${dist}/metadata-extractor-${library-version}.jar" />
<property name="bin-zip" value="${dist}/metadata-extractor-${library-version}.zip" />
<jar destfile="${bin-jar}" update="false">
<manifest>
<attribute name="Main-Class" value="com.drew.imaging.ImageMetadataReader"/>
<attribute name="Implementation-Version" value="${library-version}"/>
</manifest>
<fileset dir="${output}">
<exclude name="com/drew/tools" />
<exclude name="com/drew/tools/*.*" />
</fileset>
<file file="LICENSE-2.0.txt" />
<file file="README.txt" />
</jar>
<zip file="${bin-zip}" comment="Metadata Extractor ${library-version} - http://drewnoakes.com/code/exif/">
<file file="${bin-jar}" />
<file file="${lib-xmp}" />
<file file="LICENSE-2.0.txt" />
<file file="README.txt" />
</zip>
<delete file="${bin-jar}" />
</target>
<target name="dist-source" depends="clean, compile, test" description="generate source distribution">
<jar destfile="${dist}/metadata-extractor-${library-version}-src.jar" update="false">
<fileset dir="${src}">
<include name="**/*.*" />
<exclude name="com/drew/tools" />
<exclude name="com/drew/tools/*.*" />
</fileset>
<fileset dir=".">
<include name="LICENSE-2.0.txt" />
<include name="README.txt" />
</fileset>
</jar>
</target>
<target name="javadoc" description="generate javadoc documentation">
<delete verbose="${verbose}" dir="${javadoc}" />
<javadoc
destdir="${javadoc}"
defaultexcludes="yes"
author="true"
version="true"
use="true"
access="protected"
windowtitle="metadata-extractor - Javadoc - Extracts Exif, IPTC, XMP, ICC and other metadata from image files"
failonerror="true">
<arg value="-notimestamp" />
<!-- be sure to only use single quotes in the CDATA sections below -->
<!-- TODO include <link rel='shortcut icon' href='http://metadata-extractor.googlecode.com/git/Resources/metadata-extractor.ico' /> -->
<header><![CDATA[<a href='http://www.drewnoakes.com/code/exif/' title='Go to the project home page.'><img src='http://metadata-extractor.googlecode.com/git/Resources/metadata-extractor-logo-131x30.png' border="0" alt='Metadata Extractor Logo'></a>]]></header>
<bottom><![CDATA[<i>Copyright © 2002-2013 Drew Noakes. All Rights Reserved.</i>
<script src='http://www.google-analytics.com/urchin.js' type='text/javascript'></script>
<script type='text/javascript'>
_uacct = 'UA-936661-1';
urchinTracker();
</script>]]></bottom>
<!-- Only build Java -->
<packageset dir="${src}" defaultexcludes="yes">
<include name="com/**"/>
<exclude name="com/drew/tools/**"/>
</packageset>
<classpath>
<fileset dir=".">
<include name="${lib-xmp}"/>
</fileset>
</classpath>
</javadoc>
<copy file="Resources/javadoc-stylesheet.css" tofile="${javadoc}/stylesheet.css" overwrite="yes" />
</target>
<target name="all" depends="dist-all, javadoc, process-sample-files" description="prepare source and binary distributions, and javadoc"/>
<target name="dist-all" depends="dist-source, dist-binaries" description="prepare source and binary distributions"/>
</project>