@Echo off

Rem  JOnAS: Java(TM) Open Application Server
Rem  Copyright (C) 1999 Bull S.A.
Rem  Contact: jonas-team@objectweb.org
Rem  
Rem  This library is free software; you can redistribute it and/or
Rem  modify it under the terms of the GNU Lesser General Public
Rem  License as published by the Free Software Foundation; either
Rem  version 2.1 of the License, or any later version.
Rem  
Rem  This library is distributed in the hope that it will be useful,
Rem  but WITHOUT ANY WARRANTY; without even the implied warranty of
Rem  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Rem  Lesser General Public License for more details.
Rem  
Rem  You should have received a copy of the GNU Lesser General Public
Rem  License along with this library; if not, write to the Free Software
Rem  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
Rem  USA
Rem
Rem  Initial developer(s): ____________________________________.
Rem  Contributor(s): ______________________________________.
Rem
Rem  ---------------------------------------------------------------------------
Rem  $Id$
Rem  ---------------------------------------------------------------------------


Rem  Check environment variables:
if "%JONAS_ROOT%"=="" Goto SetRoot

Rem set the Environment Variables
call %JONAS_ROOT%\bin\nt\config_env.bat
Set CLASSES_DIR=%JONAS_ROOT%\examples\classes

Rem  Make the 'examples\classes' directory
md %CLASSES_DIR%

Rem  Compiles the source files
javac -d %CLASSES_DIR%  EjbCompHome.java EjbComp.java MsgReceptor.java EjbCompBean.java EjbCompClient.java

Rem  Make the ejb-jar file
md %CLASSES_DIR%\META-INF
copy jms.xml %CLASSES_DIR%\META-INF\ejb-jar.xml
copy jonas-jms.xml %CLASSES_DIR%\META-INF\jonas-ejb-jar.xml
cd %CLASSES_DIR%
jar cvf jms\jms.jar META-INF\ejb-jar.xml META-INF\jonas-ejb-jar.xml jms\EjbCompHome.class jms\EjbComp.class jms\EjbCompBean.class
del META-INF\ejb-jar.xml META-INF\jonas-ejb-jar.xml

Rem  Generates the interposition classes, compiles themand put them in the ejb-jar
cd %JONAS_ROOT%\examples\src\jms
call %JONAS_ROOT%\bin\nt\GenIC.bat -d %CLASSES_DIR% -keepgenerated %CLASSES_DIR%\jms\jms.jar

Rem  Install the ejb-jar file in %JONAS_ROOT%\ejbjars directory
copy %CLASSES_DIR%\jms\jms.jar %JONAS_ROOT%\ejbjars\jms.jar

Goto End

:SetRoot
@echo "JONAS_ROOT must be set"

:End
