<!--
 * Copyright 2002-2004  The Apache Software Foundation
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<project name="ws-commons" default="all">
	<property name="debug" value="true"/>
	<property name="optimize" value="true"/>
	<property name="source.version" value="1.2"/>
	<property name="target.version" value="1.2"/>

	<property name="build" location="build"/>
	<property name="build.dist" location="${build}/dist"/>

	<property name="java5.jar" location="${build.dist}/ws-commons-java5.jar"/>
	<property name="java5-src.zip" location="${build.dist}/ws-commons-java5-src.zip"/>
	<property name="util.jar" location="${build.dist}/ws-commons-util.jar"/>
	<property name="util-src.zip" location="${build.dist}/ws-commons-util-src.zip"/>

	<target name="clean" description="Removes the build directory">
		<delete dir="${build}"/>
	</target>

	<macrodef name="subproject">
		<attribute name="target" default="all"/>
		<attribute name="dir"/>
		<sequential>
			<ant dir="@{dir}" inheritall="false" inheritrefs="false" target="@{target}">
				<property name="debug" value="${debug}"/>
				<property name="optimize" value="${optimize}"/>
				<property name="source.version" value="${source.version}"/>
				<property name="target.version" value="${target.version}"/>
				<property name="build" location="${build}/@{dir}"/>
				<property name="build.dist" location="${build}/dist"/>
				<property name="java5.jar" location="${java5.jar}"/>
				<property name="java5-src.zip" location="${java5-src.zip}"/>
				<property name="util.jar" location="${util.jar}"/>
				<property name="util-src.zip" location="${util-src.zip}"/>
			</ant>
		</sequential>
	</macrodef>

	<target name="all" description="Builds all subprojects">
		<mkdir dir="${build.dist}"/>
		<subproject dir="java5"/>
		<subproject dir="util"/>
	</target>

	<target name="test" description="Builds and tests all subprojects">
		<mkdir dir="${build.dist}"/>
		<subproject dir="java5" target="test"/>
		<subproject dir="util" target="test"/>
	</target>
</project>
