Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 276 lines (248 sloc) 9.679 kB
5356f5a Made util build system a bit less weird
Martin Kleppmann authored
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2
3 <!--
4 Copyright %YEAR% Helsinki Institute for Information Technology
5
6 This file is a part of Fuego middleware. Fuego middleware is free
7 software; you can redistribute it and/or modify it under the terms
8 of the MIT license, included as the file MIT-LICENSE in the Fuego
9 middleware source distribution. If you did not receive the MIT
10 license with the distribution, write to the Fuego Core project at
11 %ADDRESS%.
12 -->
13
14 <!-- Common definitions -->
15 <!-- The file contains some reasonable default tasks;
16 to override just define a task with the same name in
17 the build.xml importing this file -->
18
19 <project name="common">
20
21 <property name="jarname" value="${ant.project.name}.jar"/>
22 <property name="src" value="src"/>
23 <property name="release.dir" value="+release"/>
24 <property name="build" value="=build"/>
25 <property name="build.class" value="${build}/classes"/>
26 <property name="build.lib" value="${build}/lib"/>
27 <property name="docs" value="docs"/>
28 <property name="doclists" value="${docs}/lists"/>
29 <property name="javadoc" value="${docs}/+api"/>
30 <property name="depend" value="+depend"/>
cf5821d Moved contents out of xmldiff directory
Martin Kleppmann authored
31 <property name="exclude" value="exclude"/>
5356f5a Made util build system a bit less weird
Martin Kleppmann authored
32 <property name="datadir" value="data"/>
33 <property name="resdir" value="res"/>
34 <property name="debug.level" value="DEBUG"/>
35
36 <property name="me.jarname" value="me-${jarname}"/>
37 <property name="me.javadoc" value="${docs}/+me-api"/>
38 <property name="me.build" value="${build}/me"/>
39 <property name="me.build.class" value="${me.build}/classes"/>
40
41
42
43 <property name="wtk.home" value="/opt/java/WTK2.2"/>
44 <property name="wtk.cldc.version" value="1.1"/>
45 <property name="wtk.midp.version" value="2.0"/>
46 <property name="wtk.cldc.lib" value="${wtk.home}/lib/cldcapi11.jar"/>
47 <property name="wtk.midp.lib" value="${wtk.home}/lib/midpapi20.jar"/>
48 <property name="wtk.bluetooth.enabled" value="true"/>
49 <property name="wtk.obfuscate" value="false"/>
50
51 <property name="fc.root" value="." />
52 <property name="fc.contrib" value="contrib/jar" />
cf5821d Moved contents out of xmldiff directory
Martin Kleppmann authored
53 <property name="contrib" value="paths" />
5356f5a Made util build system a bit less weird
Martin Kleppmann authored
54 <property name="contrib.shared.se"
55 value="${contrib}/external-se-jars"/>
56
57 <property name="contrib.shared.build"
58 value="${contrib}/external-build-jars"/>
59
60 <!-- Foundation profile -->
61 <property name="fp.jarname" value="fp-${jarname}"/>
62 <property name="fp.build.class" value="${build}/fp-classes"/>
63 <property name="fp.build.lib" value="${build}/lib"/>
64 <property name="fp.depend" value="+fp.depend"/>
65 <property name="contrib.sys.fp" value="contrib/sys/fp"/>
66 <property name="contrib.shared.fp"
67 value="${contrib}/external-fp-jars"/>
68
69 <!-- This loads a path from a file with 1 path elem/line
70 There has to be a better way...
71 -->
72 <macrodef name="loadpath">
73 <attribute name="pathid"/>
74 <attribute name="file"/>
75 <sequential>
76 <loadfile property="@{pathid}.1"
77 srcFile="@{file}"
78 failonerror="false" >
79 <filterchain>
80 <striplinecomments>
81 <comment value="#"/>
82 </striplinecomments>
83 <expandproperties/>
84 <prefixlines prefix="${path.separator}" />
85 <striplinebreaks/>
86 </filterchain>
87 </loadfile>
88 <!--- load @{pathid}.ws as a list of
89 space-separated files from which any initial ../ has been
90 stripped -->
91 <loadfile property="@{pathid}.ws"
92 srcFile="@{file}"
93 failonerror="false" >
94 <filterchain>
95 <striplinecomments>
96 <comment value="#"/>
97 </striplinecomments>
98 <expandproperties/>
99 <prefixlines prefix=" //" />
100 <tokenfilter>
101 <replacestring from="//../" to=""/>
102 </tokenfilter>
103 <striplinebreaks/>
104 </filterchain>
105 </loadfile>
106 <!-- <echo>Loaded into @{pathid}.ws</echo> -->
107 <path id="@{pathid}">
108 <pathelement path="${@{pathid}.1}" />
109 </path>
110 <!-- <echo>Loaded ${@{pathid}.1} into @{pathid}</echo> -->
111 </sequential>
112 </macrodef>
113
114
115 <target name="init">
116 <echo>======== Project ${ant.project.name} ===========</echo>
117 <mkdir dir="${build.class}" />
118 <mkdir dir="${build.lib}" />
119 <depend srcdir="${src}" destdir="${build.class}" cache="${depend}"
120 closure="true" />
121 </target>
122
123 <target name="fp-init" depends="init">
124 <loadpath pathid="classpath.contrib.fp.1"
125 file="${contrib.shared.fp}" />
126 <path id="classpath.contrib.fp">
127 <path refid="classpath.contrib.fp.1" />
128 <fileset dir="${contrib}" includes="*.jar,*.zip" />
129 </path>
130 <mkdir dir="${fp.build.class}" />
131 <mkdir dir="${fp.build.lib}" />
132 <depend srcdir="${src}" destdir="${fp.build.class}" cache="${fp.depend}"
133 closure="true" />
134 </target>
135
136 <target name="clean" depends="init">
137 <delete dir="${build}"/>
3ddd31d Delete test output in 'ant clean'
Martin Kleppmann authored
138 <delete dir="${depend}"/>
139 <delete file="+test.log"/>
140 <delete dir="+tmp-test"/>
5356f5a Made util build system a bit less weird
Martin Kleppmann authored
141 </target>
142
143 <target name="bugs" depends="compile">
cf5821d Moved contents out of xmldiff directory
Martin Kleppmann authored
144 <!--pluginlist="${fc.contrib}/plugin/coreplugin.jar" -->
5356f5a Made util build system a bit less weird
Martin Kleppmann authored
145 <property name="bugs.classpath.contrib.se"
146 refid="classpath.contrib.se" />
147 <findbugs outputFile="+bugs.xml" reportLevel="low"
148 jvmargs="-Xmx256m"
cf5821d Moved contents out of xmldiff directory
Martin Kleppmann authored
149 pluginlist="${fc.contrib}/plugin/coreplugin.jar">
5356f5a Made util build system a bit less weird
Martin Kleppmann authored
150 <!-- excludeFilter="${datadir}/fb-exclude.xml"> -->
151 <class location="${build.class}"/>
152 <classpath refid="classpath.build" />
153 <auxClasspath refid="classpath.contrib.se" />
154 <sourcePath path="${src}"/>
155 </findbugs>
156 </target>
157
158 <target name="test-da" depends="compile">
159 <property name="tests.assertflag" value="-da" />
160 <antcall target="test" />
161 </target>
162
163 <target name="test" depends="compile">
164 <fail unless="test.class"
165 message="You need to set test.class before calling"/>
166 <property name="tests.assertflag" value="-ea" />
167 <echo>Note: If you see this, tests are being run.
168 If the build fails at this point, it means that some test failed.
169 See output in +test.log. Assert flag is ${tests.assertflag}</echo>
170 <java classname="junit.textui.TestRunner" output="+test.log"
171 fork="true" failonerror="true" >
172 <jvmarg value="${tests.assertflag}"/>
173 <jvmarg value="-Dfc.log.level=${debug.level}"/>
174 <jvmarg value="-Dfc.log.logger=fc.util.log.SysoutLogger"/>
175 <arg value="${test.class}"/>
176 <syspropertyset>
177 <propertyref prefix="fc" />
178 </syspropertyset>
179 <classpath>
180 <pathelement location="${build.class}"/>
181 <path refid="classpath.build" />
182 <path refid="classpath.contrib.se" />
183 </classpath>
184 </java>
185 </target>
186
187 <target name="compile" depends="init">
188 <!-- <property name="path.debug" refid="classpath.contrib.se" />-->
189 <echo>Using default compile target... </echo>
190 <javac srcdir="${src}" destdir="${build.class}" debug="on"
191 deprecation="on"
192 excludesfile="${exclude}">
193 <include name="**"/>
194 <classpath>
195 <path refid="classpath.contrib.se" />
196 <path refid="classpath.build" />
197 </classpath>
198 </javac>
199
200 <!--
201 XXX Should check whether ${resdir} exists instead of ignoring
202 errors
203 -->
204 <copy todir="${build.class}" failonerror="false">
205 <fileset dir="${resdir}">
206 <exclude name="**/.arch-ids/**"/>
207 </fileset>
208 </copy>
209
210 <jar jarfile="${build.lib}/${jarname}" basedir="${build.class}">
211 <include name="**"/>
212 </jar>
213 </target>
214
215 <target name="distro-standalone" depends="compile">
216 <property name="fc.dist.sa" value="+distrib"/>
217 <mkdir dir="${fc.dist.sa}" />
218 <filelist files="" id="foo" />
219 <echo>CP.ws is ${classpath.contrib.se.1.ws}</echo>
220 <copy todir="${fc.dist.sa}" failonerror="true" verbose="false"
221 flatten="true">
222 <fileset dir="${contrib}">
223 <include name="*.jar"/>
224 </fileset>
225 <!-- Use the kludgy .1.ws space-separated file list to get
226 the common contrib files. This is a really horrible hack
227 around missing ant 1.6 fileset/path conversion.
228 In Ant 1.7, this is fixed.
229 -->
cf5821d Moved contents out of xmldiff directory
Martin Kleppmann authored
230 <fileset dir="." includes="${classpath.contrib.se.1.ws}" />
5356f5a Made util build system a bit less weird
Martin Kleppmann authored
231 <fileset dir="." file="${build.lib}/${jarname}" />
232 </copy>
233 </target>
234
235 <target name="eclipse-project" depends="init" >
236 <property name="eclipse.project.name" value="${ant.project.name}"/>
237 <property name="eclipse.project.prefix" value="fc-"/>
238 <property name="eclipse.project.flags" value=""/>
239 <exec executable="../make-eclipse-proj.sh" >
240 <arg line="${eclipse.project.flags} ${eclipse.project.name}" />
241 <arg value="${eclipse.project.prefix}" />
242 <arg value="${classpath.contrib.se.1.1}" />
243 </exec>
244 </target>
245
246 <target name="release-jar" depends="compile">
247 <fail unless="fc.version">
248 You need to set the fc.version ant property</fail>
249 <echo>Java used to build is version ${java.version}</echo>
250 <mkdir dir="${release.dir}" />
251 <tstamp>
252 <format property="build.stamp" pattern="yyyy.MM.dd.hh.mm.ss"/>
253 </tstamp>
254 <property name="fc.main.class" value="" />
255 <property name="release.jar"
256 value="${release.dir}/fc-${ant.project.name}-${fc.version}.jar" />
257 <jar jarfile="${release.jar}">
258 <manifest>
259 <attribute name="Built-By" value="${user.name}"/>
260 <attribute name="Main-Class" value="${fc.main.class}"/>
261 <attribute name="Specification-Title" value="fc-${ant.project.name}"/>
262 <attribute name="Specification-Version" value="${fc-version}"/>
263 <attribute name="Implementation-Title"
264 value="Fuego Core ${ant.project.name}"/>
265 <attribute name="Implementation-Version"
266 value="${fc.version}-${build.stamp}"/>
267 </manifest>
268 <zipfileset src="${build.lib}/${jarname}" />
269 </jar>
270 <echo>Binary release JAR successfully built as ${release.jar}</echo>
271 </target>
272
273 </project>
274 <!-- arch-tag: 496ed911-f7af-40a0-9870-5ee775b65e17
275 -->
Something went wrong with that request. Please try again.