|
84 | 84 | build/hamcrest-library-${version}.jar"/> |
85 | 85 | </target> |
86 | 86 |
|
87 | | - <target name="unit-test" depends="core, library, integration, generator" description="Build and run unit tests."> |
88 | | - <java-to-jar srcdir="hamcrest-unit-test/src/main/java" modulename="hamcrest-unit-test" |
89 | | - classpath="build/hamcrest-core-${version}.jar; |
90 | | - build/hamcrest-library-${version}.jar; |
91 | | - build/hamcrest-integration-${version}.jar; |
92 | | - build/hamcrest-generator-${version}.jar"/> |
93 | | - <junit printsummary="no" fork="no" haltonfailure="${haltonfailure}"> |
94 | | - <formatter type="brief" usefile="no"/> |
95 | | - <classpath> |
96 | | - <fileset dir="lib/integration"> |
97 | | - <include name="*.jar"/> |
98 | | - </fileset> |
99 | | - <pathelement path="build/hamcrest-core-${version}.jar"/> |
100 | | - <pathelement path="build/hamcrest-library-${version}.jar"/> |
101 | | - <pathelement path="build/hamcrest-integration-${version}.jar"/> |
102 | | - <pathelement path="build/hamcrest-generator-${version}.jar"/> |
103 | | - <pathelement path="build/hamcrest-unit-test-${version}.jar"/> |
104 | | - </classpath> |
105 | | - <batchtest> |
106 | | - <fileset dir="hamcrest-unit-test/src/main/java"> |
107 | | - <include name="**/*Test*"/> |
108 | | - <exclude name="**/Abstract*"/> |
109 | | - </fileset> |
110 | | - </batchtest> |
111 | | - </junit> |
112 | | - </target> |
113 | | - |
114 | 87 | <target name="examples" depends="core, library, integration" description="Build and run unit tests."> |
115 | 88 | <java-to-jar srcdir="hamcrest-examples/src/main/java" |
116 | 89 | modulename="hamcrest-examples" |
|
174 | 147 | </jar> |
175 | 148 | </target> |
176 | 149 |
|
177 | | - <target name="package" depends="core, generator, library, integration, bigjar, unit-test, examples, javadoc" description="Package for distribution"> |
| 150 | + <target name="package" depends="core, generator, library, integration, bigjar, examples, javadoc" description="Package for distribution"> |
178 | 151 | <copy todir="build"> |
179 | 152 | <fileset dir="pom" includes="*.pom"/> |
180 | 153 | <filterset><filter token="VERSION" value="${version}"/></filterset> |
|
283 | 256 | <attribute name="Built-By" value="${user.name}"/> |
284 | 257 | <attribute name="Built-Date" value="${build.timestamp}"/> |
285 | 258 | </manifest> |
| 259 | + |
| 260 | + <!-- Build jar --> |
286 | 261 | <mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/> |
287 | 262 | <javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}-${version}.jar.contents" debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
288 | 263 | <classpath> |
|
297 | 272 | <fileset dir="build/temp/@{modulename}-${version}.jar.contents"/> |
298 | 273 | </jar> |
299 | 274 |
|
| 275 | + <!-- Build test jar --> |
| 276 | + <mkdir dir="build/temp/@{modulename}-${version}.testjar.contents"/> |
| 277 | + <javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}-${version}.testjar.contents" debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
| 278 | + <classpath> |
| 279 | + <fileset dir="lib/integration"> |
| 280 | + <include name="*.jar"/> |
| 281 | + </fileset> |
| 282 | + <pathelement path="build/@{modulename}-${version}.jar"/> |
| 283 | + <pathelement path="@{classpath}"/> |
| 284 | + </classpath> |
| 285 | + </javac> |
| 286 | + <jar jarfile="build/@{modulename}-${version}-tests.jar" manifest="build/temp/@{modulename}-${version}.jar.manifest/MANIFEST.MF"> |
| 287 | + <fileset dir="build/temp/@{modulename}-${version}.testjar.contents"/> |
| 288 | + </jar> |
| 289 | + |
300 | 290 | <!-- Build sources jar --> |
301 | 291 | <copy todir="build/temp/@{modulename}-${version}-sources.jar.contents"> |
302 | 292 | <fileset dir="@{srcdir}"/> |
|
330 | 320 | </jar> |
331 | 321 | </sequential> |
332 | 322 | </macrodef> |
| 323 | + |
| 324 | + <macrodef name="unit-test" description="run unit tests."> |
| 325 | + <attribute name="modulename" description="Name of the module to jar"/> |
| 326 | + <attribute name="classpath" description="Anything additional to add on the classpath" default=""/> |
| 327 | + <sequential> |
| 328 | + <junit printsummary="no" fork="no" haltonfailure="${haltonfailure}"> |
| 329 | + <formatter type="brief" usefile="no"/> |
| 330 | + <classpath> |
| 331 | + <fileset dir="lib/integration"> |
| 332 | + <include name="*.jar"/> |
| 333 | + </fileset> |
| 334 | + <pathelement path="build/hamcrest-core-${version}.jar"/> |
| 335 | + <pathelement path="build/hamcrest-library-${version}.jar"/> |
| 336 | + <pathelement path="build/hamcrest-integration-${version}.jar"/> |
| 337 | + <pathelement path="build/hamcrest-generator-${version}.jar"/> |
| 338 | + <pathelement path="build/hamcrest-unit-test-${version}.jar"/> |
| 339 | + </classpath> |
| 340 | + <batchtest> |
| 341 | + <batchtest fork="yes" todir="${build.dir}/testreport"> |
| 342 | + <zipfileset src="build/@{modulename}-${version}-tests.jar"> |
| 343 | + <include name="org/hamcrest/**/*Test.class"/> |
| 344 | + </zipfileset> |
| 345 | + </batchtest> |
| 346 | + </batchtest> |
| 347 | + </junit> |
| 348 | + </sequential> |
| 349 | + </macrodef> |
333 | 350 | </project> |
0 commit comments