User: vharcq  
  Date: 01/06/22 14:53:18

  Added:       src/examples/build build.bat build.sh build.xml env.bat
                        env.sh readme.txt
  Log:
  Proposal to handle Ant script to build/deploy/run the examples shown in the manual
  
  Revision  Changes    Path
  1.1                  manual/src/examples/build/build.bat
  
  Index: build.bat
  ===================================================================
  @echo off
  rem $Id: build.bat,v 1.1 2001/06/22 21:53:18 vharcq Exp $
  rem ----- Verify and Set Required Environment Variables -----------------------
  
  if not "%JAVA_HOME%" == "" goto gotJavaHome
  echo You must set JAVA_HOME to point at your Java Development Kit distribution
  goto cleanup
  
  :gotJavaHome
  if not "%JBOSS_HOME%" == "" goto gotJBossHome
  echo You must set JBOSS_HOME to point at your Jboss distribution
  goto cleanup
  
  :gotJBossHome
  if not "%ANT_HOME%" == "" goto gotAntHome
  echo You must set ANT_HOME to point at your Ant distribution
  goto cleanup
  
  :gotAntHome
  
  set _CP_=%ANT_HOME%\lib\ant.jar
  set _CP_=%ANT_HOME%\lib\ant-1.3.jar
  set _CP_=%_CP_%;%ANT_HOME%\lib\parser.jar
  set _CP_=%_CP_%;%ANT_HOME%\lib\jaxp.jar
  set _CP_=%_CP_%;%ANT_HOME%\lib\crimson.jar
  
  %JAVA_HOME%\bin\java.exe -classpath "%JAVA_HOME%\lib\tools.jar;%_CP_%" 
-Djboss.home=%JBOSS_HOME% org.apache.tools.ant.Main %1 %2 %3 %4 %5
  
  
  :cleanup
  
  
  
  1.1                  manual/src/examples/build/build.sh
  
  Index: build.sh
  ===================================================================
  #!/bin/sh
   
  # $Id: build.sh,v 1.1 2001/06/22 21:53:18 vharcq Exp $
    
  TARGET_CLASSPATH=$ANT_HOME/lib/ant.jar:\
  $ANT_HOME/lib/parser.jar:\
  $ANT_HOME/lib/jaxp.jar:\
  $ANT_HOME/lib/crimson.jar
  
     
  if [ "$JAVA_HOME" != "" ] ; then
     TARGET_CLASSPATH=$TARGET_CLASSPATH:$JAVA_HOME/lib/tools.jar
  else
     echo "Error: The JAVA_HOME environment variable is not set."
  fi
  
  if [ "$JBOSS_HOME" = "" ] ; then
     echo "Error: The JBOSS_HOME environment variable is not set."
  fi
  
  if [ "$ANT_HOME" = "" ] ; then
     echo "Error: The ANT_HOME environment variable is not set."
  fi
  
              
  java -classpath $TARGET_CLASSPATH -Djboss.home=$JBOSS_HOME org.apache.tools.ant.Main 
$*
  
  
  
  1.1                  manual/src/examples/build/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <!-- 
        Ant build file for the documentation tutorial code
        Writer of a chapter with an example have to include a foroward
        to their build file.  This latest build file suppose arguments 
        sets here :
                src.dir : Directory where the source are : manual\src\examples
                build.dir : Base directory where to store generated files 
