<?xml version="1.0" encoding="UTF-8"?>
<project name="analytics-apim-capps" default="zip" basedir=".">

    <property name="project-name" value="${ant.project.name}"/>
    <property name="res-dir" value="src/main/resources"/>
    <property name="target-dir" value="target"/>

    <property name="ANALYTICS_APIM_dir" value="src/main/capp"/>
    <property name="ANALYTICS_APIM_capp_name" value="org_wso2_carbon_analytics_apim"/>
    <property name="ANALYTICS_APIM_capp_version" value="1.0.0"/>
    <property name="EVENT_RECEIVER_dir" value="Eventreceivers" />
    <property name="EVENT_PUBLISHER_dir" value="Eventpublishers" />
    <property name="EVENT_STORE_dir" value="Eventstores" />
    <property name="EVENT_STREAM_dir" value="Eventstreams" />
    <property name="RESOURCE_dir" value="Resources" />
    <property name="SPARK_SCRIPT_dir" value="Sparkscripts" />
    <property name="DATA_PURGING_dir" value="Datapurging" />

    <!--<property name="ANALYTICS_APIM_RDBMS_capp_suffix" value="RDBMS"/>-->
    <!--<property name="ANALYTICS_APIM_REST_capp_suffix" value="REST"/>-->
    <!--<property name="ANALYTICS_APIM_RDBMS_directory" value="rdbms"/>-->
    <!--<property name="ANALYTICS_APIM_REST_directory" value="rest"/>-->

    <property name="resources_definition_dir" value="resources" />

    <target name="clean">
        <delete dir="${target-dir}"/>
        <!--<delete file="${res-dir}/${ANALYTICS_APIM_capp_name}_${ANALYTICS_APIM_REST_capp_suffix}-${ANALYTICS_APIM_capp_version}.car"/>-->
        <!--<delete file="${res-dir}/${ANALYTICS_APIM_capp_name}_${ANALYTICS_APIM_RDBMS_capp_suffix}-${ANALYTICS_APIM_capp_version}.car"/>-->
        <delete file="${res-dir}/${ANALYTICS_APIM_capp_name}-${ANALYTICS_APIM_capp_version}.car"/>
    </target>

    <target name="pre-configure">
        <mkdir dir="${target-dir}"/>
    </target>

    <target name="zip" depends="clean,pre-configure">
        <!--<zip destfile="${res-dir}/${ANALYTICS_APIM_capp_name}_${ANALYTICS_APIM_REST_capp_suffix}-${ANALYTICS_APIM_capp_version}.car">-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_RECEIVER_dir}" />-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_STORE_dir}" />-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_STREAM_dir}" />-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_PUBLISHER_dir}" />-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${RESOURCE_dir}" />-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${SPARK_SCRIPT_dir}"-->
                        <!--excludes="**/${ANALYTICS_APIM_RDBMS_directory}/**, **/${ANALYTICS_APIM_REST_directory}/**"/>-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${SPARK_SCRIPT_dir}/${ANALYTICS_APIM_REST_directory}"/>-->
            <!--<zipfileset dir="${ANALYTICS_APIM_dir}/${DATA_PURGING_dir}" />-->
            <!--<zipfileset file="${ANALYTICS_APIM_dir}/artifacts.xml"/>-->
        <!--</zip>-->
        <zip destfile="${res-dir}/${ANALYTICS_APIM_capp_name}-${ANALYTICS_APIM_capp_version}.car">
            <zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_RECEIVER_dir}" />
            <zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_STORE_dir}" />
            <zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_STREAM_dir}" />
            <zipfileset dir="${ANALYTICS_APIM_dir}/${EVENT_PUBLISHER_dir}" />
            <zipfileset dir="${ANALYTICS_APIM_dir}/${RESOURCE_dir}" />
            <zipfileset dir="${ANALYTICS_APIM_dir}/${SPARK_SCRIPT_dir}"/>
            <zipfileset dir="${ANALYTICS_APIM_dir}/${DATA_PURGING_dir}" />
            <zipfileset file="${ANALYTICS_APIM_dir}/artifacts.xml"/>
        </zip>
    </target>

</project>

