@echo off
setlocal

rem ---------------------------------------------------------------------
rem Windows script to compile the Data Types examples.
rem This script produces two jar files:  ComplexValue.jar and DatahandlerURL.jar
rem ---------------------------------------------------------------------

rem ---------------------------------------------------------------------
rem *** IMPORTANT *** 
rem The Java compiler must be of correct version. Please refer
rem "Application Development - Environment Setup" section of the 
rem Development Guide, to know the required Java compiler version.
rem ---------------------------------------------------------------------

rem ---------------------------------------------------------------------
rem Confirm installation of JAVA compiler under %JAVA_JDK%
rem and of Isight under %FIPER_HOME%
rem ---------------------------------------------------------------------
if not exist "%JAVA_JDK%\bin\javac.exe" echo The environment variable JAVA_JDK must point to a JAVA development environment && exit /B 1

if not exist "%FIPER_HOME%\docs\java\SMAFIPsdk.jar" echo The environment variable FIPER_HOME must point to an Isight installation && exit /B 1

rem ---------------------------------------------------------------------
rem Set up the classpath and compile everything in this directory
rem ---------------------------------------------------------------------
set CLASSPATH=%FIPER_HOME%\docs\java\SMAFIPsdk.jar;%FIPER_HOME%\docs\java\SMAFIPdesktopsdk.jar;%FIPER_HOME%\docs\java\SMAFIPcommon.jar
@echo on
"%JAVA_JDK%\bin\javac" -classpath "%CLASSPATH%" -d . *.java
@echo off

rem ----------------------------------------------------------------------
rem Build the two jar files
rem ----------------------------------------------------------------------
@echo on
"%JAVA_JDK%\bin\jar" -cvfm ComplexValue.jar ComplexValue.mf ComplexValue.xml examples/development/datatypes/Complex*
"%JAVA_JDK%\bin\jar" -cvfm DataHandlerURL.jar DataHandlerURL.mf DataHandlerURL.xml examples/development/datatypes/DataHandlerURL*
