<?xml version="1.0" encoding="UTF-8"?>
<!--
Aipo is a groupware program developed by Aimluck,Inc.
Copyright (C) 2004-2008 Aimluck,Inc.
http://aipostyle.com/

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<project xmlns:m="jelly:maven" xmlns:j="jelly:core" default="help">
    <property file="./portlet.properties"/>
    <property file="../../local-project.properties"/>
    <property file="../../common-project.properties"/>
    <property name="project.aipo.webapp.dir"
        value="${basedir}/../../target/aipo/target/aipo" />
    <goal name="head">
        <echo message="**************************************************"/>
        <echo message="*       P O R T L E T   B U I L D  T O O L       *"/>
        <echo message="*          Copyright (C) 2004-2008 Aimluck,Inc.  *"/>
        <echo message="**************************************************"/>
    </goal>
    <goal name="help">
        <attainGoal name="head" />
    </goal>
    <goal name="build:full">
        <attainGoal name="head" />
        <attainGoal name="clean:all" />
        <!--<attainGoal name="torque" />-->
        <attainGoal name="jar" />
    </goal>
    <goal name="build">
        <attainGoal name="head" />
        <attainGoal name="clean" />
        <attainGoal name="jar" />
    </goal>
    <goal name="clean:all">
        <attainGoal name="clean" />
        <attainGoal name="clean:om" />
        <attainGoal name="clean:sql" />
    </goal>
    <goal name="clean:om" >
        <delete quiet="true">
            <fileset dir="${maven.src.dir}/java">
                <include name="**.generation"/>
            </fileset>
            <fileset
                dir="${maven.src.dir}/java/com/aimluck/eip/${pom.artifactId}/om">
                <include name="Base**.java"/>
            </fileset>
            <fileset
                dir="${maven.src.dir}/java/com/aimluck/eip/${pom.artifactId}/om/map">
                <include name="**.java"/>
            </fileset>
        </delete>
    </goal>
    <goal name="clean:sql" >
        <delete quiet="true">
            <fileset dir="${maven.src.dir}/sql">
                <include name="**.sql"/>
                <include name="**.generation"/>
                <include name="**.map"/>
            </fileset>
        </delete>
    </goal>
    <goal name="merge">
        <j:if test="${project.aipo.merge}">
            <attainGoal name="build:full" />
            <copy todir="${project.aipo.webapp.dir}">
                <fileset dir="./webapp" />
            </copy>
            <copy todir="${project.aipo.webapp.dir}/WEB-INF/lib">
                <fileset dir="./target">
                    <include name="*.jar" />
                </fileset>
            </copy>
        </j:if>
    </goal>
    <goal name="hotdeploy">
        <copy todir="${maven.war.appserver.home}/webapps/aipo">
            <fileset dir="./webapp" />
        </copy>
        <copy
            todir="${maven.war.appserver.home}/webapps/aipo/WEB-INF/lib">
            <fileset dir="./target">
                <include name="*.jar" />
            </fileset>
        </copy>
    </goal>
    <postGoal name="jar">
        <attainGoal name="jar:install" />
    </postGoal>
</project>