Vadim,

In xindice.bat, you might consider using the environment variable
%ProgramFiles% when searching for the Xindice installation directory. I
think that "Program Files" might be translated on non-English versions of
Windows.

/Neil

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 8:32 AM
To: [EMAIL PROTECTED]
Subject: cvs commit: xml-xindice/bin xindice.war.bat xindice.war.sh
xindice.bat


vgritsenko    2004/01/15 05:32:18

  Modified:    .        build.xml
               bin      xindice.bat
  Added:       bin      xindice.war.bat xindice.war.sh
  Log:
  Add xindice.war.bat - xindice command line tool for war distribution.
  xindice.war.sh is not complete yet.

  Revision  Changes    Path
  1.70      +11 -13    xml-xindice/build.xml

  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xindice/build.xml,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- build.xml 9 Jan 2004 03:44:06 -0000       1.69
  +++ build.xml 15 Jan 2004 13:32:18 -0000      1.70
  @@ -61,6 +61,7 @@
       <target name="init" description="Initializes the build">
           <tstamp/>
           <mkdir dir="${dist.dir}"/>
  +        <filter token="VERSION" value="${project.version}"/>
       </target>

       <!--
=================================================================== -->
  @@ -286,25 +287,22 @@
           <delete
file="${dist.dir}/${project.filename}-${project.version}.jar"/>
       </target>
       <target name="war-release" depends="jar-release">
  -        <copy file="${config.dir}/xindice.xml"
toFile="${dist.dir}/xindice-${project.version}.xml">
  -            <filterset>
  -                <filter token="VERSION" value="${project.version}"/>
  -            </filterset>
  -        </copy>
  +        <mkdir dir="${build.dir}/webapp"/>
  +        <copy file="${config.dir}/xindice.xml"
toFile="${dist.dir}/xindice-${project.version}.xml" filtering="on"/>
  +        <copy file="${bin.dir}/xindice.war.bat"
toFile="${build.dir}/webapp/xindice.bat" filtering="on"/>
  +        <copy file="${bin.dir}/xindice.war.sh"
toFile="${build.dir}/webapp/xindice.sh" filtering="on"/>
  +        <copy file="${bin.dir}/lcp.bat"
toFile="${build.dir}/webapp/lcp.bat" filtering="on"/>
           <war
destfile="${dist.dir}/${project.filename}-${project.version}.war"
update="false" webxml="config/web.xml">
               <classes dir="${src.build.dir}"/>
  -            <webinf dir="config">
  +            <webinf dir="${config.dir}">
                   <include name="system.xml"/>
               </webinf>
  -            <!--
               <webinf dir=".">
  -                <include name="config/*.*"/>
  +                <include name="${config.dir}/commands.xml"/>
               </webinf>
  -            <webinf dir="bin">
  -                <include name="xindicewar"/>
  -                <include name="xindicewar.bat"/>
  +            <webinf dir="${build.dir}/webapp">
  +                <include name="*"/>
               </webinf>
  -            -->
               <lib refid="core.jars"/>
               <manifest>
                   <attribute name="Built-By" value="${user.name}"/>



  1.10      +60 -60    xml-xindice/bin/xindice.bat

  Index: xindice.bat
  ===================================================================
  RCS file: /home/cvs/xml-xindice/bin/xindice.bat,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- xindice.bat       16 Aug 2003 02:57:32 -0000      1.9
  +++ xindice.bat       15 Jan 2004 13:32:18 -0000      1.10
  @@ -9,68 +9,68 @@
   if not "%JAVA_HOME%"=="" goto checkXindiceHome
   echo JAVA_HOME is not set and ant could not be located. Please set
JAVA_HOME.
   goto end
  -
  +
   :checkXindiceHome
  -rem find XINDICE_HOME
  -if not "%XINDICE_HOME%"=="" goto checkJava
  -
  -rem check for Xindice in "Program Files" on the system drive
  -if not exist "%SystemDrive%\Program Files\Xindice" goto checkSystemDrive
  -set XINDICE_HOME=%SystemDrive%\Program Files\Xindice
  -goto checkJava
  -
  -:checkSystemDrive
  -rem check for Xindice in the root directory of the system drive
  -if not exist "%SystemDrive%\Xindice" goto checkWorkXindice
  -set XINDICE_HOME=%SystemDrive%\Xindice
  -goto checkJava
  -
  -:checkWorkXindice
  -rem check for Xindice in the work directory on the system drive
  -if not exist "%SystemDrive%\work\Xindice" goto checkCurrent
  -set XINDICE_HOME=%SystemDrive%\work\Xindice
  -goto checkJava
  -
  -:checkCurrent
  -if exist ".\config" set XINDICE_HOME=.
  -echo %XINDICE_HOME%
  -goto checkJava
  -
  -:noXindiceHome
  -echo XINDICE_HOME is not set and ant could not be located. Please set
