|
79 | 79 | <jar-module modulename="hamcrest-examples"/> |
80 | 80 | </target> |
81 | 81 |
|
82 | | - <macrodef name="compile-module"> |
83 | | - <attribute name="modulename" description="Name of the module to jar"/> |
84 | | - <sequential> |
85 | | - <mkdir dir="build/temp/@{modulename}-${version}-sources.jar.contents"/> |
86 | | - <copy todir="build/temp/@{modulename}-${version}-sources.jar.contents"> |
87 | | - <fileset dir="@{modulename}/src/main/java"/> |
88 | | - </copy> |
89 | | - <mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/> |
90 | | - <javac srcdir="build/temp/@{modulename}-${version}-sources.jar.contents" |
91 | | - destdir="build/temp/@{modulename}-${version}.jar.contents" |
92 | | - debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
93 | | - <classpath refid="cp-@{modulename}-main"/> |
94 | | - </javac> |
95 | | - |
96 | | - <mkdir dir="build/temp/@{modulename}-${version}-tests-sources.jar.contents"/> |
97 | | - <copy todir="build/temp/@{modulename}-${version}-tests-sources.jar.contents" failonerror="false"> |
98 | | - <fileset dir="@{modulename}/src/test/java"/> |
99 | | - </copy> |
100 | | - <mkdir dir="build/temp/@{modulename}-${version}-tests.jar.contents"/> |
101 | | - <javac srcdir="build/temp/@{modulename}-${version}-tests-sources.jar.contents" |
102 | | - destdir="build/temp/@{modulename}-${version}-tests.jar.contents" |
103 | | - debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
104 | | - <classpath refid="cp-@{modulename}-main"/> |
105 | | - <classpath refid="cp-@{modulename}-test"/> |
106 | | - <classpath path="build/temp/@{modulename}-${version}.jar.contents"/> |
107 | | - </javac> |
108 | | - </sequential> |
109 | | - </macrodef> |
110 | | - |
111 | | - <macrodef name="jar-module"> |
112 | | - <attribute name="modulename" description="Name of the module to jar"/> |
113 | | - <sequential> |
114 | | - <make-manifest modulename="@{modulename}"/> |
115 | | - <jar-module-component modulename="@{modulename}"/> |
116 | | - <jar-module-component modulename="@{modulename}" suffix="-tests"/> |
117 | | - <jar-module-component modulename="@{modulename}" suffix="-sources"/> |
118 | | - </sequential> |
119 | | - </macrodef> |
120 | | - |
121 | | - <macrodef name="jar-module-component"> |
122 | | - <attribute name="modulename" description="Name of the module to jar"/> |
123 | | - <attribute name="suffix" default="" description="Name of the module to jar"/> |
124 | | - <sequential> |
125 | | - <copy file="LICENSE.txt" todir="build/temp/@{modulename}-${version}@{suffix}.jar.contents/META-INF"/> |
126 | | - <jar jarfile="build/@{modulename}-${version}@{suffix}.jar" manifest="build/temp/@{modulename}-${version}.jar.manifest/MANIFEST.MF"> |
127 | | - <fileset dir="build/temp/@{modulename}-${version}@{suffix}.jar.contents"/> |
128 | | - </jar> |
129 | | - </sequential> |
130 | | - </macrodef> |
131 | | - |
132 | | - <macrodef name="generate-module-factory" description="Generate one class with all static imports"> |
133 | | - <attribute name="modulename" description="Name of the module to jar"/> |
134 | | - <attribute name="configurationfile" description="xml configuration file"/> |
135 | | - <attribute name="targetclass" description="factory class to generate"/> |
136 | | - <sequential> |
137 | | - <mkdir dir="build/temp/@{modulename}/generated-code"/> |
138 | | - <java classname="org.hamcrest.generator.config.XmlConfigurator" fork="yes" failonerror="yes"> |
139 | | - <classpath path="build/hamcrest-generator-${version}.jar"/> |
140 | | - <classpath refid="cp-@{modulename}-main"/> |
141 | | - <classpath path="build/temp/@{modulename}-${version}.jar.contents"/> |
142 | | - <arg value="@{configurationfile}"/> |
143 | | - <arg value="@{modulename}/src/main/java"/> |
144 | | - <arg value="@{targetclass}"/> |
145 | | - <arg value="build/temp/@{modulename}/generated-code"/> |
146 | | - </java> |
147 | | - |
148 | | - <copy todir="build/temp/@{modulename}-${version}-sources.jar.contents"> |
149 | | - <fileset dir="build/temp/@{modulename}/generated-code"/> |
150 | | - </copy> |
151 | | - <compile-module modulename="@{modulename}"/> |
152 | | - </sequential> |
153 | | - </macrodef> |
154 | | - |
155 | 82 | <target name="bigjar" depends="core, library, integration, generator" |
156 | 83 | description="Build a single Jar (hamcrest-all.jar) that contains core, library, generator and integration."> |
157 | 84 | <!-- Bundle api into core jar --> |
|
318 | 245 | </sequential> |
319 | 246 | </macrodef> |
320 | 247 |
|
| 248 | + <macrodef name="compile-module"> |
| 249 | + <attribute name="modulename" description="Name of the module to jar"/> |
| 250 | + <sequential> |
| 251 | + <mkdir dir="build/temp/@{modulename}-${version}-sources.jar.contents"/> |
| 252 | + <copy todir="build/temp/@{modulename}-${version}-sources.jar.contents"> |
| 253 | + <fileset dir="@{modulename}/src/main/java"/> |
| 254 | + </copy> |
| 255 | + <mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/> |
| 256 | + <javac srcdir="build/temp/@{modulename}-${version}-sources.jar.contents" |
| 257 | + destdir="build/temp/@{modulename}-${version}.jar.contents" |
| 258 | + debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
| 259 | + <classpath refid="cp-@{modulename}-main"/> |
| 260 | + </javac> |
| 261 | + |
| 262 | + <mkdir dir="build/temp/@{modulename}-${version}-tests-sources.jar.contents"/> |
| 263 | + <copy todir="build/temp/@{modulename}-${version}-tests-sources.jar.contents" failonerror="false"> |
| 264 | + <fileset dir="@{modulename}/src/test/java"/> |
| 265 | + </copy> |
| 266 | + <mkdir dir="build/temp/@{modulename}-${version}-tests.jar.contents"/> |
| 267 | + <javac srcdir="build/temp/@{modulename}-${version}-tests-sources.jar.contents" |
| 268 | + destdir="build/temp/@{modulename}-${version}-tests.jar.contents" |
| 269 | + debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
| 270 | + <classpath refid="cp-@{modulename}-main"/> |
| 271 | + <classpath refid="cp-@{modulename}-test"/> |
| 272 | + <classpath path="build/temp/@{modulename}-${version}.jar.contents"/> |
| 273 | + </javac> |
| 274 | + </sequential> |
| 275 | + </macrodef> |
| 276 | + |
| 277 | + <macrodef name="jar-module"> |
| 278 | + <attribute name="modulename" description="Name of the module to jar"/> |
| 279 | + <sequential> |
| 280 | + <make-manifest modulename="@{modulename}"/> |
| 281 | + <jar-module-component modulename="@{modulename}"/> |
| 282 | + <jar-module-component modulename="@{modulename}" suffix="-tests"/> |
| 283 | + <jar-module-component modulename="@{modulename}" suffix="-sources"/> |
| 284 | + </sequential> |
| 285 | + </macrodef> |
| 286 | + |
| 287 | + <macrodef name="jar-module-component"> |
| 288 | + <attribute name="modulename" description="Name of the module to jar"/> |
| 289 | + <attribute name="suffix" default="" description="Name of the module to jar"/> |
| 290 | + <sequential> |
| 291 | + <copy file="LICENSE.txt" todir="build/temp/@{modulename}-${version}@{suffix}.jar.contents/META-INF"/> |
| 292 | + <jar jarfile="build/@{modulename}-${version}@{suffix}.jar" manifest="build/temp/@{modulename}-${version}.jar.manifest/MANIFEST.MF"> |
| 293 | + <fileset dir="build/temp/@{modulename}-${version}@{suffix}.jar.contents"/> |
| 294 | + </jar> |
| 295 | + </sequential> |
| 296 | + </macrodef> |
| 297 | + |
| 298 | + <macrodef name="generate-module-factory" description="Generate one class with all static imports"> |
| 299 | + <attribute name="modulename" description="Name of the module to jar"/> |
| 300 | + <attribute name="configurationfile" description="xml configuration file"/> |
| 301 | + <attribute name="targetclass" description="factory class to generate"/> |
| 302 | + <sequential> |
| 303 | + <mkdir dir="build/temp/@{modulename}/generated-code"/> |
| 304 | + <java classname="org.hamcrest.generator.config.XmlConfigurator" fork="yes" failonerror="yes"> |
| 305 | + <classpath path="build/hamcrest-generator-${version}.jar"/> |
| 306 | + <classpath refid="cp-@{modulename}-main"/> |
| 307 | + <classpath path="build/temp/@{modulename}-${version}.jar.contents"/> |
| 308 | + <arg value="@{configurationfile}"/> |
| 309 | + <arg value="@{modulename}/src/main/java"/> |
| 310 | + <arg value="@{targetclass}"/> |
| 311 | + <arg value="build/temp/@{modulename}/generated-code"/> |
| 312 | + </java> |
| 313 | + |
| 314 | + <copy todir="build/temp/@{modulename}-${version}-sources.jar.contents"> |
| 315 | + <fileset dir="build/temp/@{modulename}/generated-code"/> |
| 316 | + </copy> |
| 317 | + <compile-module modulename="@{modulename}"/> |
| 318 | + </sequential> |
| 319 | + </macrodef> |
| 320 | + |
321 | 321 | <macrodef name="test-module" description="run unit tests."> |
322 | 322 | <attribute name="modulename" description="Name of the module to jar"/> |
323 | 323 | <sequential> |
|
0 commit comments