|
190 | 190 | <macrodef name="compile-module"> |
191 | 191 | <attribute name="modulename" description="Name of the module to jar"/> |
192 | 192 | <sequential> |
193 | | - <mkdir dir="build/temp/@{modulename}-${version}-sources.jar.contents"/> |
194 | | - <copy todir="build/temp/@{modulename}-${version}-sources.jar.contents"> |
195 | | - <fileset dir="@{modulename}/src/main/java"/> |
196 | | - </copy> |
197 | | - <mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/> |
198 | | - <javac srcdir="build/temp/@{modulename}-${version}-sources.jar.contents" |
199 | | - destdir="build/temp/@{modulename}-${version}.jar.contents" |
200 | | - debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
201 | | - <classpath refid="cp-@{modulename}-main"/> |
202 | | - </javac> |
| 193 | + <compile-content srcdir="@{modulename}/src/main/java" jarname="@{modulename}-${version}" classpathref="cp-@{modulename}-main" /> |
| 194 | + <path id="cp-@{modulename}-test-complete"> |
| 195 | + <path refid="cp-@{modulename}-main"/> |
| 196 | + <path refid="cp-@{modulename}-test"/> |
| 197 | + <path path="build/temp/@{modulename}-${version}.jar.contents"/> |
| 198 | + </path> |
| 199 | + <compile-content srcdir="@{modulename}/src/test/java" jarname="@{modulename}-${version}-tests" classpathref="cp-@{modulename}-test-complete" /> |
| 200 | + </sequential> |
| 201 | + </macrodef> |
203 | 202 |
|
204 | | - <mkdir dir="build/temp/@{modulename}-${version}-tests-sources.jar.contents"/> |
205 | | - <copy todir="build/temp/@{modulename}-${version}-tests-sources.jar.contents" failonerror="false"> |
206 | | - <fileset dir="@{modulename}/src/test/java"/> |
| 203 | + <macrodef name="compile-content"> |
| 204 | + <attribute name="srcdir"/> |
| 205 | + <attribute name="jarname" description="Name of the jar whose content is being compiled (without .jar suffix)"/> |
| 206 | + <attribute name="classpathref"/> |
| 207 | + <sequential> |
| 208 | + <mkdir dir="build/temp/@{jarname}-sources.jar.contents"/> |
| 209 | + <copy todir="build/temp/@{jarname}-sources.jar.contents"> |
| 210 | + <fileset dir="@{srcdir}"/> |
207 | 211 | </copy> |
208 | | - <mkdir dir="build/temp/@{modulename}-${version}-tests.jar.contents"/> |
209 | | - <javac srcdir="build/temp/@{modulename}-${version}-tests-sources.jar.contents" |
210 | | - destdir="build/temp/@{modulename}-${version}-tests.jar.contents" |
| 212 | + <mkdir dir="build/temp/@{jarname}.jar.contents"/> |
| 213 | + <javac srcdir="build/temp/@{jarname}-sources.jar.contents" |
| 214 | + destdir="build/temp/@{jarname}.jar.contents" |
211 | 215 | debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
212 | | - <classpath refid="cp-@{modulename}-main"/> |
213 | | - <classpath refid="cp-@{modulename}-test"/> |
214 | | - <classpath path="build/temp/@{modulename}-${version}.jar.contents"/> |
| 216 | + <classpath refid="@{classpathref}"/> |
215 | 217 | </javac> |
216 | 218 | </sequential> |
217 | 219 | </macrodef> |
|
0 commit comments