XINDICE_HOME.
  -goto end
  -
  -:checkJava
  -if "%JAVACMD%" == "" set JAVACMD=java
  -if "%XINDICE_DB_HOME%" == "" set XINDICE_DB_HOME=%XINDICE_HOME%
  -
  -set LOCALCLASSPATH=%CLASSPATH%;%ANT_HOME%\config
  +rem find XINDICE_HOME
  +if not "%XINDICE_HOME%"=="" goto checkJava
  +
  +rem check for Xindice in "Program Files" on the system drive
  +if not exist "%SystemDrive%\Program Files\Xindice" goto checkSystemDrive
  +set XINDICE_HOME=%SystemDrive%\Program Files\Xindice
  +goto checkJava
  +
  +:checkSystemDrive
  +rem check for Xindice in the root directory of the system drive
  +if not exist "%SystemDrive%\Xindice" goto checkWorkXindice
  +set XINDICE_HOME=%SystemDrive%\Xindice
  +goto checkJava
  +
  +:checkWorkXindice
  +rem check for Xindice in the work directory on the system drive
  +if not exist "%SystemDrive%\work\Xindice" goto checkCurrent
  +set XINDICE_HOME=%SystemDrive%\work\Xindice
  +goto checkJava
  +
  +:checkCurrent
  +if exist ".\config" set XINDICE_HOME=.
  +echo %XINDICE_HOME%
  +goto checkJava
  +
  +:noXindiceHome
  +echo XINDICE_HOME is not set and ant could not be located. Please set
XINDICE_HOME.
  +goto end
  +
  +:checkJava
  +if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java
  +if "%XINDICE_DB_HOME%" == "" set XINDICE_DB_HOME=%XINDICE_HOME%
  +
  +set LOCALCLASSPATH=%CLASSPATH%;%ANT_HOME%\config
   for %%i in (%XINDICE_HOME%\dist\xindice*.jar) do call
%XINDICE_HOME%\bin\lcp.bat %%i
   for %%i in (%XINDICE_HOME%\java\lib\*.jar) do call
%XINDICE_HOME%\bin\lcp.bat %%i
  -
  -if "%JAVA_HOME%" == "" goto runXindice
  -if exist %JAVA_HOME%\lib\tools.jar call %XINDICE_HOME%\bin\lcp.bat
%JAVA_HOME%\lib\tools.jar
  -if exist %JAVA_HOME%\lib\classes.zip call %XINDICE_HOME%\bin\lcp.bat
%JAVA_HOME%\lib\classes.zip
  -
  -:runXindice
  -set CL=
  -:LOOP
  -if "%1"=="" goto DONE
  -set CL=%CL% %1
  -shift
  -goto LOOP
  -:DONE
  -
  +
  +if "%JAVA_HOME%" == "" goto runXindice
  +if exist %JAVA_HOME%\lib\tools.jar call %XINDICE_HOME%\bin\lcp.bat
%JAVA_HOME%\lib\tools.jar
  +if exist %JAVA_HOME%\lib\classes.zip call %XINDICE_HOME%\bin\lcp.bat
%JAVA_HOME%\lib\classes.zip
  +
  +:runXindice
  +set CL=
  +:LOOP
  +if "%1"=="" goto DONE
  +set CL=%CL% %1
  +shift
  +goto LOOP
  +:DONE
  +
   set LOGGER=org.apache.commons.logging.impl.SimpleLog
   set LOGLEVEL=debug
  -%JAVACMD% -Xms16m -Xmx128m -Dxindice.home=%XINDICE_HOME% -Dxindice.db.hom
e=%XINDICE_DB_HOME% -Dorg.apache.commons.logging.Log=%LOGGER% -Dorg.apache.c
ommons.logging.simplelog.defaultlog=%LOGLEVEL% -Dcmd.home=%XINDICE_HOME%\bin
 -classpath %LOCALCLASSPATH% org.apache.xindice.tools.XMLTools %CL%
  -
  -:end
  -if not "%OS%"=="Windows_NT" goto win9xEnd
  -:winNTend
  [EMAIL PROTECTED]
  -goto mainEnd
  -:win9xEnd
  -set JAVACMD=
  -set LOCALCLASSPATH=
  -:mainEnd


+%JAVACMD% -Xms16m -Xmx128m -Djava.endorsed.dirs=%XINDICE_HOME%\build\endors
ed -Dxindice.home=%XINDICE_HOME% -Dxindice.db.home=%XINDICE_DB_HOME% -Dorg.a
pache.commons.logging.Log=%LOGGER% -Dorg.apache.commons.logging.simplelog.de
faultlog=%LOGLEVEL% -Dcmd.home=%XINDICE_HOME%\bin -classpath
%LOCALCLASSPATH% org.apache.xindice.tools.XMLTools %CL%
  +
  +:end
  +if not "%OS%"=="Windows_NT" goto win9xEnd
  +:winNTend
  [EMAIL PROTECTED]
  +goto mainEnd
  +:win9xEnd
  +set JAVACMD=
  +set LOCALCLASSPATH=
  +:mainEnd



  1.1                  xml-xindice/bin/xindice.war.bat

  Index: xindice.war.bat
  ===================================================================
  @echo off
  @setLocal


