<!--
// $Id: //open/util/resgen/example/build.xml#5 $
// package org.eigenbase.resgen is an i18n resource generator
// Copyright (C) 2005-2005 The Eigenbase Project
// Copyright (C) 2005-2005 Disruptive Tech
// Copyright (C) 2005-2005 Red Square, Inc.
// Portions Copyright (C) 2002-2005 Kana Software, Inc. and others.
// All Rights Reserved.
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
//
// Build file for ResGen example.
  -->
<project name="Birthday" default="compile">

  <path id="project.classpath">
    <pathelement location="../lib/eigenbase-xom.jar"/>
    <pathelement location="../lib/eigenbase-resgen.jar"/>
    <pathelement location="classes"/>
  </path>

  <path id="jartest.classpath">
    <pathelement location="../lib/eigenbase-xom.jar"/>
    <pathelement location="../lib/eigenbase-resgen.jar"/>
    <pathelement location="jartest"/>
  </path>

  <!-- Use -Dcommentstyle=scm-safe to try out alternate comment style. -->
  <property name="commentstyle" value="normal"/>

  <taskdef name="resgen" classname="org.eigenbase.resgen.ResourceGenTask">
    <classpath refid="project.classpath"/>
  </taskdef>

  <target name="generate.resources">
    <resgen 
        srcdir="source" 
        resdir="classes" 
        locales="en_US,fr_FR"
        commentstyle="${commentstyle}">
      <include name="happy/BirthdayResource.xml"/>
      <include name="happy/BirthdayResource_fr_FR.properties"/>
    </resgen>
  </target>

  <target name="compile" depends="generate.resources">
    <mkdir dir="classes"/>
    <javac srcdir="source" destdir="classes">
      <classpath refid="project.classpath"/>
      <include name="**/*.java"/>
    </javac>
    <copy todir="classes">
      <fileset dir="source" includes="**/*.properties"/>
    </copy>
  </target>

  <target name="clean">
    <delete includeEmptyDirs="true" quiet="true">
      <fileset dir="classes"/>
      <fileset dir="jartest"/>
      <fileset dir="source" includes="
happy/BirthdayResource.java,
happy/BirthdayResource_en_US.java,
happy/BirthdayResource_fr_FR.java,
happy/BirthdayResource_en_US.properties"/>
    </delete>
  </target>

  <target name="test">
    <java classpathref="project.classpath" classname="Birthday"/>
    <mkdir dir="jartest"/>
    <copy todir="jartest">
      <fileset dir="classes" includes="JarTest.class"/>
    </copy>
    <jar jarfile="jartest/test.jar">
      <fileset dir="classes">
        <include name="**/*" />
        <exclude name="JarTest.class" />
      </fileset>
    </jar>
    <java classpathref="jartest.classpath" classname="JarTest" fork="true">
      <arg value="file:jartest/test.jar"/>
    </java>
  </target>
</project>
