<?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">
    <goal name="head">
        <echo message="**************************************************"/>
        <echo message="*   A I M L U C K  E I P   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" />
        <echo message="                                                  "/>
        <echo message=" build                                            "/>
        <echo message="     aipo を構築します。                    "/>
        <echo message=" build:full                                       "/>
        <echo message="     aipo を完全構築します。                "/>
        <echo message=" deploy                                           "/>
        <echo message="    aipo をデプロイします。                 "/>
        <echo message="                                                  "/>
    </goal>
    <goal name="jetspeed-dec">
        <mkdir dir="${project.workspace.dir}"/>
        <untar
            src="${project.jetspeed.dir}/${project.jetspeed.name}-src.tar.gz"
            compression="gzip" dest="${project.workspace.dir}" />
        <mkdir dir="${project.aipo.dir}"/>
        <move todir="${project.aipo.dir}" >
            <fileset dir="${project.workspace.dir}/${project.jetspeed.name}" >
                <include name="**/*"/>
            </fileset>
        </move>
        <delete dir="${project.aipo.dir}/webapp/images" />
    </goal>
    <goal name="merge">
        <copy todir="${project.aipo.dir}">
            <fileset dir="core" >
                <include name="**/*"/>
            </fileset>
        </copy>
    </goal>
    <goal name="filter">
        <!-- C O R E -->
        <delete 
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/services/security/turbine/TurbineAuthentication..java" 
            />
        <delete 
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/services/security/turbine/TurbineGroupManagement.java" 
            />
        <delete 
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/services/security/turbine/TurbineRoleManagement.java" 
            />
        <delete 
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/services/security/turbine/TurbineUserManagement.java" 
            />                        
        <!-- T O R Q U E  S C H E M A -->
        <delete
            file="${project.aipo.dir}/src/torque-schema/coffees-schema.xml"
            />
        <delete file="${project.aipo.dir}/src/torque-schema/email.xml" />
        <delete
            file="${project.aipo.dir}/src/torque-schema/email-schema.xml"
            />
        <!--
        <delete
            file="${project.aipo.dir}/src/torque-schema/dbpsml-schema.xml"
            />
        <delete
            file="${project.aipo.dir}/src/torque-schema/registry-schema.xml"
            />
        -->
        <!-- O B J E C T  M O D E L -->
        <delete
            dir="${project.aipo.dir}/src/java/org/apache/jetspeed/om/apps"
            />
        <delete
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/om/security/Group.java"
            />
        <delete
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/om/security/GroupRole.java"
            />
        <delete
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/om/security/Permission.java"
            />
        <delete
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/om/security/Role.java"
            />
        <!--
        <delete
            dir="${project.aipo.dir}/src/java/org/apache/jetspeed/om/dbpsml"
            />
        <delete
            dir="${project.aipo.dir}/src/java/org/apache/jetspeed/om/dbregistry"
            />
        -->
        <delete file="${project.aipo.dir}/webapp/WEB-INF/conf/portlets.xreg"
            />
        <!-- E M A I L -->
        <delete
            dir="${project.aipo.dir}/src/java/org/apache/jetspeed/modules/actions/portlets/email"
            />
        <delete file="${project.aipo.dir}/webapp/WEB-INF/conf/email.xreg"
            />
        <!-- D E M O -->
        <delete
            file="${project.aipo.dir}/webapp/WEB-INF/conf/demo-portlets.xreg"
            />
        <delete
            file="${project.aipo.dir}/webapp/WEB-INF/conf/rssja-portlets.xreg"
            />
        <delete
            file="${project.aipo.dir}/webapp/WEB-INF/conf/wml-examples.xreg"
            />
        <delete
            file="${project.aipo.dir}/webapp/WEB-INF/conf/feed_apache.xreg"
            />
        <delete
            file="${project.aipo.dir}/webapp/WEB-INF/conf/feed_local.xreg"
            />
        <delete
            file="${project.aipo.dir}/src/java/org/apache/jetspeed/modules/actions/portlets/HelloAction.java"
            />
        <!-- P S M L -->
        <delete dir="${project.aipo.dir}/webapp/WEB-INF/psml/user" />
        <delete dir="${project.aipo.dir}/webapp/WEB-INF/psml/group" />
        <delete dir="${project.aipo.dir}/webapp/WEB-INF/psml/test" />
        <delete dir="${project.aipo.dir}/webapp/WEB-INF/psml/role" />
        <!-- W E B A P P -->
        <delete file="${project.aipo.dir}/webapp/LoggedInWelcome.html" />
        <delete file="${project.aipo.dir}/webapp/welcome.html" />
        <delete file="${project.aipo.dir}/webapp/welcome.html.orig" />
        <delete dir="${project.aipo.dir}/webapp/about" />
        <delete dir="${project.aipo.dir}/webapp/apidocs" />
        <delete dir="${project.aipo.dir}/webapp/css" />
        <delete dir="${project.aipo.dir}/webapp/examples" />
        <delete dir="${project.aipo.dir}/webapp/javascript" />
        <delete dir="${project.aipo.dir}/webapp/jcm" />
        <delete dir="${project.aipo.dir}/webapp/log" />
        <delete dir="${project.aipo.dir}/webapp/ocs" />
        <delete dir="${project.aipo.dir}/webapp/rss" />
        <delete dir="${project.aipo.dir}/webapp/search" />
        <delete dir="${project.aipo.dir}/webapp/wml" />
        <delete dir="${project.aipo.dir}/webapp/xml" />
        <delete>
            <fileset dir="${project.aipo.dir}/webapp/WEB-INF/cache"
                includes="*" />
        </delete>
        <delete dir="${project.aipo.dir}/webapp/WEB-INF/db" />
        <delete dir="${project.aipo.dir}/webapp/WEB-INF/log" />
    </goal>
    <goal name="build">
        <attainGoal name="head" />
        <attainGoal name="filter" />
        <attainGoal name="merge" />
        <m:reactor basedir="${project.aipo.dir}" includes="project.xml"
            goals="war" banner="Build" ignoreFailures="false" />
    </goal>
    <goal name="build:commons">
        <attainGoal name="head" />
        <m:reactor basedir="${project.commons.dir}" includes="*/project.xml"
            goals="jar" banner="Build" ignoreFailures="false" />
    </goal>
    <goal name="build:lib">
        <attainGoal name="head" />
        <m:reactor basedir="${project.lib.dir}" includes="*/project.xml"
            goals="jar" banner="Build" ignoreFailures="false" />
    </goal>
    <goal name="build:oms">
        <attainGoal name="head" />
        <m:reactor basedir="${project.oms.dir}" includes="*/project.xml"
            goals="jar" banner="Build" ignoreFailures="false" />
    </goal>
    <goal name="build:full">
        <attainGoal name="head" />
        <attainGoal name="clean" />
        <m:reactor basedir="${project.commons.dir}" includes="*/project.xml"
            goals="jar" banner="Build" ignoreFailures="false" />
        <m:reactor basedir="${project.oms.dir}" includes="*/project.xml"
            goals="jar" banner="Build" ignoreFailures="false" />
        <attainGoal name="jetspeed-dec" />
        <attainGoal name="filter" />
        <attainGoal name="merge" />
        <m:reactor basedir="${project.aipo.dir}" includes="project.xml"
            goals="war" banner="Build" ignoreFailures="false" />
    </goal>
    <goal name="deploy">
        <m:reactor basedir="${project.aipo.dir}" includes="project.xml"
            goals="deploy" banner="Deploy" ignoreFailures="false" />
    </goal>
    <goal name="hotdeploy">
        <copy todir="${maven.war.appserver.home}/webapps/aipo">
            <fileset dir="./core/webapp" />
        </copy>
    </goal>
    <goal name="clean:aipo">
        <m:reactor basedir="${project.aipo.dir}" includes="project.xml"
            goals="clean" banner="Clean" ignoreFailures="false" />
    </goal>
    <goal name="clean:all">
        <m:reactor basedir="${project.portlets.dir}" includes="*/project.xml"
            goals="clean:all" banner="Clean" ignoreFailures="false" />
        <m:reactor basedir="${project.commons.dir}" includes="*/project.xml"
            goals="clean" banner="Clean" ignoreFailures="false" />
        <m:reactor basedir="${project.lib.dir}" includes="*/project.xml"
            goals="clean" banner="Clean" ignoreFailures="false" />
        <m:reactor basedir="${project.oms.dir}" includes="*/project.xml"
            goals="clean" banner="Clean" ignoreFailures="false" />
        <attainGoal name="clean" />
    </goal>
    
    <goal name="build:source">
        <attainGoal name="head" />
        <mkdir dir="./target"/>
        <delete dir="./target/aipo_src"/>
        <mkdir dir="./target/aipo_src"/>
        <copy todir="./target/aipo_src">
            <fileset dir="./">
               <include name="**/*"/>
               <exclude name=".svn"/>
               <exclude name=".target"/>
            </fileset>
        </copy>
    </goal>
	
    <goal name="build:asp_source">
        <attainGoal name="head" />
        <mkdir dir="./target"/>
        <delete dir="./target/aipo_src"/>
        <mkdir dir="./target/aipo_src"/>
        <copy todir="./target/aipo_src">
            <fileset dir="./">
               <include name="**/*"/>
               <exclude name=".svn"/>
               <exclude name=".target"/>
            </fileset>
        </copy>
    	
    	<delete file="./target/aipo_src/core/src/java/com/aimluck/eip/services/security/ALEipAuthentication.java"/>
    	<delete file="./target/aipo_src/core/webapp/WEB-INF/conf/JetspeedJResources.properties"/>
    	<delete file="./target/aipo_src/core/webapp/WEB-INF/conf/JetspeedResources.properties"/>
    	<delete file="./target/aipo_src/oms/cayenne/webapp/WEB-INF/cayenne.xml"/>
    	<delete file="./target/aipo_src/portlets/license/webapp/WEB-INF/conf/license.xreg"/>
    	<delete file="./target/aipo_src/portlets/deletesample/webapp/WEB-INF/conf/delete_sample.xreg"/>
    	<delete file="./target/aipo_src/portlets/news/webapp/WEB-INF/conf/news.xreg"/>
    	<delete dir="./target/aipo_src/portlets/system"/>
    	<delete dir="./target/aipo_src/portlets/cellular"/>
    	
    	
        <copy todir="./target/aipo_src">
            <fileset dir="../aipo_asp">
               <include name="**/*"/>
               <exclude name=".svn"/>
               <exclude name=".target"/>
            </fileset>
        </copy>
    </goal>
    
</project>