Skip to content

Commit 453c0c0

Browse files
committed
build the examples
1 parent 5977a1b commit 453c0c0

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

‎build.xml‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,24 @@
6868
<test-module modulename="hamcrest-integration"/>
6969
</target>
7070

71+
<target name="examples" depends="core, library, integration" description="Build and run unit tests.">
72+
<path id="cp-hamcrest-examples-main">
73+
<fileset file="build/hamcrest-core-${version}.jar"/>
74+
<fileset file="build/hamcrest-library-${version}.jar"/>
75+
<fileset file="build/hamcrest-integration-${version}.jar"/>
76+
<fileset dir="lib/integration" includes="**/*.jar"/>
77+
</path>
78+
<compile-module modulename="hamcrest-examples"/>
79+
</target>
80+
7181
<macrodef name="compile-module">
7282
<attribute name="modulename" description="Name of the module to jar"/>
7383

7484
<sequential>
85+
<mkdir dir="build/temp/@{modulename}-${version}.jar.source"/>
86+
<copy todir="build/temp/@{modulename}-${version}.jar.source"><fileset dir="@{modulename}/src/main/java"/></copy>
7587
<mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/>
76-
<javac srcdir="@{modulename}/src/main/java"
88+
<javac srcdir="build/temp/@{modulename}-${version}.jar.source"
7789
destdir="build/temp/@{modulename}-${version}.jar.contents"
7890
debug="${debug}" source="1.5" target="1.5" includeantruntime="false">
7991
<classpath refid="cp-@{modulename}-main"/>
@@ -84,8 +96,10 @@
8496
<fileset dir="build/temp/@{modulename}-${version}.jar.contents"/>
8597
</jar>
8698

99+
<mkdir dir="build/temp/@{modulename}-${version}-test.jar.source"/>
100+
<copy todir="build/temp/@{modulename}-${version}-test.jar.source" failonerror="false"><fileset dir="@{modulename}/src/test/java"/></copy>
87101
<mkdir dir="build/temp/@{modulename}-${version}-test.jar.contents"/>
88-
<javac srcdir="@{modulename}/src/test/java"
102+
<javac srcdir="build/temp/@{modulename}-${version}-test.jar.source"
89103
destdir="build/temp/@{modulename}-${version}-test.jar.contents"
90104
debug="${debug}" source="1.5" target="1.5" includeantruntime="false">
91105
<classpath refid="cp-@{modulename}-main"/>
@@ -126,14 +140,6 @@
126140
</sequential>
127141
</macrodef>
128142

129-
<target name="examples" depends="core, library, integration" description="Build and run unit tests.">
130-
<java-to-jar srcdir="hamcrest-examples/src/main/java"
131-
modulename="hamcrest-examples"
132-
classpath="build/hamcrest-core-${version}.jar;
133-
build/hamcrest-library-${version}.jar;
134-
build/hamcrest-integration-${version}.jar"/>
135-
</target>
136-
137143
<target name="bigjar" depends="core, library, integration, generator"
138144
description="Build a single Jar (hamcrest-all.jar) that contains core, library, generator and integration.">
139145
<mkdir dir="build/temp/hamcrest-all-${version}.jar.manifest"/>

0 commit comments

Comments
 (0)