<project name="demos" default="test" basedir=".">
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
  <description>
  This is the build file for the LPS demos subproject.
  </description>

  <!-- Ignore the system classpath -->
  <property name="build.sysclasspath" value="ignore" />

  <property environment="env"/>

  <property name="LPS_HOME" value="${env.LPS_HOME}"/>
  <property file="${LPS_HOME}/build.properties"/>

  <!--================  Target [init] ==============-->
  <target name="init" >
    <fail message="LPS_HOME not set" unless="env.LPS_HOME"/>
  </target>

  <!--================  Target [build] ==============-->
  <target name="build"  />

  <!--================  Target [test] ==============-->
  <target name="test" 
      description="Make sure all demos compile"
      depends="init" >
      <echo message="running demos test" />
      <apply executable="bash" parallel="false" failonerror="true">
          <arg line="${LPS_HOME}/WEB-INF/lps/server/bin/lzc -dir build" />
          <fileset dir="." >
              <include name="weather/weather.lzx"/>
              <include name="calendar/calendar.lzx"/>
              <include name="lzpix/app.lzx"/>
              <include name="vacation-survey/vacation-survey.lzx"/>              
          </fileset>
      </apply>
  </target>

  <!--================  Target [clean] ==============-->
  <target name="clean"  >
      <delete>
          <fileset dir="." defaultexcludes="no" >
              <include name="**/*~"/>
              <include name="build/**" />
          </fileset>
      </delete>
  </target>

  <!--================  Target [doc] ==============-->
  <target name="doc"  />

  <!--================  Target [all]  ===================-->
  <target name="all" 
      description="Clean, build, doc, test"
      depends="clean, build, doc, test">
  </target>

</project>