:: -------------------------------------------------------------------------
----
  :: Xindice Command Line Tool Win32 Shell Script for WAR distribution
  ::
  :: $Id: xindice.war.bat,v 1.1 2004/01/15 13:32:18 vgritsenko Exp $


:: -------------------------------------------------------------------------
----

  :: ----- Verify and Set Required Environment
Variables -------------------------

  if not "%JAVA_HOME%" == "" goto gotJavaHome
  echo ERROR: You must set JAVA_HOME to point at your Java
  echo        Development Kit installation.
  goto end
  :gotJavaHome

  if not "%XINDICE_HOME%" == "" goto gotXindiceHome
  :: ----- Use the location of this script
  set XINDICE_HOME=%~dp0.
  if not exist "%XINDICE_HOME%\system.xml" goto noXindiceHome
  echo WARNING: The environment variable XINDICE_HOME is not set.
  echo          Defaulting to %XINDICE_HOME%.
  goto gotXindiceHome

  :noXindiceHome
  echo ERROR: You must set XINDICE_HOME to point at your
  echo        Xindice WEB-INF directory.
  goto end

  :gotXindiceHome
  echo Using Xindice home: %XINDICE_HOME%

  if "%XINDICE_DB_HOME%" == "" set XINDICE_DB_HOME=%XINDICE_HOME%
  if "%LOGGER%" == "" set LOGGER=org.apache.commons.logging.impl.SimpleLog
  if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java


  :: ----- Set Up The
Classpath --------------------------------------------------

  set LOCALCLASSPATH=%XINDICE_HOME%\classes
  for %%i in (%XINDICE_HOME%\lib\*.jar) do call %XINDICE_HOME%\lcp.bat %%i


  :: ----- Check Command Line
Arguments ------------------------------------------

  :runXindice
  set CL=
  :LOOP
  if "%1"=="" goto DONE
  if "%1"=="-v" goto VERBOSE
  set CL=%CL% %1
  shift
  goto LOOP
  :VERBOSE
  set LOGLEVEL=DEBUG
  shift
  goto LOOP
  :DONE


  :: ----- Start Command Line
Tool -----------------------------------------------



%JAVACMD% -Xms16m -Xmx128m -Djava.endorsed.dirs=%XINDICE_HOME%\lib -Dxindice
.home=%XINDICE_HOME% -Dxindice.db.home=%XINDICE_DB_HOME% -Dorg.apache.common
s.logging.Log=%LOGGER% -Dorg.apache.commons.logging.simplelog.defaultlog=%LO
GLEVEL% -Dcmd.home=%XINDICE_HOME% -classpath %LOCALCLASSPATH%
org.apache.xindice.tools.XMLTools %CL%


  :: -----
End -------------------------------------------------------------------

  :end
  @endlocal



  1.1                  xml-xindice/bin/xindice.war.sh

  Index: xindice.war.sh
  ===================================================================
  #!/bin/sh

  if test -z "$JAVA_HOME"; then
     echo "\$JAVA_HOME Is Not Set"
     exit
  fi

  if test -z "$XINDICE_HOME"; then
     echo "\$XINDICE_HOME Is Not Set"
     exit
  fi

  CMD_HOME=`dirname $0`
  CMD_NAME=`basename $0`

  CLASSPATH=$XINDICE_HOME/classgen:$XINDICE_HOME/config:$CLASSPATH

  # Read in the list of Xindice Jars to include in the CLASSPATH
  JAR_LIST=""
  JARS=`ls -1 $XINDICE_HOME/java/lib/*.jar`
  for jar in $JARS ; do
     JAR_LIST="$JAR_LIST `basename $jar`"
     CLASSPATH=$jar:$CLASSPATH ;
  done
  JARS=`ls -1 $XINDICE_HOME/dist/xindice*.jar`
  for jar in $JARS ; do
     JAR_LIST="$JAR_LIST `basename $jar`"
     CLASSPATH=$jar:$CLASSPATH ;
  done

  # Read in the extra VM paramters for starting the program
  VMPROPS=""
  if test -f $XINDICE_HOME/config/vm.cfg; then
     PROPS="`cat $XINDICE_HOME/config/vm.cfg`"
     for prop in $PROPS
     do
        VMPROPS="$VMPROPS $prop"
     done
  fi

  case $CMD_NAME in
     xindice)       CLASS_NAME="org.apache.xindice.tools.XMLTools" ;;
     *)           echo "Error mapping command link to Java class"
                  exit 1 ;;
  esac

  LOGGER=org.apache.commons.logging.impl.SimpleLog
  LOGLEVEL=debug



$JAVA_HOME/bin/java -Xms16m -Xmx128m -Dxindice.home="$XINDICE_HOME" -Dorg.ap
ache.commons.logging.Log="$LOGGER" -Dorg.apache.commons.logging.simplelog.de
faultlog="$LOGLEVEL" -Dcmd.home="$CMD_HOME" $VMPROPS -classpath "$CLASSPATH"
$CLASS_NAME $*




Reply via email to