<?xml version="1.0" encoding="UTF-8" ?>
<project name="maven-antrun-" default="main"  >
<target name="main">
  <echo message="*** Creating testing repositories for synapse samples"/>
  <mkdir dir="target/test_repos"/>
  <mkdir dir="target/test_repos/axis2Server"/>
  <mkdir dir="target/test_repos/axis2Client"/>
  <mkdir dir="target/test_repos/synapse"/>
  <mkdir dir="target/test_repos/synapse"/>
  <mkdir dir="target/test_repos/synapse/modules"/>
  <mkdir dir="target/test_repos/synapse/conf"/>
  <mkdir dir="target/test_repos/axis2Server/services"/>
  <mkdir dir="target/test_repos/axis2Server/modules"/>
  <mkdir dir="target/test_repos/axis2Server/conf"/>
  <mkdir dir="target/test_repos/axis2Client/modules"/>
  <mkdir dir="target/test_repos/axis2Client/conf"/>
  <copy todir="target/test_repos/axis2Server/conf/">
    <fileset dir="src/test/resources/axis2Xml/axis2Server">
      <include name="*.xml"/>
    </fileset>
  </copy>
  <copy todir="target/test_repos/synapse/conf/">
    <fileset dir="src/test/resources/axis2Xml/synapse">
      <include name="*.xml"/>
    </fileset>
  </copy>
  <copy todir="target/test_repos/axis2Client/conf/">
    <fileset dir="src/test/resources/axis2Xml/axis2Client">
      <include name="*.xml"/>
    </fileset>
  </copy>
  <property name="temp.dir" value="target/temp"/>
  <property name="classes" value="${temp.dir}/classes"/>
  <property name="services" value="target/test_repos/axis2Server/services"/>
  <property name="src" value="../samples/services/SimpleStockQuoteService/src"/>
  <mkdir dir="${temp.dir}"/>
  <mkdir dir="${classes}"/>
  <javac fork="true" includeantruntime="false" debug="on" destdir="${classes}" source="1.8" target="1.8">
    <src path="${src}"/>
    <classpath refid="maven.compile.classpath"/>
  </javac>
  <property name="SSQ.dir" value="${temp.dir}/SimpleStockQuote"/>
  <mkdir dir="${SSQ.dir}"/>
  <mkdir dir="${SSQ.dir}/META-INF"/>
  <copy file="${src}/../conf/services.xml" tofile="${SSQ.dir}/META-INF/services.xml"/>
  <copy toDir="${SSQ.dir}">
    <fileset dir="${classes}">
      <include name="**/*.class"/>
    </fileset>
  </copy>
  <jar destfile="${services}/SimpleStockQuoteService.aar">
    <fileset dir="${SSQ.dir}"/>
  </jar>
  <property name="src2" value="../samples/services/SecureStockQuoteService/src"/>
  <delete dir="${temp.dir}"/>
  <mkdir dir="${temp.dir}"/>
  <mkdir dir="${classes}"/>
  <javac fork="true" includeantruntime="false" debug="on" destdir="${classes}" source="1.8" target="1.8">
    <src path="${src2}"/>
    <classpath refid="maven.compile.classpath"/>
  </javac>
  <property name="SSQ2.dir" value="${temp.dir}/SecureStockQuoteService"/>
  <mkdir dir="${SSQ2.dir}"/>
  <mkdir dir="${SSQ2.dir}/META-INF"/>
  <copy file="${src2}/../conf/services.xml" tofile="${SSQ2.dir}/META-INF/services.xml"/>
  <copy file="${src2}/../store.jks" tofile="${SSQ2.dir}/store.jks"/>
  <copy toDir="${SSQ2.dir}">
    <fileset dir="${classes}">
      <include name="**/*.class"/>
    </fileset>
  </copy>
  <jar destfile="${services}/SecureStockQuoteService.aar">
    <fileset dir="${SSQ2.dir}"/>
  </jar>
  <property name="src3" value="../samples/services/MTOMSwASampleService/src"/>
  <delete dir="${temp.dir}"/>
  <mkdir dir="${temp.dir}"/>
  <mkdir dir="${classes}"/>
  <javac fork="true" includeantruntime="false" debug="on" destdir="${classes}" source="1.8" target="1.8">
    <src path="${src3}"/>
    <classpath refid="maven.compile.classpath"/>
  </javac>
  <property name="SSQ3.dir" value="${temp.dir}/MTOMSwASampleService"/>
  <mkdir dir="${SSQ3.dir}"/>
  <mkdir dir="${SSQ3.dir}/META-INF"/>
  <copy file="${src3}/../conf/services.xml" tofile="${SSQ3.dir}/META-INF/services.xml"/>
  <copy toDir="${SSQ3.dir}">
    <fileset dir="${classes}">
      <include name="**/*.class"/>
    </fileset>
  </copy>
  <jar destfile="${services}/MTOMSwASampleService.aar">
    <fileset dir="${SSQ3.dir}"/>
  </jar>
  <property name="src5" value="../samples/services/LoadbalanceFailoverService/src"/>
  <delete dir="${temp.dir}"/>
  <mkdir dir="${temp.dir}"/>
  <mkdir dir="${classes}"/>
  <javac fork="true" includeantruntime="false" debug="on" destdir="${classes}" source="1.8" target="1.8">
    <src path="${src5}"/>
    <classpath refid="maven.compile.classpath"/>
  </javac>
  <property name="LBFA1.dir" value="${temp.dir}/LBService1"/>
  <mkdir dir="${LBFA1.dir}"/>
  <mkdir dir="${LBFA1.dir}/META-INF"/>
  <copy file="${src5}/../conf/service1/services.xml" tofile="${LBFA1.dir}/META-INF/services.xml"/>
  <copy toDir="${LBFA1.dir}">
    <fileset dir="${classes}">
      <include name="**/LBService1.class"/>
    </fileset>
  </copy>
  <jar destfile="${services}/LBService1.aar">
    <fileset dir="${LBFA1.dir}"/>
  </jar>
  <property name="LBFA2.dir" value="${temp.dir}/LBService2"/>
  <mkdir dir="${LBFA2.dir}"/>
  <mkdir dir="${LBFA2.dir}/META-INF"/>
  <copy file="${src5}/../conf/service2/services.xml" tofile="${LBFA2.dir}/META-INF/services.xml"/>
  <copy toDir="${LBFA2.dir}">
    <fileset dir="${classes}">
      <include name="**/LBService2.class"/>
    </fileset>
  </copy>
  <jar destfile="${services}/LBService2.aar">
    <fileset dir="${LBFA2.dir}"/>
  </jar>
</target>
</project>