-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
141 lines (121 loc) · 4.71 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="orcid-api-client" default="describe" basedir=".">
<!-- ======================================================================
Builds the orcid-api-client.
Use the JAR file for just these classes, or the ZIP file which includes
the dependencies.
====================================================================== -->
<property name="src.dir" location="src" />
<property name="lib.dir" location="lib" />
<property name="schema.file" location="schema/orcid-message-1.2.xsd" />
<property name="build.dir" location=".build" />
<property name="src.generated.dir" location="${build.dir}/generated" />
<property name="compiled.dir" location="${build.dir}/classes" />
<property name="distribute.dir" location="distribute" />
<property name="product.name" value="orcid-api-client" />
<property name="release.level" value="0.3" />
<property name="distribute.jar.file"
location="${distribute.dir}/${product.name}-${release.level}.jar" />
<property name="distribute.zip.file"
location="${distribute.dir}/${product.name}-${release.level}.zip" />
<!-- =================================
target: describe
================================= -->
<target name="describe"
description="--> Describe the targets (this is the default).">
<echo>
all - Runs "clean", then "zip".
clean - Delete all artifacts so the next build will be from scratch.
jar - Compile all of the source code into a JAR file.
zip - Include the JAR file and the dependency JARs into a ZIP file.
</echo>
</target>
<!-- =================================
target: clean
================================= -->
<target name="clean" description="Delete all artifacts.">
<delete dir="${build.dir}" />
<delete dir="${distribute.dir}" />
</target>
<!-- - - - - - - - - - - - - - - - - -
target: prepare
- - - - - - - - - - - - - - - - - -->
<target name="prepare">
<mkdir dir="${build.dir}" />
<mkdir dir="${compiled.dir}" />
<mkdir dir="${src.generated.dir}" />
<mkdir dir="${distribute.dir}" />
</target>
<!-- - - - - - - - - - - - - - - - - -
target: generate-sources
- - - - - - - - - - - - - - - - - -->
<target name="generate-sources" depends="prepare">
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="${lib.dir}" includes="jaxb-xjc.jar" />
</classpath>
</taskdef>
<xjc destdir="${src.generated.dir}"
extension="true"
schema="${schema.file}"
package="edu.cornell.mannlib.orcidclient.orcidmessage"
removeOldOutput="true">
<arg line="-Xts:style:multiline" />
<classpath>
<fileset dir="${lib.dir}">
<include name="cxf-xjc-ts-2.6.2.jar" />
<include name="jaxb-xjc.jar" />
<include name="jaxb-core.jar" />
<include name="jaxb-impl.jar" />
</fileset>
</classpath>
<produces dir="${src.generated.dir}" />
</xjc>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: compile
- - - - - - - - - - - - - - - - - -->
<target name="compile" depends="generate-sources">
<path id="compile.classpath">
<fileset dir="${lib.dir}" />
</path>
<!-- deletes all files that depend on changed .java files -->
<depend srcdir="${src.dir};${src.generated.dir}"
destdir="${compiled.dir}"
closure="false"
cache="${build.dir}/compileDependencyCache">
<classpath refid="compile.classpath" />
</depend>
<javac srcdir="${src.dir};${src.generated.dir}"
destdir="${compiled.dir}"
debug="true"
encoding="UTF8"
includeantruntime="false"
optimize="true"
source="1.7">
<classpath refid="compile.classpath" />
</javac>
</target>
<!-- =================================
target: jar
================================= -->
<target name="jar"
depends="compile"
description="Compile and create the JAR file.">
<jar destfile="${distribute.jar.file}" basedir="${compiled.dir}">
</jar>
</target>
<!-- =================================
target: zip
================================= -->
<target name="zip" depends="jar" description="Create the ZIP with all dependencies">
<zip destfile="${distribute.zip.file}">
<fileset dir="${lib.dir}" excludes="servlet-api.jar"/>
<path path="${distribute.jar.file}" />
</zip>
</target>
<!-- =================================
target: all
================================= -->
<target name="all" depends="clean, zip" description="Build the ZIP file from scratch"/>
</project>