/[debian]/libpdfbox-java/trunk/build.xml
ViewVC logotype

Annotation of /libpdfbox-java/trunk/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 434 - (hide annotations)
Fri Nov 17 21:29:18 2006 UTC (14 years, 5 months ago) by gregoa
File MIME type: text/xml
File size: 19576 byte(s)
[svn-inject] Forking libpdfbox-java source to Trunk
1 gregoa 432 <project default="dist" name="PDF Box" basedir=".">
2    
3     <!-- Use the following file to alter any of the below properties -->
4     <property file="build.properties" />
5     <property environment="env"/>
6    
7     <property name="build.compiler" value="modern" />
8     <property name="src.dir" value="src" />
9     <property name="dest.dir" value="classes" />
10     <property name="bin.dir" value="bin" />
11     <property name="website.dir" value="website" />
12     <property name="website.build.dir" value="${website.dir}/build/site" />
13     <property name="docs.dir" value="${website.dir}/build/site/javadoc" />
14     <property name="lib.dir" value="lib" />
15     <property name="war.dir" value="pdfbox.war" />
16     <property name="licenses.dir" value="licenses" />
17     <property name="dist.dir" value="dist" />
18     <property name="resources.dir" value="Resources" />
19     <property name="checkstyle.config" value="pdfbox-checkstyle.xml" />
20    
21     <property name="project.name" value="PDFBox"/>
22     <property name="project.version" value="0.7.3-dev" />
23     <property name="jar.file" value="./lib/${project.name}-${project.version}.jar" />
24    
25     <property name="jar.dir" value="external" />
26    
27     <property name="ant.jar" value="${jar.dir}/ant.jar" />
28    
29     <property name="checkstyle.jar" value="${jar.dir}/checkstyle-all-*.jar" />
30    
31     <property name="fontbox.name" value="FontBox-0.1.0-dev" />
32     <property name="fontbox.jar" value="${jar.dir}/${fontbox.name}.jar" />
33    
34     <property name="lucene.name" value="lucene-core-2.0.0" />
35     <property name="lucene.jar" value="${jar.dir}/${lucene.name}.jar" />
36    
37     <property name="lucene-demos.name" value="lucene-demos-2.0.0" />
38     <property name="lucene-demos.jar" value="${jar.dir}/${lucene-demos.name}.jar" />
39    
40     <property name="bcprov.name" value="bcprov-jdk14-132" />
41     <property name="bcprov.jar" value="${jar.dir}/${bcprov.name}.jar" />
42    
43     <property name="bcmail.name" value="bcmail-jdk14-132" />
44     <property name="bcmail.jar" value="${jar.dir}/${bcmail.name}.jar" />
45    
46     <property name="junit.jar" value="${jar.dir}/junit.jar" />
47    
48     <property name="testoutput.dir" value="test/output"/>
49    
50     <property name="file" value=""/>
51    
52     <!--.NET properties -->
53     <property name="ikvm.dir" value="."/>
54     <property name="ikvmc" value="${ikvm.dir}/bin/ikvmc.exe"/>
55    
56     <path id="build.classpath">
57     <fileset dir="${jar.dir}" >
58     <include name="**/*.jar" />
59     </fileset>
60     <pathelement path="${dest.dir}" />
61     <pathelement path="." />
62     </path>
63    
64     <target name="clean" description="Remove all generated files">
65     <delete dir="${dest.dir}"/>
66     <delete dir="${docs.dir}"/>
67     <delete dir="${lib.dir}"/>
68     <delete dir="${bin.dir}"/>
69     <delete file="checkstyle.cache" />
70     <delete dir="${testoutput.dir}"/>
71     </target>
72    
73     <target name="pdfbox.init">
74     <mkdir dir="${lib.dir}"/>
75     <mkdir dir="${dest.dir}"/>
76     <mkdir dir="${docs.dir}" />
77     <mkdir dir="${dist.dir}" />
78     <mkdir dir="${bin.dir}" />
79     <mkdir dir="${testoutput.dir}" />
80     </target>
81    
82     <target name="compile" depends="pdfbox.init" description="Compile Java source files">
83     <!-- required encoding flag to be able to build using ibm-jdk on redhat ES-->
84     <javac srcdir="${src.dir}" destdir="${dest.dir}" debug="on" classpathref="build.classpath" deprecation="on" encoding="ISO-8859-1"/>
85     </target>
86    
87     <target name="test" depends="testextract,test-junit" description="Run junit tests"/>
88    
89     <target name="testextract" depends="clean,compile" description="Test text extraction">
90     <junit printsummary="off" fork="on" dir=".">
91     <sysproperty key="test.pdfbox.util.TextStripper.file" value="${file}"/>
92     <classpath>
93     <pathelement path="${ant.jar}" />
94     <pathelement path="${lucene.jar}" />
95     <pathelement path="${lucene-demo.jar}" />
96     <pathelement path="${fontbox.jar}" />
97     <pathelement path="${bcprov.jar}" />
98     <pathelement path="${bcmail.jar}" />
99     <pathelement path="${dest.dir}"/>
100     <pathelement path="." />
101     </classpath>
102     <formatter usefile="false" type="plain" />
103     <test name="test.pdfbox.util.TestTextStripper" />
104     </junit>
105     </target>
106    
107     <target name="test-junit" depends="clean,compile" description="run junit tests">
108     <junit printsummary="off" fork="on" dir=".">
109     <classpath>
110     <pathelement path="${ant.jar}" />
111     <pathelement path="${lucene.jar}" />
112     <pathelement path="${lucene-demo.jar}" />
113     <pathelement path="${fontbox.jar}" />
114     <pathelement path="${bcprov.jar}" />
115     <pathelement path="${bcmail.jar}" />
116     <pathelement path="${dest.dir}"/>
117     <pathelement path="." />
118     </classpath>
119     <formatter usefile="false" type="plain" />
120     <test name="test.pdfbox.TestAll" />
121     </junit>
122     </target>
123    
124     <target name="indexTestDocuments" depends="compile">
125     <java fork="yes" classname="org.pdfbox.searchengine.lucene.IndexFiles" classpathref="build.classpath">
126     <arg value="-create" />
127     <arg value="-index" />
128     <arg value="index" />
129     <arg value="test-pdf" />
130     </java>
131     </target>
132    
133     <target name="testPDF2Text" depends="compile">
134     <taskdef name="pdf2text" classname="org.pdfbox.ant.PDFToTextTask" classpathref="build.classpath" />
135     <pdf2text>
136     <fileset dir="test-pdf">
137     <include name="**/*.pdf" />
138     <include name="**/*.PDF" />
139     </fileset>
140     </pdf2text>
141     </target>
142    
143     <target name="checkstyle" depends="compile">
144     <!--
145     This doesn't work when run from netbeans for some reason-->
146     <taskdef name="checkstyle"
147     classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"
148     classpathref="build.classpath" />
149     <checkstyle config="${checkstyle.config}" classpathref="build.classpath" failOnViolation="false">
150     <fileset dir="${src.dir}" />
151     </checkstyle>
152     <!--<java fork="yes" failonerror="yes" classname="com.puppycrawl.tools.checkstyle.Main"
153     classpathref="build.classpath">
154     <arg value="-p" />
155     <arg value="${checkstyle.properties}" />
156     <arg value="-r" />
157     <arg value="${src.dir}" />
158     </java>-->
159     </target>
160    
161     <target name="package" depends="compile" description="Package pdfbox into a jar file">
162     <property name="release.name" value="${project.name}-${project.version}" />
163     <propertyfile file="${resources.dir}/pdfbox.version">
164     <entry key="pdfbox.version" value="${release.name}"/>
165     </propertyfile>
166    
167     <jar jarfile="./lib/${release.name}.jar">
168     <fileset dir="${dest.dir}">
169     <include name="**/*.class"/>
170     </fileset>
171     <fileset dir=".">
172     <include name="${resources.dir}/**/*" />
173     </fileset>
174     <manifest>
175     <attribute name="Built-By" value="${user.name}"/>
176     <section name="common">
177     <attribute name="Specification-Title" value="PDFBox"/>
178     <attribute name="Specification-Version" value="${project.version}"/>
179     <attribute name="Specification-Vendor" value="PDFBox.org"/>
180     </section>
181     </manifest>
182     </jar>
183     <zip zipfile="./lib/pdfbox.war">
184     <fileset dir="${war.dir}" />
185     <zipfileset dir="./lib" prefix="WEB-INF/lib">
186     <include name="${release.name}.jar" />
187     </zipfileset>
188     </zip>
189     </target>
190    
191     <target name="nightly-dist">
192     <tstamp />
193     <property name="release.name" value="${project.name}-${project.version}-${DSTAMP}" />
194     <antcall target="dist" />
195     </target>
196    
197     <target name="release-dist">
198     <delete dir="${dist.dir}"/>
199     <antcall target="dist" />
200     </target>
201    
202     <target name="dist" depends="clean,package,javadoc,website,build.NET,checkstyle" description="Create zip distribution file">
203    
204     <zip zipfile="${dist.dir}/${release.name}.zip">
205     <zipfileset dir="." prefix="${release.name}">
206     <include name="${lib.dir}/*.jar"/>
207     <include name="${licenses.dir}/**/*"/>
208     <include name="${src.dir}/**/*.java"/>
209     <include name="${src.dir}/**/*.html"/>
210     <include name="${resources.dir}/**/*" />
211     <include name="${ant.jar}" />
212     <include name="${lucene.jar}" />
213     <include name="${lucene-demos.jar}" />
214     <include name="${junit.jar}" />
215     <include name="${bcprov.jar}" />
216     <include name="${bcmail.jar}" />
217     <include name="${fontbox.jar}" />
218     <include name="${checkstyle.jar}" />
219     <include name="${bin.dir}/**/*" />
220     <include name="build.xml" />
221     <include name="build.properties.example" />
222     <include name="${checkstyle.config}" />
223     </zipfileset>
224     <zipfileset dir="${website.build.dir}" prefix="${release.name}/docs">
225     <include name="**/*" />
226     <exclude name="**/*.zip" />
227     </zipfileset>
228     <zipfileset dir="." prefix="${release.name}">
229     <include name="website/**/*" />
230     <exclude name="website/build/**/*" />
231     </zipfileset>
232     <zipfileset dir="${war.dir}" prefix="${release.name}/${war.dir}">
233     <include name="**/*" />
234     </zipfileset>
235     <zipfileset dir="${ikvm.dir}/bin" prefix="${release.name}/bin" >
236     <include name="*.dll" />
237     </zipfileset>
238     </zip>
239     </target>
240    
241     <target name="checkForIKVM">
242     <condition property="IKVMAvailable">
243     <and>
244     <os family="windows"/>
245     <available file="${ikvmc}" property="ignored" />
246     </and>
247     </condition>
248     </target>
249    
250     <target name="build.NET" depends="checkForIKVM,package" if="IKVMAvailable" description="Build PDFBox .NET DLL files">
251     <property name="release.name" value="${project.name}-${project.version}" />
252     <echo>Building BC Prov</echo>
253     <exec executable="${ikvmc}">
254     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
255     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
256     <arg value="-target:library" />
257     <arg value="-compressresources" />
258     <arg value="-out:bin\${bcprov.name}.dll" />
259     <arg value="${bcprov.jar}" />
260     </exec>
261     <echo>Building BC Mail</echo>
262     <exec executable="${ikvmc}">
263     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
264     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
265     <arg value="-reference:bin/${bcprov.name}.dll" />
266     <arg value="-target:library" />
267     <arg value="-compressresources" />
268     <arg value="-out:bin\${bcmail.name}.dll" />
269     <arg value="${bcmail.jar}" />
270     </exec>
271     <echo>Building FontBox</echo>
272     <exec executable="${ikvmc}">
273     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
274     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
275     <arg value="-target:library" />
276     <arg value="-compressresources" />
277     <arg value="-out:bin\${fontbox.name}.dll" />
278     <arg value="${fontbox.jar}" />
279     </exec>
280     <exec executable="${ikvmc}">
281     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
282     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
283     <arg value="-target:library" />
284     <arg value="-compressresources" />
285     <arg value="-out:bin\${lucene.name}.dll" />
286     <arg value="${lucene.jar}" />
287     </exec>
288     <exec executable="${ikvmc}">
289     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
290     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
291     <arg value="-reference:bin/${lucene.name}.dll" />
292     <arg value="-target:library" />
293     <arg value="-compressresources" />
294     <arg value="-out:bin\${lucene-demos.name}.dll" />
295     <arg value="${lucene-demos.jar}" />
296     </exec>
297     <echo>Building PDFBox</echo>
298     <exec executable="${ikvmc}">
299     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
300     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
301     <arg value="-reference:bin/${fontbox.name}.dll" />
302     <arg value="-reference:bin/${lucene.name}.dll" />
303     <arg value="-reference:bin/${lucene-demos.name}.dll" />
304     <arg value="-reference:bin/${bcprov.name}.dll" />
305     <arg value="-reference:bin/${bcmail.name}.dll" />
306     <arg value="-target:library" />
307     <arg value="-compressresources" />
308     <arg value="-out:bin\${release.name}.dll" />
309     <arg value="lib\${release.name}.jar" />
310     </exec>
311     <echo>Building Decrypt</echo>
312     <exec executable="${ikvmc}">
313     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
314     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
315     <arg value="-reference:bin\${release.name}.dll" />
316     <arg value="-out:bin\Decrypt.exe" />
317     <arg value="classes\org\pdfbox\Decrypt.class" />
318     </exec>
319     <exec executable="${ikvmc}">
320     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
321     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
322     <arg value="-reference:bin\${release.name}.dll" />
323     <arg value="-out:bin\Encrypt.exe" />
324     <arg value="classes\org\pdfbox\Encrypt.class" />
325     </exec>
326     <exec executable="${ikvmc}">
327     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
328     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
329     <arg value="-reference:bin\${release.name}.dll" />
330     <arg value="-out:bin\ExportFDF.exe" />
331     <arg value="classes\org\pdfbox\ExportFDF.class" />
332     </exec>
333     <exec executable="${ikvmc}">
334     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
335     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
336     <arg value="-reference:bin\${release.name}.dll" />
337     <arg value="-out:bin\ExportXFDF.exe" />
338     <arg value="classes\org\pdfbox\ExportXFDF.class" />
339     </exec>
340     <exec executable="${ikvmc}">
341     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
342     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
343     <arg value="-reference:bin\${release.name}.dll" />
344     <arg value="-out:bin\ExtractImages.exe" />
345     <arg value="classes\org\pdfbox\ExtractImages.class" />
346     </exec>
347     <exec executable="${ikvmc}">
348     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
349     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
350     <arg value="-reference:bin\${release.name}.dll" />
351     <arg value="-out:bin\ExtractText.exe" />
352     <arg value="classes\org\pdfbox\ExtractText.class" />
353     </exec>
354     <exec executable="${ikvmc}">
355     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
356     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
357     <arg value="-reference:bin\${release.name}.dll" />
358     <arg value="-out:bin\ImportFDF.exe" />
359     <arg value="classes\org\pdfbox\ImportFDF.class" />
360     </exec>
361     <exec executable="${ikvmc}">
362     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
363     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
364     <arg value="-reference:bin\${release.name}.dll" />
365     <arg value="-out:bin\ImportXFDF.exe" />
366     <arg value="classes\org\pdfbox\ImportXFDF.class" />
367     </exec>
368     <exec executable="${ikvmc}">
369     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
370     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
371     <arg value="-reference:bin\${release.name}.dll" />
372     <arg value="-out:bin\Overlay.exe" />
373     <arg value="classes\org\pdfbox\Overlay.class" />
374     </exec>
375     <exec executable="${ikvmc}">
376     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
377     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
378     <arg value="-reference:bin\${release.name}.dll" />
379     <arg value="-out:bin\PDFSplit.exe" />
380     <arg value="classes\org\pdfbox\PDFSplit.class" />
381     </exec>
382     <!--The Swing/AWT support in classpath is not quite good enough to make this
383     work, so for now we will just leave blank.-->
384     <!--<exec executable="${ikvmc}">
385     <arg value="-reference:${ikvm.dir}/bin/IKVM.GNU.Classpath.dll" />
386     <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
387     <arg value="-reference:bin\${release.name}.dll" />
388     <arg value="-out:bin\PDFDebugger.exe" />
389     <arg value="classes\org\pdfbox\PDFDebugger.class" />
390     </exec>-->
391     </target>
392    
393     <target name="javadoc" depends="compile" description="Create Javadocs">
394     <property name="release.name" value="${project.name}-${project.version}" />
395     <javadoc packagenames="org.*"
396     sourcepath="${src.dir}"
397     destdir="${docs.dir}"
398     author="true"
399     version="true"
400     use="true"
401     windowtitle="${release.name} API"
402     doctitle="${project.name}"
403     verbose="no"
404     classpathref="build.classpath"
405     encoding="ISO-8859-1"
406     breakiterator="yes">
407     <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
408     <link href="http://jakarta.apache.org/lucene/docs/api/" />
409     <!--<link href="http://jakarta.apache.org/ant/manual/api/" />-->
410     </javadoc>
411     </target>
412    
413     <!-- FORREST_HOME must be set as an environment variable -->
414     <property name="project.home" value="${basedir}/website" />
415    
416     <import file="${env.FORREST_HOME}/main/forrest.build.xml" optional="true"/>
417     <target name="website" if="env.FORREST_HOME">
418     <antcall target="site"/>
419     </target>
420    
421     </project>

  ViewVC Help
Powered by ViewVC 1.1.26