-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
91 lines (83 loc) · 3.13 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
<?xml version="1.0" standalone="yes"?>
<!--
Copyright (c) 2021 Wisecube AI and/or its affiliates. All rights reserved.
-->
<project basedir="." default="run">
<description>
This application illustrate some of the DTD support available in
the JAXB RI's extension mode.
If you encounter "External parsing is disabled" error
please set system property enableExternalEntityProcessing=true
For example:
export ANT_OPTS="-DenableExternalEntityProcessing=true"
</description>
<property name="jaxb.home" value="./"/>
<property name="enableExternalEntityProcessing" value="true"/>
<path id="classpath">
<pathelement path="src" />
<pathelement path="classes" />
<pathelement path="schemas" />
<fileset dir="${jaxb.home}" includes="mod/*.jar" />
</path>
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath refid="classpath" />
</taskdef>
<!--compile Java source files-->
<target name="compile" description="Compile all Java source files">
<echo message="Compiling the schema..." />
<mkdir dir="gen-src" />
<xjc schema="schema/pubmed.dtd" binding="schema/pubmed.jaxb" destdir="gen-src">
<arg value="-dtd" />
<produces dir="gen-src" includes="**/*.java" />
</xjc>
<echo message="Compiling the java source files..." />
<mkdir dir="classes" />
<javac destdir="classes" debug="on">
<src path="src" />
<src path="gen-src" />
<classpath refid="classpath" />
</javac>
</target>
<target name="run" depends="compile" description="Run the sample app">
<echo message="Running the Parser..." />
<java classname="ai.wisecube.pubmed.PubmedParser" fork="true">
<classpath refid="classpath" />
<arg path="schema/pubmed.xml" />
</java>
</target>
<target name="assemble" depends="run" description="Build the Parser assembly">
<echo message="Building the Assembly..." />
<mkdir dir="dist" />
<mkdir dir="lib" />
<jar destfile="lib/main.jar">
<fileset dir="classes">
<include name="**/*"/>
</fileset>
</jar>
<jar destfile="dist/pubmed-parser.jar">
<zipgroupfileset dir="${jaxb.home}" includes="mod/*.jar" />
<zipgroupfileset dir="lib" includes="*.jar" />
<!-- other options -->
<manifest>
<attribute name="Main-Class" value="ai.wisecube.pubmed.PubmedParser" />
</manifest>
</jar>
</target>
<target name="javadoc" description="Generates javadoc" depends="compile">
<echo message="Generating javadoc..." />
<mkdir dir="docs/api" />
<javadoc sourcepath="gen-src" destdir="docs/api" windowtitle="dtd" useexternalfile="yes">
<fileset dir="." includes="gen-src/**/*.java" excludes="**/impl/**/*.java" />
<fileset dir="." includes="src/**/*.java" excludes="**/impl/**/*.java" />
<classpath refid="classpath" />
</javadoc>
</target>
<target name="clean" description="Deletes all the generated artifacts.">
<delete dir="docs/api" />
<delete dir="gen-src" />
<delete dir="schemas" />
<delete dir="classes" />
<delete dir="dist" />
<delete dir="lib" />
</target>
</project>