Rational Developer for System z

JAVA BUILD ANT skeleton

<?xml version="1.0"?>
<!-- The SCLM Build scripts will overlay customer defined variables     
below dynamically on build request when running this ant script -->     
                                                                        
<!-- basedir equates to variable WORKDIR setting in translator          
     LEAVE AS DEFAULT '.'                                               
     WORKDIR is dir CGI_DTWORK/WORKAREA/USERID/proj/group/type/member-->
                                                                        
<!-- The following GLOBAL variables will need to be set in the $GLOBAL  
     member in J2EEBLD-->                                               
<!-- ANT_BIN       : HFS directory path of ANT runtime            -->   
<!-- JAVA_BIN      : HFS directory path of Java compile/runtime   -->   
<!-- CGI_DTWORK    : The install WORKAREA directory for DT        -->   
<!-- CGI_DTCONF    : The install CONFIGURATION directory for DT   -->   
                                                                        
                                                                        
<!-- Start Code to be overlayed by the SCLM build SCRIPTS -->           
<!-- Substitution code is boundered by TAGS <ANTXML> & </ANTXML> -->    
                                                                        
<!-- SCLM_ARCHDEF  : Name of archdef to be built                  -->   
<!-- SCLM_ANTXML   : Name of skeleton Ant XML to use for build    -->   
<!-- JAVA_SOURCE   : If YES then include Java source in JAR       -->   
<!-- SCLM_BLDMAP   : If YES then include in MANIFEST directory          
                     in JAR, WAR, or EAR.                               
                     Provides audit and build map of parts included -->
<!-- JAR_FILE_NAME : Name of created JAR                          -->   
<!-- ENCODING      : Either ASCII or EBCDIC codepage for Java           
                     EG: For ASCII JAVA ENCODING=ISO8859-1              
                         For EBCDIC JAVA ENCODING=IBM-1047        -->   
<!-- CLASSPATH_JARS: z/OS HFS classpath directory used for JAVABLD      
                     build. All jars located in this directory will     
                     be used in the classpath.                    -->   
                                                                        
<ANTXML>                                                                
<project name="SCLMProjectName" default="compile" basedir=".">          
<property name="SCLM_ARCHDEF" value="JAVAPRJ"/>                         
<property name="SCLM_ANTXML" value="$ANTXMLJ"/>                         
<property name="SCLM_BLDMAP" value="NO"/>                               
<property name="JAVA_SOURCE" value="NO"/>                               
<property name="CLASSPATH_JARS" value="/var/SCLMDT/CLASSPATH"/>         
<property name="JAR_FILE_NAME" value="project.jar"/>                    
<property name="ENCODING" value="IBM-1047"/>                            
</ANTXML>                                                               
<!-- End Code substituted by the SCLM build SCRIPTS -->                 
                                                                        
<!-- Set up Java source variable if JAVA_SOURCE not true -->            
 <condition property="JAVA_SOURCE_FILES" value="">                      
     <istrue value="${JAVA_SOURCE}"/>                                   
 </condition>                                                           
<condition property="JAVA_SOURCE_FILES" value="**/*.java">             
    <isfalse value="${JAVA_SOURCE}"/>                                  
</condition>                                                           
                                                                       
<path id="build.class.path">                                           
 <pathelement location="."/>                                           
 <fileset dir="." includes="**/*.jar"/>                                
 <fileset dir="${CLASSPATH_JARS}" includes="**/*.jar, **/*.zip"/>      
</path>                                                                
                                                                       
<!-- Cleans the contents of the folder where compile results will be produced -->
<target name="clean">                                                  
 <echo message="Removing everything in BIN."/>                         
 <delete dir="BIN"/>                                                   
</target>                                                              
                                                                       
<!-- Initialisation for this script -->                                
<target name="init" depends="clean">                                   
 <echo message="Create a directory where generated files will be stored"/>
 <mkdir dir="BIN"/>                                                    
</target>                                                              
                                                                       
<!-- Compiles the source -->                                           
<target name="compile" depends="init">                                 
  <echo message="Compiling now..."/>                                    
  <javac encoding="${ENCODING}" destdir="BIN" srcdir="SRC" fork="true"
   memoryMaximumSize="384m">
   <classpath>                                                          
    <path refid="build.class.path"/>                                    
   </classpath>                                                         
  </javac>                                                              
 </target>                                                              
                                                                        
 <!-- Creates a jar file using all the files in the bin directory       
      and all the SRC files excluding Java files -->                    
 <target name="jar" depends="compile">                                  
  <echo message="Creating the jar file called ${JAR_FILE_NAME}."/>      
  <jar update="true" destfile="${JAR_FILE_NAME}">                       
  <fileset dir="SRC" excludes="${JAVA_SOURCE_FILES}"/>                  
  <fileset dir="BIN"/>                                                  
  </jar>                                                                
 </target>                                                              
</project>                           

Feedback