-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
186 lines (153 loc) · 6.16 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="gridCake" default="info" basedir=".">
<property file="build.properties"></property>
<path id="classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>
<!-- ================ IMED-ALAYER INFO ========================== -->
<target name="info">
<echo>
-------------------------------------------
gridCake ${version.number}
-------------------------------------------
prepare - Prepares environment for compilation
build - Compiles sources and generates the jar
dist - Generates distributable package
clean - Deletes previously generated files under build/ and dist/
javadoc - Generates javadoc files from sources and places it under dist/
test - Executes all unit tests, and saves the reports in build/test-reports
</echo>
</target>
<!-- ================ IMED-ALAYER PREPARE ========================== -->
<target name="prepare">
<mkdir dir="build"></mkdir>
<mkdir dir="build/src"></mkdir>
<mkdir dir="build/classes"></mkdir>
<mkdir dir="build/test-classes"></mkdir>
<mkdir dir="build/lib"></mkdir>
<mkdir dir="build/javadoc"></mkdir>
<mkdir dir="build/test"></mkdir>
<mkdir dir="dist"></mkdir>
<mkdir dir="dist/javadoc"></mkdir>
<copy todir="build/src" filtering="yes">
<fileset dir="src"/>
</copy>
<copy todir="build/test" filtering="yes">
<fileset dir="test"/>
</copy>
<copy todir="build/lib" filtering="yes">
<fileset dir="lib"/>
</copy>
</target>
<target name="clean">
<delete dir="dist" quiet="true"></delete>
<delete dir="build" quiet="true"></delete>
</target>
<target name="build" depends="prepare">
<javac srcdir="build/src" destdir="build/classes" debug="on" deprecation="on" optimize="on">
<classpath>
<path refid="classpath"></path>
<pathelement location="build/src"></pathelement>
</classpath>
</javac>
<pathconvert property="mf.class-path" pathsep=" ">
<path refid="classpath"></path>
<chainedmapper>
<flattenmapper></flattenmapper>
<globmapper from="*" to="lib/*"></globmapper>
</chainedmapper>
</pathconvert>
<echo file="build/manifest.mf">Manifest-Version: 1.0</echo>
<jar jarfile="build/gridcake-${version.number}.jar">
<manifest>
<attribute name="Class-Path" value="${mf.class-path}"></attribute>
</manifest>
<fileset dir="build/classes" includes="**/*.class"></fileset>
</jar>
</target>
<target name="javadoc" depends="build">
<javadoc destdir="build/javadoc" author="true" version="true" use="true" windowtitle="gridCake Javadoc" useexternalfile="true">
<fileset dir="build/src" defaultexcludes="yes">
<include name="**/*.java"></include>
</fileset>
<doctitle><![CDATA[<h1>gridcake-${version.number}</h1>]]></doctitle>
<bottom><![CDATA[<i>Cesar Suarez Ortega</i>]]></bottom>
<classpath>
<path refid="classpath"></path>
<pathelement location="build/src"></pathelement>
</classpath>
</javadoc>
</target>
<target name="dist" depends="javadoc">
<copy todir="dist" filtering="yes">
<fileset dir="build">
<include name="lib/**"></include>
</fileset>
</copy>
<copy todir="dist" filtering="yes">
<fileset dir="build">
<include name="gridcake-${version.number}.jar"></include>
</fileset>
</copy>
<copy todir="dist/javadoc" filtering="yes">
<fileset dir="build/javadoc"/>
</copy>
<copy todir="dist" filtering="yes">
<fileset dir=".">
<include name="README"/>
<include name="LICENSE"/>
</fileset>
</copy>
<tar destfile="dist/gridcake-${version.number}.tar.gz" basedir="dist" compression="gzip" longfile="gnu"/>
</target>
<!-- -->
<target name="test-build" depends="build">
<path id="test-classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
<fileset dir="build">
<include name="gridcake-${version.number}.jar" />
</fileset>
</path>
<javac srcdir="build/test" destdir="build/test-classes" debug="on" deprecation="on" optimize="on">
<classpath>
<path refid="test-classpath"></path>
<pathelement location="build/test"></pathelement>
</classpath>
</javac>
<pathconvert property="mf.test-class-path" pathsep=" ">
<path refid="test-classpath"></path>
<identitymapper/>
</pathconvert>
<jar jarfile="build/gridcakeTest-${version.number}.jar">
<manifest>
<attribute name="Class-Path" value="${mf.test-class-path}"></attribute>
</manifest>
<fileset dir="build/test-classes" includes="**/*.class"></fileset>
</jar>
</target>
<target name="test" depends="test-build">
<path id="test-classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
<fileset dir="build">
<include name="gridcake-${version.number}.jar" />
</fileset>
</path>
<mkdir dir="build/test-reports" />
<junit>
<classpath>
<path refid="test-classpath" />
<pathelement location="build/gridcakeTest-${version.number}.jar"/>
</classpath>
<formatter type="brief" usefile="false" />
<test name="org.glite.gridcake.cream.JDLCREAMUtilsTest" haltonfailure="off" outfile="build/test-reports/JDLCREAMUtilsTest">
<formatter type="plain"/>
</test>
</junit>
</target>
</project>