@ECHO OFF
REM ---------------------------------------------------------------------------
REM JOnAS: Java(TM) Open Application Server
REM Copyright (C) 1999-2008 Bull S.A.S.
REM Contact: jonas-team@ow2.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): Guillaume Sauthier
REM Contributor(s): Markus KARG (migrated from bash to cmd)
REM
REM ---------------------------------------------------------------------------
REM $Id$
REM ---------------------------------------------------------------------------

Rem Keep variables local to this script
setlocal

SET JONAS_LIB=%JONAS_ROOT%\lib

IF ["%JONAS_ROOT%"]==[""] Goto RootIsNotSetError

call "%JONAS_ROOT%\bin\nt\setenv.bat"
ECHO JONAS_BASE is set to %JONAS_BASE%

REM add ow_jonas_bootstrap.jar to the classpath for the bootstrap class
SET JONAS_CLASSPATH=%JONAS_ROOT%\lib\common\ow_jonas_bootstrap.jar;%JONAS_CLASSPATH%

SET JAVA_OPTS=%JAVA_OPTS% -Djonas.root="%JONAS_ROOT%" -Djonas.base="%JONAS_BASE%" -Djava.security.policy="%JONAS_BASE%\conf\java.policy" -Djava.endorsed.dirs="%JONAS_ROOT%\lib\endorsed"

%JAVA% -cp "%JONAS_CLASSPATH%" %JAVA_OPTS% org.ow2.jonas.lib.bootstrap.Bootstrap org.ow2.jonas.generators.genclientstub.ClientStubGen %*
GOTO End

:RootIsNotSetError
ECHO "JONAS_ROOT must be set"
GOTO End

:End
