|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
2 <project name="org.eclipse.swt.qt.win32.x86.internal" default="build" basedir="."> |
|
3 |
|
4 <target name="help"> |
|
5 <echo level="info"> |
|
6 Usage: ant [one of the following:] |
|
7 build : Build debug + release |
|
8 build.jar : Build all jars |
|
9 build.debug : Build all debug binaries |
|
10 build.release : Build all release binaries |
|
11 build.lib : Build all native libraries |
|
12 build.lib.debug : Build debug native libraries |
|
13 build.lib.release : Build release native libraries |
|
14 build.tests : Build JUnit and MT tests |
|
15 clean : Clean everything |
|
16 clean.jar : Clean all jars |
|
17 clean.lib : Clean native libraries and object files |
|
18 clean.lib.debug : Clean debug native libraries and object files |
|
19 clean.lib.release : Clean release native libraries and object files |
|
20 export : Export everything |
|
21 export.jar : Export Java classes packed as jar |
|
22 export.debug : Export all debug binaries |
|
23 export.release : Export all release binaries |
|
24 export.lib : Export native libraries |
|
25 export.lib.debug : Export debug native libraries |
|
26 export.lib.release : Export release native libraries |
|
27 run.tests : Run JUnit and MT tests |
|
28 </echo> |
|
29 </target> |
|
30 |
|
31 <target name="init" depends="init.env, init.export.path"> |
|
32 <property file="./build.properties"></property> |
|
33 <property name="full.name" value="${fragment}_${version.suffix}"/> |
|
34 <property name="temp.dir" value="${basedir}/temp"/> |
|
35 <property name="plugin.destination" value="${basedir}"/> |
|
36 <property name="build.result.dir" value="${basedir}"/> |
|
37 <property name="download.destination" value="${basedir}"/> |
|
38 <property name="lib.path" value = "${plugin.dir}/Eclipse_SWT_PI/qt/library"/> |
|
39 <property name="lib.gfx.path" value = "${plugin.dir}/Eclipse_SWT_PI/qt/library/graphics"/> |
|
40 <mkdir dir="${lib.path}/${generated.native.dir}"/> |
|
41 <!-- Platform Specific properties --> |
|
42 </target> |
|
43 |
|
44 <target name="init.env"> |
|
45 <property environment = "env"/> |
|
46 </target> |
|
47 |
|
48 <target name="init.export.path" if="env.JAVA_BIN_ROOT"> |
|
49 <property name="export.jar.debug.path" value = "${env.JAVA_BIN_ROOT}/jsr/classes"/> |
|
50 <property name="export.jar.release.path" value = "${env.JAVA_BIN_ROOT}/jsr/classes"/> |
|
51 <property name="export.lib.debug.path" value = "${env.JAVA_BIN_ROOT}/lib"/> |
|
52 <property name="export.lib.release.path" value = "${env.JAVA_BIN_ROOT}/lib"/> |
|
53 </target> |
|
54 |
|
55 <target name="download" depends="init"> |
|
56 <delete dir="${temp.dir}"/> |
|
57 <mkdir dir="${temp.dir}/swtdownload/"/> |
|
58 <antcall target="build.jar"/> |
|
59 <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${basedir}/release/" |
|
60 update="true" includes="eswt*.dll,libeswt*.so"/> |
|
61 <copy file="${build.result.dir}/${jar.filename}" todir="${temp.dir}/swtdownload"/> |
|
62 <antcall target="src.zip"/> |
|
63 <copy file="${build.result.dir}/src.zip" todir="${temp.dir}/swtdownload"/> |
|
64 <copy file="${plugin.dir}/build/.project" todir="${temp.dir}/swtdownload"/> |
|
65 <copy file="${plugin.dir}/build/.classpath" todir="${temp.dir}/swtdownload"/> |
|
66 <copy todir="${temp.dir}/swtdownload"> |
|
67 <fileset dir="${basedir}" includes="about.html,about_files/"/> |
|
68 </copy> |
|
69 <zip zipfile="${download.destination}/eswt-${ws}-${os}-${arch}-${jsdk}.zip"> |
|
70 <zipfileset dir="${temp.dir}/swtdownload/"/> |
|
71 </zip> |
|
72 <delete dir="${temp.dir}"/> |
|
73 </target> |
|
74 |
|
75 <target name="src.zip" depends="init"> |
|
76 <mkdir dir="${build.result.dir}/"/> |
|
77 <zip zipfile="${build.result.dir}/src.zip"> |
|
78 <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/> |
|
79 <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/> |
|
80 <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/> |
|
81 <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/> |
|
82 <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/> |
|
83 <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/> |
|
84 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/> |
|
85 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/> |
|
86 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/> |
|
87 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/> |
|
88 <fileset dir="${plugin.dir}/Nokia SWT/extensions/" includes="**/*.java" excludes=""/> |
|
89 <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/> |
|
90 <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/> |
|
91 <fileset dir="${basedir}" includes="about.html,about_files/" excludes=""/> |
|
92 </zip> |
|
93 </target> |
|
94 |
|
95 <target name="gather.sources" depends="init" if="destination.temp.folder"> |
|
96 <mkdir dir="${destination.temp.folder}/${full.name}"/> |
|
97 <copy file="${build.result.dir}/src.zip" todir="${destination.temp.folder}/${full.name}/"/> |
|
98 <copy todir="${destination.temp.folder}/${full.name}"> |
|
99 <fileset dir="${basedir}" includes="about.html,about_files/"/> |
|
100 </copy> |
|
101 </target> |
|
102 |
|
103 <target name="gather.individual.sources" depends="init"> |
|
104 <copy todir="${destination.temp.folder}/" failonerror="true" overwrite="true"> |
|
105 <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/> |
|
106 <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/> |
|
107 <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/> |
|
108 <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/> |
|
109 <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/> |
|
110 <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/> |
|
111 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/> |
|
112 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/> |
|
113 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/> |
|
114 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/> |
|
115 <fileset dir="${plugin.dir}/Nokia SWT/extensions/" includes="**/*.java" excludes=""/> |
|
116 <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/> |
|
117 <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/> |
|
118 </copy> |
|
119 </target> |
|
120 |
|
121 <target name="gather.bin.parts" depends="init" if="destination.temp.folder"> |
|
122 <mkdir dir="${destination.temp.folder}/${full.name}"/> |
|
123 <copy todir="${destination.temp.folder}/${full.name}" failonerror="true"> |
|
124 <fileset dir="${plugin.dir}/bin" includes="*"/> |
|
125 </copy> |
|
126 <copy todir="${destination.temp.folder}/${full.name}"> |
|
127 <fileset dir="${basedir}" includes="eswt*.dll,libeswt*.so,META-INF/"/> |
|
128 </copy> |
|
129 <chmod perm="755" dir="${destination.temp.folder}/${full.name}" includes="eswt*.dll,libeswt*.so" /> |
|
130 <eclipse.versionReplacer path="${destination.temp.folder}/${full.name}" version="${version.suffix}"/> |
|
131 </target> |
|
132 |
|
133 <target name="jar.plugin" depends="init"> |
|
134 <delete dir="${temp.dir}"/> |
|
135 <mkdir dir="${temp.dir}"/> |
|
136 <antcall target="build.jar"/> |
|
137 <antcall target="gather.bin.parts"> |
|
138 <param name="destination.temp.folder" value="${temp.dir}/"/> |
|
139 </antcall> |
|
140 <jar jarfile="${plugin.destination}/${full.name}.jar" |
|
141 basedir="${temp.dir}/${full.name}" filesonly="true"/> |
|
142 <delete dir="${temp.dir}"/> |
|
143 </target> |
|
144 |
|
145 <target name="zip.plugin" depends="init"> |
|
146 <delete dir="${temp.dir}"/> |
|
147 <mkdir dir="${temp.dir}"/> |
|
148 <antcall target="build.jar"/> |
|
149 <antcall target="src.zip"/> |
|
150 <antcall target="gather.bin.parts"> |
|
151 <param name="destination.temp.folder" value="${temp.dir}/"/> |
|
152 </antcall> |
|
153 <antcall target="gather.sources"> |
|
154 <param name="destination.temp.folder" value="${temp.dir}/"/> |
|
155 </antcall> |
|
156 <zip zipfile="${plugin.destination}/${full.name}.zip" |
|
157 basedir="${temp.dir}" filesonly="true"/> |
|
158 <delete dir="${temp.dir}"/> |
|
159 </target> |
|
160 |
|
161 <target name="build"> |
|
162 <antcall target="export.jar"/> |
|
163 <antcall target="export.lib"/> |
|
164 </target> |
|
165 |
|
166 <target name="build.jar" depends="init" description="Produces eswt-qt.jar"> |
|
167 <mkdir dir="${plugin.dir}/bin"/> |
|
168 <javac destdir="${plugin.dir}/bin" source="${javac.source}" target="${javac.target}" |
|
169 debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true"> |
|
170 <src path="${plugin.dir}/Eclipse SWT/common/"/> |
|
171 <src path="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/"/> |
|
172 <src path="${plugin.dir}/Eclipse SWT/qt/"/> |
|
173 <src path="${plugin.dir}/Eclipse SWT Browser/common/"/> |
|
174 <src path="${plugin.dir}/Eclipse SWT Browser/qt/"/> |
|
175 <src path="${plugin.dir}/Eclipse SWT Drag and Drop/qt/"/> |
|
176 <src path="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/"/> |
|
177 <src path="${plugin.dir}/Eclipse_SWT_PI/qt/"/> |
|
178 <src path="${plugin.dir}/Nokia SWT/extensions/"/> |
|
179 </javac> |
|
180 <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${plugin.dir}/bin"/> |
|
181 </target> |
|
182 |
|
183 <target name="build.debug"> |
|
184 <antcall target="export.jar.debug"/> |
|
185 <antcall target="export.lib.debug"/> |
|
186 </target> |
|
187 |
|
188 <target name="build.release"> |
|
189 <antcall target="export.jar.release"/> |
|
190 <antcall target="export.lib.release"/> |
|
191 </target> |
|
192 |
|
193 <target name="build.lib"> |
|
194 <antcall target="build.lib.debug"/> |
|
195 <antcall target="build.lib.release"/> |
|
196 </target> |
|
197 |
|
198 <target name="build.lib.debug" depends="init"> |
|
199 <antcall target="build.lib.common"> |
|
200 <param name="build.lib.common.config" value="debug"/> |
|
201 </antcall> |
|
202 </target> |
|
203 |
|
204 <target name="build.lib.release" depends="init"> |
|
205 <antcall target="build.lib.common"> |
|
206 <param name="build.lib.common.config" value="release"/> |
|
207 </antcall> |
|
208 </target> |
|
209 |
|
210 <target name="build.lib.common" depends="init" description="params: config"> |
|
211 <javah outputfile="${lib.path}/${generated.native.dir}/os.h" classpath="${plugin.dir}/bin" verbose="yes"> |
|
212 <class name="org.eclipse.swt.internal.qt.OS"/> |
|
213 <class name="org.eclipse.swt.internal.qt.graphics.OS"/> |
|
214 </javah> |
|
215 <antcall target="qmake"> |
|
216 <param name="qmake.dir" value="${lib.path}"/> |
|
217 <param name="qmake.target" value="${build.lib.common.config}"/> |
|
218 <param name="qmake.spec" value="${lib.spec}"/> |
|
219 <param name="qmake.file" value="${lib.makefile}.${build.lib.common.config}"/> |
|
220 </antcall> |
|
221 <antcall target="make"> |
|
222 <param name="make.dir" value="${lib.path}"/> |
|
223 <param name="make.file" value="${lib.makefile}.${build.lib.common.config}"/> |
|
224 <param name="make.target" value=""/> |
|
225 </antcall> |
|
226 <!--<exec executable="pexports" dir="${lib.path}" failonerror="false"> |
|
227 <arg line="${build.lib.common.config}/${lib.filename} > swt.def"/> |
|
228 </exec>--> |
|
229 <mkdir dir="${build.result.dir}/${build.lib.common.config}/"/> |
|
230 <copy file="${lib.path}/${build.lib.common.config}/${lib.filename}" |
|
231 tofile="${build.result.dir}/${build.lib.common.config}/${lib.filename}" overwrite="true" verbose="true"/> |
|
232 </target> |
|
233 |
|
234 <target name="clean"> |
|
235 <antcall target="clean.jar"/> |
|
236 <antcall target="clean.lib"/> |
|
237 </target> |
|
238 |
|
239 <target name="clean.jar" depends="init" description=""> |
|
240 <delete dir="${plugin.dir}/bin"/> |
|
241 <delete file="${build.result.dir}/${jar.filename}" verbose="true"/> |
|
242 <delete file="${export.jar.debug.path}/${jar.filename}" verbose="true"/> |
|
243 <delete file="${export.jar.release.path}/${jar.filename}" verbose="true"/> |
|
244 </target> |
|
245 |
|
246 <target name="clean.lib"> |
|
247 <antcall target="clean.lib.debug"/> |
|
248 <antcall target="clean.lib.release"/> |
|
249 </target> |
|
250 |
|
251 <target name="clean.lib.debug" depends="init"> |
|
252 <antcall target="clean.lib.common"> |
|
253 <param name="clean.lib.common.config" value="debug"/> |
|
254 </antcall> |
|
255 </target> |
|
256 |
|
257 <target name="clean.lib.release" depends="init"> |
|
258 <antcall target="clean.lib.common"> |
|
259 <param name="clean.lib.common.config" value="release"/> |
|
260 </antcall> |
|
261 </target> |
|
262 |
|
263 <target name="clean.lib.common" depends="init" description="params: config"> |
|
264 <antcall target="make"> |
|
265 <param name="make.dir" value="${lib.path}"/> |
|
266 <param name="make.target" value="clean"/> |
|
267 <param name="make.file" value="${lib.makefile}.${clean.lib.common.config}"/> |
|
268 <param name="fail" value="false"/> |
|
269 </antcall> |
|
270 <delete file="${lib.path}/${lib.makefile}.${clean.lib.common.config}" verbose="true"/> |
|
271 <delete dir="${lib.path}/${generated.native.dir}" verbose="true"/> |
|
272 <delete dir="${lib.path}/${clean.lib.common.config}" verbose="true"/> |
|
273 <delete file="${build.result.dir}/${clean.lib.common.config}/${lib.filename}" verbose="true"/> |
|
274 <condition property="clean.lib.common.export.path" value="${export.lib.debug.path}" else="${export.lib.release.path}"> |
|
275 <equals arg1="${clean.lib.common.config}" arg2="debug"/> |
|
276 </condition> |
|
277 <delete file="${clean.lib.common.export.path}/${lib.filename}" verbose="true"/> |
|
278 </target> |
|
279 |
|
280 <target name="export"> |
|
281 <antcall target="export.jar"/> |
|
282 <antcall target="export.lib"/> |
|
283 </target> |
|
284 |
|
285 <target name="export.debug"> |
|
286 <antcall target="export.jar.debug"/> |
|
287 <antcall target="export.lib.debug"/> |
|
288 </target> |
|
289 |
|
290 <target name="export.release"> |
|
291 <antcall target="export.jar.release"/> |
|
292 <antcall target="export.lib.release"/> |
|
293 </target> |
|
294 |
|
295 <target name="export.jar"> |
|
296 <antcall target="export.jar.debug"/> |
|
297 <antcall target="export.jar.release"/> |
|
298 </target> |
|
299 |
|
300 <target name="export.jar.debug" depends="build.jar" if="export.jar.debug.path"> |
|
301 <mkdir dir="${export.jar.debug.path}"/> |
|
302 <copy file="${build.result.dir}/${jar.filename}" |
|
303 tofile="${export.jar.debug.path}/${jar.filename}" overwrite="true" verbose="true"/> |
|
304 </target> |
|
305 |
|
306 <target name="export.jar.release" depends="build.jar" if="export.jar.release.path"> |
|
307 <mkdir dir="${export.jar.release.path}"/> |
|
308 <copy file="${build.result.dir}/${jar.filename}" |
|
309 tofile="${export.jar.release.path}/${jar.filename}" overwrite="true" verbose="true"/> |
|
310 </target> |
|
311 |
|
312 <target name="export.lib"> |
|
313 <antcall target="export.lib.debug"/> |
|
314 <antcall target="export.lib.release"/> |
|
315 </target> |
|
316 |
|
317 <target name="export.lib.debug" depends="build.lib.debug" if="export.lib.debug.path"> |
|
318 <mkdir dir="${export.lib.debug.path}"/> |
|
319 <copy file="${lib.path}/debug/${lib.filename}" |
|
320 tofile="${export.lib.debug.path}/${lib.filename}" overwrite="true" verbose="true"/> |
|
321 </target> |
|
322 |
|
323 <target name="export.lib.release" depends="build.lib.release" if="export.lib.release.path"> |
|
324 <mkdir dir="${export.lib.release.path}"/> |
|
325 <copy file="${lib.path}/release/${lib.filename}" |
|
326 tofile="${export.lib.release.path}/${lib.filename}" overwrite="true" verbose="true"/> |
|
327 </target> |
|
328 |
|
329 <target name="make" description="params: dir, file, target"> |
|
330 <exec executable="mingw32-make" dir="${make.dir}" failonerror="false"> |
|
331 <arg line="-f ${make.file} ${make.target}"/> |
|
332 </exec> |
|
333 </target> |
|
334 |
|
335 <target name="qmake" description="params: dir, spec, target"> |
|
336 <exec executable="qmake" dir="${qmake.dir}" failonerror="true"> |
|
337 <arg line="-spec ${qmake.spec} -o ${qmake.file}"/> |
|
338 <arg value="CONFIG+=${qmake.target}"/> |
|
339 <arg value="DESTDIR=${qmake.target}"/> |
|
340 <arg value="OBJECTS_DIR=${qmake.target}/${qmake.spec}/build"/> |
|
341 </exec> |
|
342 </target> |
|
343 |
|
344 |
|
345 </project> |
|
346 |