<?xml version="1.0" encoding="UTF-8"?>

<project default="sakai:build"
   xmlns:j="jelly:core"
	xmlns:ant="jelly:ant">

   <goal name="javadoc">
      <j:set var="goal" value="javadoc"/>
      <attainGoal name="multiproject:goal"/>
   </goal>
	
	<goal name="schemagen">
		<!-- Skip the tests -->
		<j:set var="maven.test.skip" value="true" />

		<j:set var="maven.hibernate.properties" value="ddl.properties" />
		<j:set var="hibernate.hbm2ddl.auto" value="create" />
		<j:set var="maven.hibernate.delimiter" value=";" />
		<j:set var="maven.hibernate.quiet" value="false" />
		<j:set var="maven.hibernate.input.dir" value="" />
		<j:set var="maven.hibernate.input.includes" value="**/target/**/*.hbm.xml" />
		
		<j:set var="schemaexport.noDatabaseOverwrite" value="yes"/>

		<!-- The Maven plug-in for Hibernate 3 is not yet available to support this goal. -->
		<!--
		<attainGoal name="hibernate:schema-export" />
		-->
		 
		<ant:path id="schemaexport.classpath">
			<ant:path refid="maven.dependency.classpath" />
			<ant:pathelement location="${basedir}/target/classes" />
		</ant:path>
		<ant:taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="schemaexport.classpath" />
		<ant:schemaexport properties="${maven.hibernate.properties}" delimiter=";" text="${schemaexport.noDatabaseOverwrite}" output="metaobj.sql">
			<ant:fileset dir="${basedir}">
				<ant:include name="${maven.hibernate.input.includes}"/>
			</ant:fileset>
		</ant:schemaexport>
	</goal>

</project>