-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.xml
261 lines (216 loc) · 10.4 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<?xml version="1.0"?>
<!-- ===================================================================
Build file for 'nextreports-engine' application
Most useful targets:
- compile -> compile all java sources
- jar -> creates the application's jar file
- clean -> removes all the generated files and directories
- release -> creates the artifacts
Authors:
Decebal Suiu <[email protected]>
Copyright:
Copyright (c) 2006-2013, The NextReports team. All rights reserved.
==================================================================== -->
<project name="nextreports-engine" default="release" xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="local.properties"/>
<property file="build.properties"/>
<property name="integration.name" value="nextreports-integration-demo"/>
<property name="integration.zip.dir" location="${app.target}/${app.version}/${integration.name}"/>
<property name="integration.zip" value="${app.target}/${integration.name}-${app.version}.zip"/>
<property name="ivy.lib.dir" value="${app.lib}"/>
<import file="ivy-build.xml"/>
<!-- Classpath -->
<path id="classpath">
<fileset dir="${app.lib}" includes="*.jar"/>
<fileset dir="${ant.tasks.dir}" includes="*.jar"/>
</path>
<!-- ================================================================== -->
<!-- I V Y . I N I T -->
<!-- ================================================================== -->
<target name="ivy.init" depends="ivy.download">
<!-- Download the ivy jar and defines ivy tasks -->
<path id="ivy.lib.path">
<pathelement location="${ivy.jar.file}"/>
</path>
<!-- The ivy tasks are dependent by ivy.lib.path declared above -->
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<!-- ================================================================== -->
<!-- I V Y . R E S O L V E -->
<!-- ================================================================== -->
<!-- resolve dependent libraries -->
<target name="ivy.resolve" depends="ivy.init">
<ivy:configure file="ivysettings.xml"/>
<ivy:resolve file="ivy.xml"/>
<!--
<ivy:retrieve pattern="${ivy.lib.dir}/[artifact].[ext]" conf="runtime"/>
-->
<ivy:retrieve sync="true"/>
<mkdir dir="ivy-report"/>
<ivy:report todir="ivy-report"/>
</target>
<!-- ================================================================== -->
<!-- C O M P I L E -->
<!-- ================================================================== -->
<target name="compile" depends="ivy.resolve,version">
<!-- Create the ${app.classes} directory -->
<mkdir dir="${app.classes}"/>
<!-- Compile the java code from ${app.src} into ${app.classes} -->
<javac
source="${javac.version}"
target="${javac.version}"
srcdir="${app.src}"
destdir="${app.classes}"
debug="${javac.debug}"
verbose="${javac.verbose}"
deprecation="${javac.deprecation}"
classpathref="classpath"
/>
</target>
<!-- ================================================================== -->
<!-- J A R -->
<!-- ================================================================== -->
<target name="jar" depends="compile">
<delete file="${app.target}/${app.jar}"/>
<!-- Create jar file -->
<jar jarfile="${app.target}/${app.jar}" compress="true" >
<fileset dir="${app.classes}" includes="ro/nextreports/engine/**/*.class"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Version" value="${app.version}"/>
</manifest>
</jar>
</target>
<!-- ================================================================== -->
<!-- D E M O -->
<!-- ================================================================== -->
<target name="demo" depends="jar,javadoc">
<!-- Create temporary dir -->
<mkdir dir="${integration.zip.dir}"/>
<!-- Copy integration readme file -->
<copy file="integration-readme.txt" tofile="${integration.zip.dir}/readme.txt"/>
<!-- Copy some file in temporary dir -->
<copy todir="${integration.zip.dir}/src">
<fileset dir="${app.src}" includes="ro/nextreports/integration/**"/>
</copy>
<copy todir="${integration.zip.dir}/lib">
<fileset dir="${app.target}" includes="${app.jar}"/>
<fileset dir="${app.lib}">
<include name="commons-logging-*.jar"/>
<include name="commons-jexl-*.jar"/>
<include name="xstream-*.jar"/>
<include name="poi-*.jar"/>
<include name="itext*.jar"/>
<include name="jcalendar-*.jar"/>
<include name="winstone*.jar"/>
<include name="jofc2*.jar"/>
<include name="jfreechart*.jar"/>
<include name="jcommon*.jar"/>
<include name="derby-*.jar"/>
<include name="docx4j-*.jar"/>
<include name="jaxb-xmldsig-core-*.jar"/>
<include name="slf4j-*.jar"/>
<include name="xalan-*.jar"/>
<include name="xmlgraphics-commons-*.jar"/>
<include name="commons-io-*.jar"/>
</fileset>
</copy>
<!-- Copy files needed for chart demo -->
<unzip src="${app.src}/chart-webroot.zip" dest="${integration.zip.dir}/chart-webroot">
<patternset>
<exclude name="**/data.json"/>
</patternset>
</unzip>
<!-- Copy engine javadoc -->
<copy todir="${integration.zip.dir}/javadoc">
<fileset dir="${app.target}/javadoc"/>
</copy>
<!-- Create the zip with dist -->
<zip destfile="${integration.zip}" basedir="${app.target}/${app.version}"/>
<!-- Delete the temporary dir -->
<delete dir="${app.target}/${app.version}"/>
</target>
<!-- ================================================================== -->
<!-- V E R S I O N -->
<!-- ================================================================== -->
<target name="version">
<!-- Add ant task -->
<taskdef
name="jreleaseinfo"
classname="ch.oscg.jreleaseinfo.anttask.JReleaseInfoAntTask"
classpath="${ant.tasks.dir}/jreleaseinfo-1.3.0.jar"
/>
<property name="app.src.dir" location="${app.src}"/>
<property environment="env"/>
<!-- 'BUILD_NUMBER' variable is created by HUDSON CI SERVER before each build run -->
<property name="env.BUILD_NUMBER" value="0"/>
<property name="build.number" value="${env.BUILD_NUMBER}"/>
<!-- Create release info -->
<jreleaseinfo
classname="ReleaseInfo"
packagename="ro.nextreports.engine"
targetdir="${app.src.dir}"
project="NextReports"
version="${app.version}">
<parameter name="company" value="NextReports"/>
<parameter name="home" value="www.next-reports.com"/>
<parameter name="buildNumber" value="${build.number}" type="int"/>
<parameter name="copyright" value="${app.copyright}"/>
</jreleaseinfo>
</target>
<!-- ================================================================== -->
<!-- J A V A D O C -->
<!-- ================================================================== -->
<target name="javadoc">
<mkdir dir="${app.target}/javadoc"/>
<javadoc packagenames="ro.nextreports.engine"
sourcepath="src"
destdir="${app.target}/javadoc"
classpathref="classpath"
author="false">
<doctitle><![CDATA[<h1>NextReports Integration ${app.version}</h1>]]></doctitle>
<fileset dir="${app.src}">
<includesfile name="integration-javadoc.txt"/>
</fileset>
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${app.lib}/doclet-5.1.jar">
<param name="-verbose"/>
<param name="-attributes"/>
<param name="-operations"/>
<param name="-qualify"/>
<param name="-types"/>
<param name="-visibility"/>
</doclet>
</javadoc>
<!-- Create uml diagrams -->
<!-- YOU MUST HAVE INSTALLED GRAPHVIZ (http://www.graphviz.org/) -->
<apply executable="dot" dest="${app.target}/javadoc" parallel="false" verbose="true">
<arg value="-v"/>
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${app.target}/javadoc" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
<!-- Delete some temporary files-->
<delete>
<fileset dir="${app.target}/javadoc" includes="**/*.dot,**/*.map"/>
</delete>
</target>
<!-- ================================================================== -->
<!-- R E L E A S E -->
<!-- ================================================================== -->
<target name="release" depends="demo">
<copy todir="${app.artifacts}" file="${app.target}/${app.jar}"/>
<copy todir="${app.artifacts}" file="${integration.zip}"/>
</target>
<!-- ================================================================== -->
<!-- C L E A N -->
<!-- ================================================================== -->
<target name="clean">
<delete dir="${app.target}"/>
<delete dir="${app.dist}"/>
<delete dir="${app.artifacts}"/>
<delete dir="${ivy.lib.dir}"/>
</target>
</project>