(class/ejb/war/...)
                classpath : Classpath used to make any compilation (set up here by 
verifing 
                        which version of JBoss is used.
        
    -->
  
  <project name="CMP" default="main" basedir="../">
  
      <property name="jboss.dist" value="${jboss.home}"/>
      <property name="src.dir" value="${basedir}"/>
      <property name="build.dir" value="${basedir}/../../build-examples"/>
  
      <path id="base.path_22">
          <pathelement location="${jboss.dist}/client/ejb.jar"/>
          <pathelement location="${jboss.dist}/client/jaas.jar"/>
          <pathelement location="${jboss.dist}/client/jbosssx-client.jar"/>
          <pathelement location="${jboss.dist}/client/jboss-client.jar"/>
          <pathelement location="${jboss.dist}/client/jnp-client.jar"/>
          <pathelement location="${servlet.jar}"/>
          <pathelement location="${build.classes.dir}"/>
      </path>
      <path id="base.path_23">
          <pathelement location="${jboss.dist}/client/jboss-j2ee.jar"/>
          <pathelement location="${jboss.dist}/client/jaas.jar"/>
          <pathelement location="${jboss.dist}/client/jbosssx-client.jar"/>
          <pathelement location="${jboss.dist}/client/jboss-client.jar"/>
          <pathelement location="${jboss.dist}/client/jnp-client.jar"/>
          <pathelement location="${servlet.jar}"/>
          <pathelement location="${build.classes.dir}"/>
      </path>
  
      <target name="validate">
          <available property="classpath_id" value="base.path_22" 
file="${jboss.dist}/client/ejb.jar" />
          <available property="classpath_id" value="base.path_23" 
file="${jboss.dist}/client/jboss-j2ee.jar" />
      </target>
      
      <target name="fail_if_not_valid" unless="classpath_id">
          <fail message="jboss.dist=${jboss.dist} is not a valid JBoss dist 
directory"/>
      </target>
      
      <target name="init" depends="validate,fail_if_not_valid">
          <property name="classpath" refid="${classpath_id}" />
          <echo message="Using JBoss directory=${jboss.dist}" />
          <echo message="Using classpath=${classpath}" />
          <echo message="Using Source directory=${src.dir}" />
          <echo message="Using Build directory=${build.dir}" />
      </target>
  
      <target name="main" depends="init">
                <echo message="Using jboss.dist=${jboss.dist}" />
      </target>
        
        <!-- 
*************************************************************************** -->
  
        <!-- Chapter 4 - CMP -->
        
      <target name="cmp-cd-compile" depends="init">
          <ant antfile="org/jboss/docs/cmp/cd/build/build-cmp-cd-compile.xml" 
target="main">
                        <property name="classpath" value="${classpath}"/>
                        <property name="src.dir" value="${src.dir}"/>
                        <property name="build.dir" value="${build.dir}"/>
          </ant>
      </target>
      
      <target name="cmp-cd-test1" depends="init">
          <ant antfile="org/jboss/docs/cmp/cd/build/build-cmp-cd-compile.xml" 
target="main">
                        <property name="classpath" value="${classpath}"/>
                        <property name="src.dir" value="${build.dir}"/>
                        <property name="build.dir" value="${build.dir}"/>
          </ant>
      </target>
      
        <!-- Add a new target here -->
        
  </project>
  
  
  
  1.1                  manual/src/examples/build/env.bat
  
  Index: env.bat
  ===================================================================
  set JAVA_HOME=c:\jdk1.3
  set JBOSS_HOME=C:\Projects\jbosscvs\jboss\dist
  set ANT_HOME=C:\Projects\jbosscvs\jboss
  
  
  
  1.1                  manual/src/examples/build/env.sh
  
  Index: env.sh
  ===================================================================
  JAVA_HOME=c:\jdk1.3;export JAVA_HOME
  JBOSS_HOME=C:\Projects\jbosscvs\jboss\dist; export JBOSS_HOME
  ANT_HOME=C:\Projects\jbosscvs\jboss; export ANT_HOME
  
  
  
  1.1                  manual/src/examples/build/readme.txt
  
  Index: readme.txt
  ===================================================================
  1. Specify these environement variables:
  
        JAVA_HOME (e.g. c:\jdk1.3)
        JBOSS_HOME (e.g. c:\jboss)
        ANT_HOME (e.g. c:\ant1.3)
  
  Look at env.bat and env.sh for example (On Unix run ". ./env.sh")
  
  2. To run a specific build "cmp-cd-compile" as specified in the manual, type
  
        build cmp-cd-compile
  
  3. To run a specific client example, type
  
        build cmp-cd-test1
  
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to