<?xml version="1.0"?>
<!--
	Copyright (c) 2004 on behalf of the EU EGEE Project: 
	The European Organization for Nuclear Research (CERN), 
	Istituto Nazionale di Fisica Nucleare (INFN), Italy
	Datamat Spa, Italy
	Centre National de la Recherche Scientifique (CNRS), France
	CS Systeme d'Information (CSSI), France
	Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
	Universiteit van Amsterdam (UvA), Netherlands
	University of Helsinki (UH.HIP), Finland
	University of Bergen (UiB), Norway
	Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom

	GLite Middleware WMS Configuration Specification File
	
	Authors: Alberto Di Meglio <alberto.di.meglio@cern.ch>		
	         Joachim Flammer <Joachim.Flammer@cern.ch>
	Version info: $Id$
	Release: $Name$

	Revision history:
	$Log$
	Revision 1.3  2004/10/27 10:35:37  dimeglio
	Added missing closing target
	
	Revision 1.2  2004/10/27 10:28:29  dimeglio
	Modified to use gridsite-core
	
	Revision 1.1  2004/10/26 17:54:24  dimeglio
	First version of this file
	
	Revision 1.7  2004/10/18 23:01:18  dimeglio
	Added oscheck to various targets
	
	Revision 1.6  2004/10/12 14:21:21  eronchie
	Removed ssl_utils dependency
	
	Revision 1.5  2004/08/20 09:51:39  eronchie
	Updated buildmodules orders
	
	Revision 1.4  2004/08/04 07:30:29  eronchie
	Added cppunit
	
	Revision 1.3  2004/07/23 14:50:08  eronchie
	Added exception
	
	Revision 1.2  2004/07/23 08:27:03  eronchie
	Updated
	
	
-->

<project name="Gridsite Core CSF" default="all">

	<!-- overwrite default workspace directory -->
	<property name="workspace.dir" value="../.." />

	<!-- ===============================================
		 Load properties
		 =============================================== -->

	<!-- load baseline and user properties -->
	<import file="${workspace.dir}/org.glite/project/baseline.properties.xml" />

	<!-- define build properties file location since we are already in project dir -->
	<property name="subsystem.build.properties.file" value="./build.properties" />

	<!-- Load subsytem-specific property files -->
	<import file="./properties.xml"/>

	<!-- load global properties -->
	<import file="${global.properties.file}" />

	<!-- ===============================================
		 Load dependencies 
		 =============================================== -->

	<!-- Load user dependencies file -->
	<property file="${user.dependencies.file}" />
		
	<!-- Load subsystem dependencies file -->
	<property file="./dependencies.properties" />

	<!-- Load global dependencies file -->
	<property file="${global.dependencies.file}" />

	<!-- ===============================================
		 Load targets 
		 =============================================== -->
	<import file="${global.targets-envchecks.file}" />
	<import file="${global.targets-external-dependencies.file}" />

	<!-- ===============================================
		 Evaluate CVS tags
		 =============================================== -->

    	<target name="evaluate.cvs.tags" description="Figure out if we need tagged CVS checkout">
			<condition property="glite.head">
				<and>
					<equals arg1="${org.glite.version}" arg2="HEAD" />
					<or>
						<istrue value="${update}" />
						<not>
							<available file="${global.dependencies.file}" type="file" />
						</not>
					</or>
				</and>
			</condition>
			<condition property="glite.tag">
				<and>
					<not>
						<equals arg1="${org.glite.version}" arg2="HEAD" />
					</not>
					<or>
						<istrue value="${update}" />
						<not>
							<available file="${global.dependencies.file}" type="file" />
						</not>
					</or>
				</and>
			</condition>
			<condition property="gridsite-core.head">
				<and>
					<equals arg1="${org.gridsite-core.version}" arg2="HEAD" />
					<istrue value="${update}" />
				</and>
			</condition>
			<condition property="gridsite-core.tag">
				<and>
					<not>
						<equals arg1="${org.gridsite-core.version}" arg2="HEAD" />
					</not>
					<istrue value="${update}" />
				</and>
			</condition>

		</target>
	
		<!-- condition property tag = do not remove = -->

    	<presetdef name="cvs-co">
		<cvs command="checkout" dest="${workspace.dir}" />
    	</presetdef>

	<!-- =====================================================
		 Self-update if required
		 ===================================================== -->
		
	<!-- Update main GLite module -->
 	<target name="org.glite" depends="get.glite.head, get.glite.tag"/>
	<target name="get.glite.head" if="glite.head">
		<cvs-co package="org.glite" />
	</target>
	<target name="get.glite.tag" if="glite.tag">
		<cvs-co package="org.glite"
			tag="${org.glite.version}" />
	</target>

	<!-- Update the current module -->
 	<target name="org.gridsite.core" depends="get.gridsite-core.head, get.gridsite-core.tag"/>
	<target name="get.gridsite-core.head" if="gridsite-core.head">
		<cvs-co package="org.gridsite.core" />
		<fail>The org.glite and org.gridsite.core modules have been updated, please rerun the configuration file</fail>
	</target>
	<target name="get.gridsite-core.tag" if="gridsite-core.tag">
		<cvs-co package="org.gridsite.core"
			tag="${org.gridsite.core.version}" />
		<fail>The org.glite and org.gridsite.core modules have been updated, please rerun the configuration file</fail>
	</target>

	<!-- *****************************************************-->
	<!-- Development tools                                    -->
	<!-- *****************************************************-->
	
	<!-- All development tools -->
 	<target name="devtools" depends="oscheck,
 					 junitcheck,
	 				 junit,
  				     chkstyle,
 					 jalopy,
 					 ant-contrib,
 					 cpptasks,
 					 egee-ant-ext"/>		
	
	<!-- =====================================================
		 External libraries
		 ===================================================== -->
	
	<!--  All external libraries -->
 	<target name="external" depends="oscheck,
 					 log4j"/>
 	
	<!-- =====================================================
		 GLite WMS modules
		 ===================================================== -->

	<!-- component targets tag = do not remove = -->

	<!-- All project modules -->
 	<target name="project" depends=""/>


	<!-- ====================================================
		 Checkout all
		 ==================================================== -->
	
	<!-- All libraries -->
 	<target name="all" depends="oscheck,evaluate.cvs.tags,defaultenvchecks,org.glite,org.gridsite.core,devtools,external,project" />		

	<!-- ====================================================
		 Print dependecies to console
		 ==================================================== -->
	
 	<target name="dependencies">
 		<concat>
 			<fileset dir="." includes="dependencies.properties" />
 		</concat>
 	</target>		

</project>
