You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by kw...@apache.org on 2002/11/10 20:21:48 UTC

cvs commit: xml-xindice/java/scratchpad/admin build.xml xindiceadmin.sh

kward       2002/11/10 11:21:48

  Added:       java/scratchpad/admin build.xml xindiceadmin.sh
  Log:
  Adding Ant build and shell script
  
  Revision  Changes    Path
  1.1                  xml-xindice/java/scratchpad/admin/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
  
     Build file for Xindice Admin Scratchpad
  
  Notes:
     This is a build file for use with the Jakarta Ant java build tool.
  
  How to build:
  
     To build, run
  
       cd $XINDICE_HOME/java/scratchpad/admin
  
       Build:
  
       ../../../bin/ant build
  
  How to run:
     Make sure Xindice is running (currently the admin code is using a hard-coded url of localhost:8080)
     Use the shell script in $XINDICE_HOME/java/scratchpad/admin (xindiceadmin.sh)
  
  -->
  
  <project name="xindice-admin-scratchpad" default="main" basedir=".">
  
    <!-- =================================================================== -->
    <!-- Initializes the build process                                       -->
    <!-- =================================================================== -->
    <!-- default directory structure definitions -->
    <property name="xindice.home" value="../../../"/>
  
    <property name="root.dir" value="."/>
    <property name="jar.dir" value="${root.dir}/../../lib"/>
    <property name="src.dir" value="${root.dir}/src"/>
    <property name="build.dir" value="${root.dir}/classes"/>
  
    <!-- classpath to use within project -->
    <path id="project.class.path">
      <!-- compiled classes directory -->
      <pathelement location="${build.dir}"/>
  
      <!-- all jars in jar directory -->
      <fileset dir="${jar.dir}">
        <include name="*.jar"/>
      </fileset>
  
      <!-- system property, environment classpath -->
      <pathelement path="${java.class.path}"/>
    </path>
  
    <target name="main">
    </target>
  
    <target name="init">
      <tstamp/>
      <property name="name" value="xindice-admin"/>
      <property name="version" value="0.1"/>
    </target>
  
    <!-- =================================================================== -->
    <!-- Prepares the build directory                                        -->
    <!-- =================================================================== -->
    <target name="prepare" depends="init">
      <mkdir dir="${build.dir}"/>
    </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the source                                                 -->
    <!-- =================================================================== -->
    <target name="compile" depends="prepare">
      <echo message="Compiling Xindice Admin - Scratchpad"/>
      <javac srcdir="${src.dir}"
             destdir="${build.dir}"
             classpathref="project.class.path"
             debug="on"
             />
    </target>
  
    <target name="build"
          depends="compile">
     <jar jarfile="${xindice.home}/java/lib/xindice-admin-0.1.jar"
          basedir="${build.dir}">
      </jar>
     </target>
  
    <!-- =================================================================== -->
    <!-- Cleans everything                                                   -->
    <!-- =================================================================== -->
    <target name="clean">
      <delete dir="${build.dir}"/>
    </target>
  
  
  </project>
  
  
  
  1.1                  xml-xindice/java/scratchpad/admin/xindiceadmin.sh
  
  Index: xindiceadmin.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
  
  # 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
  
  $JAVA_HOME/bin/java -Xms16m -Xmx128m -Dxindice.home="$XINDICE_HOME" -Dcmd.home="$CMD_HOME" $VMPROPS -classpath "$CLASSPATH" org.apache.xindice.admin.XindiceAdmin