|
68 | 68 | <test-module modulename="hamcrest-integration"/> |
69 | 69 | </target> |
70 | 70 |
|
| 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 | + |
71 | 81 | <macrodef name="compile-module"> |
72 | 82 | <attribute name="modulename" description="Name of the module to jar"/> |
73 | 83 |
|
74 | 84 | <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> |
75 | 87 | <mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/> |
76 | | - <javac srcdir="@{modulename}/src/main/java" |
| 88 | + <javac srcdir="build/temp/@{modulename}-${version}.jar.source" |
77 | 89 | destdir="build/temp/@{modulename}-${version}.jar.contents" |
78 | 90 | debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
79 | 91 | <classpath refid="cp-@{modulename}-main"/> |
|
84 | 96 | <fileset dir="build/temp/@{modulename}-${version}.jar.contents"/> |
85 | 97 | </jar> |
86 | 98 |
|
| 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> |
87 | 101 | <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" |
89 | 103 | destdir="build/temp/@{modulename}-${version}-test.jar.contents" |
90 | 104 | debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
91 | 105 | <classpath refid="cp-@{modulename}-main"/> |
|
126 | 140 | </sequential> |
127 | 141 | </macrodef> |
128 | 142 |
|
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 | | - |
137 | 143 | <target name="bigjar" depends="core, library, integration, generator" |
138 | 144 | description="Build a single Jar (hamcrest-all.jar) that contains core, library, generator and integration."> |
139 | 145 | <mkdir dir="build/temp/hamcrest-all-${version}.jar.manifest"/> |
|
0 commit comments