<?xml version="1.0" encoding="UTF-8"?>
<project name="Plugin Javadoc" default="javadoc">
	<property name="destDir"    value="doc"/>
	<property name="classpath"  value="bin"/>
	<property name="overview"   value="build/overview.html"/>
	<property name="eclipseDir" value="../../.."/>
	
	<property environment="env"/>
	<property name="javaHome" value="${env.JAVA_HOME}"/>
	
	<property name="javadoc.link.location" value="${eclipseDir}/javadoc"/>
	<available property="platformJavadocExists" file="${javadoc.link.location}/platform/"/>

	<target name="extractPlatformJavadoc" unless="platformJavadocExists">
		<unzip src="${eclipseDir}/plugins/org.eclipse.platform.doc.isv.jar" dest="${javadoc.link.location}/platform/"/>
	</target>
	
	<target name="javadoc" depends="extractPlatformJavadoc">
		<javadoc 
			destdir="${destDir}" 
			classpath="${classpath}"
			overview="${overview}"

			windowtitle="XSD Javadoc"
			footer="Copyright 2001-2006 IBM Corporation and others.&lt;br&gt; All Rights Reserved."

			access="protected" 
			additionalparam="-breakiterator -tag model:X -tag generated:X -tag ordered:X"
			author="false"
			breakiterator="true"
			charset="UTF-8"
			docencoding="UTF-8"
			nodeprecated="false"
			nodeprecatedlist="false" 
			noindex="false" 
			nonavbar="false" 
			notree="false" 
			splitindex="true" 
			use="true" 
			version="true"> 
				<arg value="-J-Xmx256m"/>
				
				<link offline="true" href="http://java.sun.com/j2se/1.5/docs/api/" packagelistLoc="${javaHome}/docs/api/"/>
				<link offline="true" href="/help/topic/org.eclipse.platform.doc.isv/reference/api/" packagelistLoc="${javadoc.link.location}/platform/reference/api/"/>
				<link offline="true" href="/help/topic/org.eclipse.emf.doc/references/javadoc/" packagelistLoc="${eclipseDir}/plugins/org.eclipse.emf.doc/references/javadoc/"/>
				
				<tag name="ignore"     description="ignore" enabled="false"/>
				<tag name="generated"  description="ignore" enabled="false"/>
				<tag name="model"      description="ignore" enabled="false"/>
				<tag name="modifiable" description="ignore" enabled="false"/>
				<tag name="extends"    description="ignore" enabled="false"/>
				<tag name="implements" description="ignore" enabled="false"/>
				<tag name="ordered"    description="ignore" enabled="false"/>

				<!-- If you add a @plugin@ below, don't forget to update the antjavadoc.sh file -->				

				<group title="XML Schema Model API"                       packages="org.eclipse.xsd:org.eclipse.xsd.util"/>
				<group title="XML Schema Model Implementation"            packages="org.eclipse.xsd.impl:org.eclipse.xsd.impl.type"/>
				<group title="XML Schema Model To Ecore Model Conversion" packages="org.eclipse.xsd.ecore"/>
				<group title="XML Schema Model Edit"                      packages="@org.eclipse.xsd.edit@"/>
				<group title="XML Schema Model Editor"                    packages="@org.eclipse.xsd.editor@"/>
				<group title="XSD to Ecore Mapping Model"                 packages="org.eclipse.emf.mapping.xsd2ecore:org.eclipse.emf.mapping.xsd2ecore.impl:org.eclipse.emf.mapping.xsd2ecore.util"/>
				<group title="XSD to Ecore Mapping Edit"                  packages="org.eclipse.emf.mapping.xsd2ecore.provider"/>
				<group title="XSD to Ecore Mapping Editor"                packages="@org.eclipse.emf.mapping.xsd2ecore.editor@"/>

				<!-- If you add a @plugin@ above, don't forget to update the antjavadoc.sh file -->
				
@packagesets@
				
		</javadoc>
		
		<!-- make sure the doc-files are copied -->
		<macrodef name="copyDocFiles">
			<attribute name="pluginDir"/>
			<sequential>
				<copy todir="${destDir}" failonerror="false">
				        <fileset dir="@{pluginDir}/src" includes="**/doc-files/**"/>
				</copy>		
			</sequential>
		</macrodef>

@copydocfiles@

	</target>
</project>
