|
1 | 1 | <?xml version="1.0"?> |
2 | | -<project name="RabbitMQ Java client" default="build"> |
| 2 | +<project name="RabbitMQ Java client" default="build" |
| 3 | + xmlns:bundlor="antlib:com.springsource.bundlor.ant"> |
3 | 4 |
|
4 | 5 | <property file="build.properties"/> |
5 | 6 | <property file="config.properties"/> |
|
45 | 46 | unless="amqp.generate.notRequired" description="generate AMQP.java and AMQImpl.java from AMQP spec"> |
46 | 47 | <mkdir dir="${src.generated}/com/rabbitmq/client/"/> |
47 | 48 | <exec dir="." executable="${python.bin}" |
48 | | - errorproperty="amqp.generate.error1" |
| 49 | + errorproperty="amqp.generate.error1" |
49 | 50 | resultproperty="amqp.generate.result1"> |
50 | 51 | <arg line="codegen.py"/> |
51 | 52 | <arg line="header"/> |
52 | 53 | <arg line="${AMQP_SPEC_JSON_PATH}"/> |
53 | 54 | <arg line="${src.generated}/com/rabbitmq/client/AMQP.java"/> |
54 | 55 | </exec> |
55 | | - <fail message="Generation of AMQP.java failed with message:${line.separator}${amqp.generate.error1}"> |
| 56 | + <fail message="Generation of AMQP.java failed with message:${line.separator}${amqp.generate.error1}"> |
56 | 57 | <condition> |
57 | 58 | <not> |
58 | 59 | <equals arg1="${amqp.generate.result1}" arg2="0" /> |
|
68 | 69 | <arg line="${AMQP_SPEC_JSON_PATH}"/> |
69 | 70 | <arg line="${src.generated}/com/rabbitmq/client/impl/AMQImpl.java"/> |
70 | 71 | </exec> |
71 | | - <fail message="Generation of AMQPImpl.java failed with message:${line.separator}${amqp.generate.error2}"> |
72 | | - <condition> |
73 | | - <not> |
74 | | - <equals arg1="${amqp.generate.result2}" arg2="0" /> |
75 | | - </not> |
76 | | - </condition> |
77 | | - </fail> |
| 72 | + <fail message="Generation of AMQPImpl.java failed with message:${line.separator}${amqp.generate.error2}"> |
| 73 | + <condition> |
| 74 | + <not> |
| 75 | + <equals arg1="${amqp.generate.result2}" arg2="0" /> |
| 76 | + </not> |
| 77 | + </condition> |
| 78 | + </fail> |
78 | 79 | </target> |
79 | 80 |
|
80 | 81 | <target name="build" depends="amqp-generate" description="Build the client library."> |
81 | 82 | <mkdir dir="${javac.out}"/> |
82 | 83 | <copy file="src/com/rabbitmq/client/impl/ClientVersion.java.in" |
83 | | - tofile="${src.generated}/com/rabbitmq/client/impl/ClientVersion.java"> |
| 84 | + tofile="${src.generated}/com/rabbitmq/client/impl/ClientVersion.java"> |
84 | 85 | <filterset> |
85 | | - <filter token="VERSION" value="${impl.version}"/> |
| 86 | + <filter token="VERSION" value="${impl.version}"/> |
86 | 87 | </filterset> |
87 | 88 | </copy> |
88 | 89 | <javac destdir="${javac.out}" |
89 | | - classpathref="javac.classpath" |
90 | | - source="${standard.javac.source}" |
91 | | - target="${standard.javac.target}" |
92 | | - debug="${javac.debug}"> |
| 90 | + classpathref="javac.classpath" |
| 91 | + source="${standard.javac.source}" |
| 92 | + target="${standard.javac.target}" |
| 93 | + debug="${javac.debug}"> |
93 | 94 | <src path="src"/> |
94 | 95 | <src path="${src.generated}"/> |
95 | 96 | </javac> |
|
178 | 179 | </target> |
179 | 180 |
|
180 | 181 | <target name="test-prepare"> |
181 | | - <property name="haltOnFailureJunit" value="yes" /> |
182 | | - <property name="haltOnFailureJava" value="true" /> |
| 182 | + <property name="haltOnFailureJunit" value="yes" /> |
| 183 | + <property name="haltOnFailureJava" value="true" /> |
183 | 184 | </target> |
184 | 185 |
|
185 | 186 | <target name="test-build" depends="test-prepare"> |
186 | | - <antcall target="test-build-param"> |
187 | | - <param name="javac.source" value="${standard.javac.source}"/> |
188 | | - <param name="javac.target" value="${standard.javac.target}"/> |
189 | | - </antcall> |
| 187 | + <antcall target="test-build-param"> |
| 188 | + <param name="javac.source" value="${standard.javac.source}"/> |
| 189 | + <param name="javac.target" value="${standard.javac.target}"/> |
| 190 | + </antcall> |
190 | 191 | </target> |
191 | 192 |
|
192 | 193 | <target name="test-build-alt" depends="test-prepare"> |
193 | | - <antcall target="test-build-param"> |
194 | | - <param name="javac.source" value="${alt.javac.source}"/> |
195 | | - <param name="javac.target" value="${alt.javac.target}"/> |
196 | | - </antcall> |
| 194 | + <antcall target="test-build-param"> |
| 195 | + <param name="javac.source" value="${alt.javac.source}"/> |
| 196 | + <param name="javac.target" value="${alt.javac.target}"/> |
| 197 | + </antcall> |
197 | 198 | </target> |
198 | 199 |
|
199 | 200 | <!-- Used to rebuild the tests every time, ( dependency on clean-tests ) |
|
298 | 299 | </target> |
299 | 300 |
|
300 | 301 | <target name="test-suite-prepare"> |
301 | | - <property name="haltOnFailureJunit" value="no" /> |
302 | | - <property name="haltOnFailureJava" value="false" /> |
| 302 | + <property name="haltOnFailureJunit" value="no" /> |
| 303 | + <property name="haltOnFailureJava" value="false" /> |
303 | 304 | </target> |
304 | 305 |
|
305 | 306 | <target name="test-suite" depends="test-suite-prepare, test-suite-run" description="Run all test suites."> |
306 | | - <fail message="Errors occured in tests"> |
307 | | - <condition> |
308 | | - <not> |
309 | | - <equals arg1="${test.failure}" arg2="" /> |
310 | | - </not> |
311 | | - </condition> |
312 | | - </fail> |
| 307 | + <fail message="Errors occured in tests"> |
| 308 | + <condition> |
| 309 | + <not> |
| 310 | + <equals arg1="${test.failure}" arg2="" /> |
| 311 | + </not> |
| 312 | + </condition> |
| 313 | + </fail> |
313 | 314 | </target> |
314 | 315 |
|
315 | 316 | <target name="test-suite-run" depends="test-client, test-ssl, test-server, test-functional, test-main-silent"/> |
|
386 | 387 | </junit> |
387 | 388 | </target> |
388 | 389 |
|
389 | | - <target name="jar" depends="build"> |
| 390 | + <target name="jar" depends="build, bundlor.do"> |
390 | 391 | <mkdir dir="${lib.out}"/> |
391 | 392 | <antcall target="doJarWithTags"> |
392 | 393 | <param name="jar.name" value="rabbitmq-client"/> |
|
410 | 411 | token="VERSION" value="${impl.version}"/> |
411 | 412 | </target> |
412 | 413 |
|
413 | | - <target name="test-jar" depends="test-build"> |
| 414 | + <target name="test-jar" depends="test-build, test-bundlor.do"> |
414 | 415 | <mkdir dir="${lib.out}"/> |
415 | 416 | <antcall target="doJarWithTags"> |
416 | 417 | <param name="jar.name" value="rabbitmq-client-tests"/> |
417 | 418 | <param name="base" value="${test.javac.out}"/> |
418 | 419 | </antcall> |
419 | 420 | </target> |
420 | | - |
421 | | - <target name="doJarWithTags"> |
422 | | - <jar destfile="${lib.out}/${jar.name}.jar" |
423 | | - basedir="${base}"> |
424 | | - <manifest> |
425 | | - <section name="${jar.name}"> |
426 | | - <attribute name="Specification-Title" value="AMQP"/> |
427 | | - <attribute name="Specification-Version" value="${spec.version}"/> |
428 | | - <attribute name="Specification-Vendor" value="AMQP Working Group (www.amqp.org)"/> |
429 | | - <attribute name="Implementation-Title" value="RabbitMQ"/> |
430 | | - <attribute name="Implementation-Version" value="${impl.version}"/> |
431 | | - <attribute name="Implementation-Vendor" value="Rabbit Technologies Ltd. (www.rabbitmq.com)"/> |
432 | | - </section> |
433 | | - </manifest> |
434 | | - </jar> |
435 | | - </target> |
| 421 | + |
| 422 | + <target name="doJarWithTags"> |
| 423 | + <jar destfile="${lib.out}/${jar.name}.jar" |
| 424 | + basedir="${base}" |
| 425 | + filesetmanifest="merge"> |
| 426 | + <manifest> |
| 427 | + <section name="${jar.name}"> |
| 428 | + <attribute name="Specification-Title" value="AMQP"/> |
| 429 | + <attribute name="Specification-Version" value="${spec.version}"/> |
| 430 | + <attribute name="Specification-Vendor" value="AMQP Working Group (www.amqp.org)"/> |
| 431 | + <attribute name="Implementation-Title" value="RabbitMQ"/> |
| 432 | + <attribute name="Implementation-Version" value="${impl.version}"/> |
| 433 | + <attribute name="Implementation-Vendor" value="Rabbit Technologies Ltd. (www.rabbitmq.com)"/> |
| 434 | + </section> |
| 435 | + </manifest> |
| 436 | + </jar> |
| 437 | + </target> |
436 | 438 |
|
437 | 439 | <target name="dist" depends="jar, test-jar"> |
438 | 440 | <mkdir dir="${dist.out}"/> |
439 | 441 | <copy todir="${dist.out}"> |
440 | 442 | <!-- ant doesn't seem to provide any form of usable abstraction over sets of file names --> |
441 | 443 | <!-- consequently we repeat ourselves here. see definition of javac.classpath, supra --> |
442 | 444 | <fileset dir="lib"> |
443 | | - <include name="**/*.jar"/> |
| 445 | + <include name="**/*.jar"/> |
444 | 446 | </fileset> |
445 | 447 |
|
446 | 448 | <fileset dir="${lib.out}"> |
447 | | - <include name="**/*.jar"/> |
| 449 | + <include name="**/*.jar"/> |
448 | 450 | </fileset> |
449 | 451 |
|
450 | 452 | <fileset dir="scripts"> |
|
461 | 463 | <target name="clean-tests"> |
462 | 464 | <delete dir="build/test"/> |
463 | 465 | </target> |
| 466 | + |
| 467 | + <target name="bundlor.init"> |
| 468 | + <taskdef resource="com/springsource/bundlor/ant/antlib.xml" |
| 469 | + uri="antlib:com.springsource.bundlor.ant"> |
| 470 | + <classpath id="bundlor.classpath"> |
| 471 | + <fileset dir="${bundlor.home}/dist"/> |
| 472 | + <fileset dir="${bundlor.home}/lib"/> |
| 473 | + </classpath> |
| 474 | + </taskdef> |
| 475 | + </target> |
| 476 | + |
| 477 | + <target name="bundlor.do" depends="bundlor.init"> |
| 478 | + <bundlor:bundlor |
| 479 | + inputPath="${javac.out}" |
| 480 | + outputPath="${javac.out}" |
| 481 | + manifestTemplatePath="bundlorTemplate.mf"> |
| 482 | + <propertyset> |
| 483 | + <propertyref builtin="all"/> |
| 484 | + </propertyset> |
| 485 | + </bundlor:bundlor> |
| 486 | + </target> |
| 487 | + |
| 488 | + <target name="test-bundlor.do" depends="bundlor.init"> |
| 489 | + <bundlor:bundlor |
| 490 | + inputPath="${test.javac.out}" |
| 491 | + outputPath="${test.javac.out}" |
| 492 | + manifestTemplatePath="bundlorTestTemplate.mf"> |
| 493 | + <propertyset> |
| 494 | + <propertyref builtin="all"/> |
| 495 | + </propertyset> |
| 496 | + </bundlor:bundlor> |
| 497 | + </target> |
464 | 498 | </project> |
0 commit comments