<?xml version="1.0"?>

<project name="Messages" default="deploy" basedir=".">

  <!-- Example name -->
  <property name="Name" value="Seam Message List Example"/>
  <property name="example.name" value="jboss-seam-messages"/>

  <!-- Libraries -->
  <property name="seam.ui.lib" value="yes"/>
  <property name="tomcat.standard.tag" value="yes"/>

  <import file="../build.xml"/>

  <target name="copyextradependencies">
    <copyInlineDependencies id="jstl" scope="runtime" todir="${lib.dir}">
      <dependency groupId="apache-taglibs" artifactId="jstl" version="1.1.2"/>
    </copyInlineDependencies>
  </target>

  <target name="war" depends="SeamExample.war">
    <!--make sure enunciate.home is set.-->
    <fail unless="enunciate.home">
      enunciate.home not set, update build.properties
    </fail>

    <!--define the enunciate classpath-->
    <path id="enunciate.classpath">
      <fileset dir="${enunciate.home}/lib">
        <include name="*.jar"/>
      </fileset>
      <fileset dir="${enunciate.home}">
        <include name="enunciate-full-*.jar"/>
      </fileset>
      <fileset dir="${java.home}">
        <include name="lib/tools.jar"/>
      </fileset>
      <path refid="build.classpath"/>
    </path>

    <!--define the enunciate task-->
    <taskdef name="enunciate" classname="org.codehaus.enunciate.main.EnunciateTask">
      <classpath refid="enunciate.classpath"/>
    </taskdef>

    <!--enunciate the api-->
    <enunciate basedir="src" configFile="enunciate.xml">
      <include name="**/*.java"/>
      <classpath refid="enunciate.classpath"/>
      <export artifactId="spring.app.dir" destination="${war.dir}"/>
    </enunciate>

  </target>

  <target name="ear" depends="SeamExample.ear">
    <!--copy the enunciate dependencies to the ear-->
    <copy todir="${ear.dir}/lib">
      <fileset dir="${enunciate.home}/lib">
        <include name="*.jar"/>

        <!--exclude annotations.jar since jboss ships with its
        own jar containing the jsr250 annoations-->
        <exclude name="annotations*.jar"/>

        <!--exclude servlet.jar; provided by jboss-->
        <exclude name="servlet*.jar"/>

        <!--exclude stax; it ships with the JDK-->
        <exclude name="stax*.jar"/>
      </fileset>
      <fileset dir="${enunciate.home}">
        <include name="enunciate-full-*.jar"/>
      </fileset>
    </copy>

  </target>
</project>

