<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<project default="demo" basedir="../..">

<!-- Set Properties -->
  <!-- User settings -->
  <property file="${user.home}/ant.properties"/>
  <!-- Set property lib dir -->
  <property name="properties.dir" value="${ant.home}/properties"/>
  <!-- Significant dirs -->
  <property file="${properties.dir}/dirs.properties"/>
  <!-- Compiler settings -->
  <property file="${properties.dir}/${build.compiler}.properties"/>
  <!-- Compile-time classpath properties files -->
  <property file="${properties.dir}/extrapath.properties"/>
  <property file="${properties.dir}/compilepath.properties"/>

<!-- Targets -->
  <target name="demo" depends="compile,checktoursdb,toursdb"/>

  <target name="compile">
    <javac
      source="${min.version}"
      target="${min.version}"
      nowarn="on"
      debug="${debug}" debuglevel="${debuglevel}"
      depend="${depend}"
      deprecation="${deprecation}"
      optimize="${optimize}"
      proceed="${proceed}"
      verbose="${verbose}"
      destdir="${out.demo.dir}"
      srcdir="${derby.demo.src.dir}"
      includes="nserverdemo/**">
      <compilerarg value="-Xlint:unchecked"/>
      <compilerarg value="-Xlint:deprecation"/>
      <classpath>
		    <pathelement location="${out.shared.dir}"/>
		    <pathelement location="${out.drda.dir}"/>
		    <pathelement location="${out.engine.dir}"/>
		    <pathelement location="${out.tools.dir}"/>
      </classpath>
    </javac>
    <javac
      source="${min.version}"
      target="${min.version}"
      nowarn="on"
      debug="${debug}" debuglevel="${debuglevel}"
      depend="${depend}"
      deprecation="${deprecation}"
      optimize="${optimize}"
      proceed="${proceed}"
      verbose="${verbose}"
      destdir="${out.demo.dir}"
      srcdir="${derby.demo.src.dir}/vtis/java"
     >
      <compilerarg value="-Xlint:unchecked"/>
      <compilerarg value="-Xlint:deprecation"/>
      <classpath>
		    <pathelement location="${out.shared.dir}"/>
		    <pathelement location="${out.drda.dir}"/>
		    <pathelement location="${out.engine.dir}"/>
		    <pathelement location="${out.tools.dir}"/>
      </classpath>
    </javac>
    <!-- "simple" demos under java/demo/ (SimpleApp) -->
    <javac
      source="${min.version}"
      target="${min.version}"
      nowarn="on"
      debug="${debug}" debuglevel="${debuglevel}"
      depend="${depend}"
      deprecation="${deprecation}"
      optimize="${optimize}"
      proceed="${proceed}"
      verbose="${verbose}"
      srcdir="${derby.demo.src.dir}/simple"
      destdir="${out.demo.dir}">
      <compilerarg value="-Xlint:unchecked"/>
      <compilerarg value="-Xlint:deprecation"/>
      <classpath>
		    <pathelement location="${out.shared.dir}"/>
		    <pathelement location="${out.drda.dir}"/>
		    <pathelement location="${out.engine.dir}"/>
		    <pathelement location="${out.tools.dir}"/>
        <pathelement location="${javasrc.dir}"/>
      </classpath>
    </javac>
    <javac
      source="${min.version}"
      target="${min.version}"
      nowarn="on"
      debug="${debug}" debuglevel="${debuglevel}"
      depend="${depend}"
      deprecation="${deprecation}"
      optimize="${optimize}"
      proceed="${proceed}"
      verbose="${verbose}"
      srcdir="${derby.demo.src.dir}/workingwithderby"
      destdir="${out.demo.dir}">
      <classpath>
        <pathelement location="${javasrc.dir}"/>
      </classpath>
      <compilerarg value="-Xlint:unchecked"/>
      <compilerarg value="-Xlint:deprecation"/>
    </javac>
    <ant target="compile" dir="toursdb"/>
  </target>

  <target name="checktoursdb">
    <condition property="toursdb.available">
      <and>
        <available file="${generated.toursdb.dir}/toursdb.jar"/>
        <available file="${generated.toursdb.dir}/toursdb"/>
      </and>
    </condition>
  </target>

  <target name="toursdb" unless="toursdb.available">
    <ant dir="${derby.demo.src.dir}/toursdb"/>
  </target>

  <target name="compile-vtidemo">
    <javac
      source="${min.version}"
      target="${min.version}"
      nowarn="on"
      debug="${debug}" debuglevel="${debuglevel}"
      depend="${depend}"
      deprecation="${deprecation}"
      optimize="${optimize}"
      proceed="${proceed}"
      verbose="${verbose}"
      srcdir="${derby.demo.src.dir}/vtis/java"
      destdir="${out.demo.dir}">
      <compilerarg value="-Xlint:unchecked"/>
      <compilerarg value="-Xlint:deprecation"/>
      <classpath>
		    <pathelement location="${out.shared.dir}"/>
		    <pathelement location="${out.engine.dir}"/>
      </classpath>
    </javac>
  </target>


</project>

