-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
168 lines (149 loc) · 6.25 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
<?xml version="1.0"?>
<project name="Java Simon Library" default="dist" basedir=".">
<property file="build.properties"/>
<property name="javac.debug" value="true"/>
<property name="javac.deprecation" value="false"/>
<property name="lib.dir" value="lib"/>
<property name="testng.jar" value="testng-5.11-jdk15.jar"/>
<!-- used for testng or examples -->
<path id="classpath">
<pathelement path="${lib.dir}/${testng.jar}"/>
<pathelement path="${lib.dir}/h2-1.2.135.jar"/>
<pathelement path="${lib.dir}/spring-core-3.0.5.RELEASE.jar"/>
<pathelement path="${lib.dir}/spring-aop-3.0.5.RELEASE.jar"/>
<pathelement path="${lib.dir}/aspectjrt-1.5.3.jar"/>
<pathelement path="${lib.dir}/aopalliance.jar"/>
<pathelement path="${lib.dir}/commons-logging-1.1.1.jar"/>
<pathelement path="${lib.dir}/stax-api-1.0.1.jar"/>
<pathelement path="${lib.dir}/mvel2-2.0.19.jar"/>
<pathelement path="${lib.dir}/jboss-javaee.jar"/>
<pathelement path="${lib.dir}/servlet-api.jar"/>
<pathelement path="build/core"/>
<pathelement path="build/jdbc4"/>
<pathelement path="build/spring"/>
<pathelement path="build/test"/>
</path>
<target name="dist" depends="clean,build,examples,test,docs,zip" description="Distribution - clean/build/zip"/>
<target name="compile" description="Compile the source code">
<compile-module module="core"/>
<compile-module module="jdbc4"/>
<compile-module module="javaee"/>
<compile-module module="spring"/>
</target>
<macrodef name="compile-module">
<attribute name="module"/>
<sequential>
<mkdir dir="build/@{module}"/>
<javac srcdir="@{module}/src/main/java" destdir="build/@{module}" debug="${javac.debug}"
deprecation="${javac.deprecation}" classpathref="classpath"/>
<copy todir="build/@{module}">
<fileset dir="@{module}/src/main/java" includes="**/*.properties"/>
<fileset dir="@{module}/src/main/java" includes="**/*.xml"/>
<fileset erroronmissingdir="false" dir="@{module}/src/main/resources"/>
</copy>
</sequential>
</macrodef>
<!-- Packaging section -->
<target name="build" depends="compile" description="Package the archives">
<jar-module module="core"/>
<jar-module module="jdbc4"/>
<jar-module module="javaee"/>
<jar-module module="spring"/>
</target>
<macrodef name="jar-module">
<attribute name="module"/>
<sequential>
<jar jarfile="build/javasimon-@{module}-${version}.jar" description="Java Simon @{module} ${version}">
<fileset dir="build/@{module}"/>
</jar>
</sequential>
</macrodef>
<target name="examples" depends="compile" description="Compiles the examples">
<mkdir dir="build/examples"/>
<javac srcdir="examples/src/main/java" destdir="build/examples" debug="${javac.debug}"
deprecation="${javac.deprecation}" fork="true" classpathref="classpath" excludes="other/**"/>
</target>
<target name="clean-examples" depends="compile" description="Compiles the examples">
<delete failonerror="false" dir="build/examples"/>
</target>
<target name="zip" description="Creates distribution ZIP file">
<zip file="javasimon-${version}.zip">
<zipfileset prefix="javasimon-${version}" dir="build">
<include name="docs/**"/>
<exclude name="docs/api"/>
</zipfileset>
<zipfileset prefix="javasimon-${version}/lib" dir="${lib.dir}">
<include name="${testng.jar}"/>
<include name="h2-1.2.135.jar"/>
<include name="spring-core-3.0.5.RELEASE.jar"/>
<include name="spring-aop-3.0.5.RELEASE.jar"/>
<include name="aopalliance.jar"/>
<include name="commons-logging-1.1.1.jar"/>
<include name="stax-api-1.0.1.jar"/>
<include name="sjsxp.jar"/>
<include name="mvel2-2.0.19.jar"/>
<include name="jboss-javaee.jar"/>
<include name="servlet-api.jar"/>
<include name="aspectjrt-1.5.3.jar"/>
</zipfileset>
<zipfileset prefix="javasimon-${version}/lib" dir="build">
<include name="*.jar"/>
</zipfileset>
<zipfileset prefix="javasimon-${version}" dir=".">
<include name="core/**"/>
<include name="jdbc4/**"/>
<include name="javaee/**"/>
<include name="spring/**"/>
<include name="examples/**"/>
<include name="build.xml"/>
<include name="pom.xml"/>
<include name="overview.html"/>
<include name="build.properties"/>
<include name="readme.txt"/>
<include name="lgpl.txt"/>
</zipfileset>
</zip>
</target>
<target name="clean" description="Cleans up the build directory">
<delete failonerror="false" dir="${basedir}" includes="javasimon-*.zip"/>
<delete failonerror="false" dir="build"/>
<delete failonerror="false" dir="test-output"/>
</target>
<taskdef resource="testngtasks" classpath="${lib.dir}/${testng.jar}"/>
<target name="test" depends="compile" description="Runs tests">
<mkdir dir="build/test"/>
<javac destdir="build/test" debug="${javac.debug}" deprecation="${javac.deprecation}" classpathref="classpath" fork="true">
<src path="core/src/test/java"/>
<src path="jdbc4/src/test/java"/>
</javac>
<copy todir="build/test">
<fileset dir="core/src/test/java" includes="**/*.xml"/>
<fileset dir="jdbc4/src/test/java" includes="**/*.xml"/>
</copy>
<testng outputdir="${basedir}/build/testout" haltonfailure="true" verbose="2" classpathref="classpath">
<xmlfileset dir="build/test">
<include name="testng-core.xml"/>
<include name="testng-jdbc4.xml"/>
</xmlfileset>
</testng>
</target>
<property name="doc.dir" value="build/docs/api"/>
<target name="docs" description="Create Javadoc API documentation">
<mkdir dir="${doc.dir}"/>
<javadoc destdir="${doc.dir}" protected="true" linksource="true"
doctitle="Java Simon API" windowtitle="Java Simon API"
header="<table><tr><td style='valign: middle;'><span style='font-weight: bold; margin-right: 16px;'>Java Simon ${version}</span></td><td><div class='logo'/></td></tr></table>"
overview="overview.html"
stylesheetfile="docs/api/stylesheet.css"
classpathref="classpath">
<sourcepath path="core/src/main/java"/>
<sourcepath path="jdbc4/src/main/java"/>
<sourcepath path="javaee/src/main/java"/>
<sourcepath path="spring/src/main/java"/>
<!--<sourcepath path="examples/src/main/java"/>-->
</javadoc>
<copy todir="${doc.dir}/resources" overwrite="true">
<fileset dir="docs/api/resources"/>
</copy>
</target>
</project>