<project name="oauth" default="sample.oauth.build" basedir=".">
  <!-- Path containing core.xml -->
  <dirname property="build_dir" file="${ant.file.oauth}"/>
  <import file="${build_dir}/core.xml"/>
  <import file="${build_dir}/blogger.xml"/>
  <import file="${build_dir}/calendar.xml"/>
  <import file="${build_dir}/contacts.xml"/>
  <import file="${build_dir}/photos.xml"/>

  <!--  ===================================================================== -->
  <!--                 Build GData Oauth samples.                           -->
  <!--  ===================================================================== -->

  <!-- build Properties -->
  <property name="sample.oauth.basedir"       value="${build}/sample/oauth"/>
  <property name="sample.oauth.src.home"      value="${sample.oauth.basedir}"/>
  <property name="sample.oauth.build.classes" value="${sample.oauth.basedir}/classes"/>
  <property name="sample.oauth.build.lib"     value="${sample.oauth.basedir}/lib"/>
  <property name="sample.oauth.jar"           value="${sample.oauth.build.lib}/OAuthExample.jar"/>
  <property name="sample.oauth.main"          value="sample.oauth.OAuthExample"/>

  <path id="sample.oauth.compile.classpath">
     <path refid="build.service.core.classpath"/>
     <path location="${gdata-blogger.jar}"/>
     <path location="${gdata-contacts.jar}"/>
     <path location="${gdata-finance.jar}"/>
     <path location="${gdata-photos.jar}"/>
     <path location="${activation.jar}"/>
     <path location="${mail.jar}"/>
  </path>

  <target name="sample.oauth.build" depends="sample.core.dependencies">
    <mkdir dir="${sample.oauth.build.lib}"/>
    <mkdir dir="${sample.oauth.build.classes}"/>
    <javac srcdir="${sample.oauth.src.home}"
           destdir="${sample.oauth.build.classes}"
           debug="${javac.debug}" debuglevel="${javac.debuglevel}"
           deprecation="false"
           optimize="true">
        <classpath refid="sample.oauth.compile.classpath"/>
    </javac>
    <jar jarfile="${sample.oauth.jar}"
         basedir="${sample.oauth.build.classes}">
      <manifest>
        <attribute name="Main-Class" value="${sample.oauth.main}"/>
      </manifest>
    </jar>
  </target>

  <target name="sample.oauth.clean"
   description="Delete old build and dist directories">
    <delete dir="${sample.oauth.build.classes}"/>
  </target>

  <target name="sample.oauth.run" depends="sample.oauth.build">
    <java fork="true" classname="${sample.oauth.main}">
      <classpath>
        <path refid="sample.oauth.compile.classpath"/>
        <path location="${sample.oauth.jar}"/>
      </classpath>
    </java>
  </target>

</project>
