<?xml version="1.0"?>

<!-- ===================================================================
     Create war ready for jboss (j2ee) deployment
     =================================================================== -->

<project name="app.deploy" default="deploy" >
  <target name="init" >
    <dirname property="this.dir" file="${ant.file}"/>

    <property name="app.resources.dir"
              location="${this.dir}/../webconfig/resources" />
  </target>

  <!-- =================================================================
       The "deploy" target first builds a configured component then copies
       all required files to the appropriate servlet container directories.

       Currently this only works for the quickstart distribution.
       For example, it does not handle deploying into jboss and copying
       resource files (images, stylesheets) to external locations.
       ================================================================= -->

  <target name="deploy" depends="init,build.configured" >
    <echo message="***************************************************************" />
    <echo message="Readying app ${propval.app.war.name}.war for jboss deployment" />
    <echo message="***************************************************************" />
    <if>
      <not>
        <isset property="org.bedework.global.noskins" />
      </not>
      <then>
        <delete dir="${org.bedework.appserver.dir}/${propval.app.resources.dir}" />
        <copy todir="${org.bedework.appserver.dir}/${propval.app.resources.dir}">
          <fileset dir="${this.dir}/../webapp/resources" />
        </copy>
      </then>
    </if>
  </target>

  <target name="build.configured" >
    <!-- Do nothing for jboss -->
  </target>
</project>
