Changeset 9531


Ignore:
Timestamp:
2005-04-01T17:28:14+12:00 (19 years ago)
Author:
kjdon
Message:

more changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/build.xml

    r9516 r9531  
    88     kjdon                                                               
    99     ====================================================================== -->
    10 <project name="gsdl3" default="compile" basedir=".">
     10<project name="gsdl3" default="usage" basedir=".">
    1111
    1212 <!-- ============ self defined tasks =================== -->
     
    4747    source directory of this application.
    4848
    49   * Definitions from a "build.properties" file in the developer's
     49  * Definitions from a "build.properties" file in the user's
    5050    home directory.
    5151
     
    6464
    6565  <property name="src.home" value="${basedir}/src/java"/>
     66  <property name="build.home" value="${basedir}/build"/>
    6667  <property name="packages.home" value="${basedir}/packages"/>
    67   <property name="javalib" value="lib/java"/>
     68  <property name="javalib" value="${basedir}/lib/java"/>
    6869  <property name="web.home" value="${basedir}/web"/>
    6970  <property name="web.lib" value="${web.home}/lib"/>
    7071  <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
    7172 
    72   <property name="javadocs" value="docs/javadoc"/>
     73  <property name="javadocs" value="${basedir}/docs/javadoc"/>
    7374
    7475  <property name="app.name"      value="gsdl3"/>
     
    8081
    8182  <!-- =================== Base dirs for each package ================ -->
    82   <property name="gdbm.home" value="${src.home}/org/greenstone/gdbm"/>
    8383  <property name="applet.home" value="${src.home}/org/greenstone/applet"/>
    8484  <property name="gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
     85  <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
    8586  <property name="gs2build.home" value="${basedir}/gs2building"/>
    8687  <property name="vishnu.home" value="${packages.home}/vishnu"/>
     
    145146  </path>
    146147
    147 <!-- ==================== All Target ====================================== -->
     148<!-- ==================== Primary Targets ====================================== -->
    148149
    149150<!--
     
    154155-->
    155156
    156   <target name="all" depends="clean, compile, install"
    157    description="Clean build directory, then compile, then install"/>
    158 
    159 <!-- ==================== Clean Target ==================================== -->
     157  <target name="all" depends="init,compile,install"
     158    description="Compile, then install"/>
     159
     160  <target name="clean" depends="init,clean-packages,clean-gsdl3,clean-gs2building"
     161    description="Remove all old compiled code - all java classes dirs, and packages object files"/>
     162
     163  <target name="compile" depends="compile-packages,compile-gsdl3,compile-gs2building"
     164    description="Recompile all the source code"/>
     165
     166<!-- ==================== Clean Targets ================================== -->
    160167
    161168<!--
     
    165172
    166173-->
    167 
    168   <target name="clean" depends="clean-packages, clean-gsdl3"
    169     description="Remove all old compiled code - all java classes dirs, and packages object files"/>
    170174 
    171175  <target name="clean-packages"
     
    198202    <delete dir="${applet.home}/phind/classes"/>
    199203    <delete file="${applet.home}/phind/phind.jar"/>
    200     <delete dir="${gdbm.home}/classes"/>
    201     <delete file="${gdbm.home}/gdbm.jar"/>
    202204    <delete dir="${gsdl3.home}/classes"/>
    203205    <delete file="${gsdl3.home}/gsdl3.jar"/>
    204206  </target>
    205 
    206 <!-- ==================== Compile Target ================================== -->
    207 
    208 <!--
    209 
    210   compile up all the source code - includes several targets
    211 
    212 -->
    213 
    214   <target name="compile" depends="compile-packages, compile-gsdl3"
    215     description="Recompile all the source code"/>
    216 
     207 
     208  <!-- ==================== Compile Targets ================================== -->
    217209  <target name="compile-gsdl3"
    218210    description="Only compile the greenstone java source">
    219     <!-- org.greenstone.applet -->
    220     <!-- phind applet -->
    221     <echo>Compiling Phind</echo>
    222     <mkdir dir="${applet.home}/phind/classes"/>
     211    <mkdir dir="${build.home}"/>
    223212    <javac srcdir="${src.home}"
    224       destdir="${applet.home}/phind/classes"
     213      destdir="${build.home}"
    225214      debug="${compile.debug}"
    226215      deprecation="${compile.deprecation}"
    227216      optimize="${compile.optimize}">
    228       <include name="org/greenstone/applet/phind/*.java"/>
    229       <classpath refid="compile.classpath"/>
     217      <classpath>
     218    <path refid="compile.classpath"/>
     219    <!-- need to add in package jar files to classpath -->
     220    <pathelement location="${mg.home}/java/mg.jar"/>
     221    <pathelement location="${mgpp.home}/java/mgpp.jar"/>
     222    <pathelement location="${vishnu.home}/vishnu.jar"/>
     223      </classpath>
    230224    </javac>
    231     <jar destfile="${applet.home}/phind/phind.jar">
    232       <fileset dir="${applet.home}/phind/classes"/>
     225    <jar destfile="${build.home}/gsdl3.jar">
     226      <fileset dir="${build.home}">
     227    <include name="org/greenstone/gsdl3/**"/>
     228    <exclude name="**/Test.class"/>
     229      </fileset>
    233230      <manifest>
    234231    <attribute name="Built-By" value="${user.name}" />
    235232      </manifest>
    236233    </jar>
    237     <!-- org.greenstone.gdbm -->
    238     <echo>Compiling GDBM Wrapper</echo>
    239     <mkdir dir="${gdbm.home}/classes"/>
    240     <javac srcdir="${src.home}"
    241       destdir="${gdbm.home}/classes"
    242       debug="${compile.debug}"
    243       deprecation="${compile.deprecation}"
    244       optimize="${compile.optimize}">
    245       <include name="org/greenstone/gdbm/*.java"/>
    246       <classpath refid="compile.classpath"/>
    247     </javac>
    248     <jar destfile="${gdbm.home}/gdbm.jar">
    249       <fileset dir="${gdbm.home}/classes"/>
     234    <jar destfile="${build.home}/phind.jar">
     235      <fileset dir="${build.home}">
     236    <include name="org/greenstone/applet/phind/**"/>
     237      </fileset>
    250238      <manifest>
    251239    <attribute name="Built-By" value="${user.name}" />
    252240      </manifest>
    253241    </jar>
    254     <!-- org.greenstone.gsdl3 -->
    255     <echo>Compiling gsdl3 source</echo>
    256     <mkdir dir="${gsdl3.home}/classes"/>
    257     <javac srcdir="${src.home}"
    258       destdir="${gsdl3.home}/classes"
    259       debug="${compile.debug}"
    260       deprecation="${compile.deprecation}"
    261       optimize="${compile.optimize}">
    262       <include name="org/greenstone/gsdl3/**"/>
    263       <classpath>
    264     <path refid="compile.classpath"/>
    265     <!-- need to add in gdbm and packages to classpath -->
    266     <pathelement location="${gdbm.home}/gdbm.jar"/>
    267     <pathelement location="${mg.home}/java/mg.jar"/>
    268     <pathelement location="${mgpp.home}/java/mgpp.jar"/>
    269     <pathelement location="${vishnu.home}/vishnu.jar"/>
    270    
    271       </classpath>
    272     </javac>
    273     <jar destfile="${gsdl3.home}/gsdl3.jar">
    274       <fileset dir="${gsdl3.home}/classes"/>
     242    <jar destfile="${build.home}/anttasks.jar">
     243      <fileset dir="${build.home}">
     244    <include name="org/greenstone/anttasks/**"/>
     245      </fileset>
    275246      <manifest>
    276247    <attribute name="Built-By" value="${user.name}" />
    277248      </manifest>
    278249    </jar>
    279   </target>
    280 
     250    <jar destfile="${build.home}/gsdl3test.jar">
     251      <fileset dir="${build.home}">
     252    <include name="org/greenstone/gsdl3/**/*Test.class"/>
     253    <include name="org/greenstone/testing/**"/>
     254      </fileset>
     255      <manifest>
     256    <attribute name="Built-By" value="${user.name}" />
     257      </manifest>
     258    </jar>
     259  </target>
     260 
    281261  <target name="compile-packages"
    282262    description="compile only the packages">
     
    385365
    386366  <target name="install-gsdl3" depends="compile-gsdl3" description="install all teh compiled code - jar files and library files">
    387     <!-- org.greenstone.gdbm -->
    388     <copy file="${gdbm.home}/gdbm.jar" todir="${javalib}"/>
    389367    <!-- org.greenstone.applet -->
    390     <copy file="${applet.home}/phind/phind.jar" todir="${javalib}"/>
    391     <copy file="${applet.home}/phind/phind.jar" todir="${web.lib}"/>
     368    <copy file="${build.home}/phind.jar" todir="${javalib}"/>
     369    <copy file="${build.home}/phind.jar" todir="${web.lib}"/>
    392370
    393371    <!-- org.greenstone.gsdl3 -->
    394     <copy file="${gsdl3.home}/gsdl3.jar" todir="${javalib}"/>
    395     <copy file="${gsdl3.home}/gsdl3.jar" todir="${web.lib}"/>
     372    <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
     373    <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
    396374    <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
    397     <copy file="${gsdl3.home}/classes/org/greenstone/gsdl3/LibraryServlet.class"
     375    <copy file="${build.home}/org/greenstone/gsdl3/LibraryServlet.class"
    398376      todir="${web.classes}/org/greenstone/gsdl3"/>
     377    <!-- org.greenstone.anttasks -->
     378    <copy file="${build.home}/anttasks.jar" todir="${javalib}"/>
    399379  </target>
    400380
    401381<!-- ===================== setup target ===================== -->
     382  <target name="debug">
     383    <echoproperties/>
     384  </target>
     385
    402386  <target name="accept-properties">
    403387    <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
     
    523507  </target>
    524508   
    525   <target name="configure-gs2building">
     509  <target name="configure-gs2building" if="gsdl2.islocal">
    526510    <exec executable="${gs2build.home}/configure" os="${os.linux}"
    527511      dir="${gs2build.home}">
     
    529513    </exec>
    530514  </target>
    531  
    532   <target name="compile-gs2build" >
     515
     516  <target name="clean-gs2building" depends="init" if="gsdl2.islocal">
    533517    <!-- gli -->
    534518    <property name="gli.home" value="${basedir}/gli"/>
     
    536520    <exec executable="clean.sh" os="${os.linux}" dir="${gli.home}"
    537521      resolveExecutable="true"/>
     522    <!-- windows -->
     523    <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
     524      resolveExecutable="true"/>
     525    <!-- gs2build -->
     526    <!--linux:  -->
     527    <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
     528      <arg value="clean"/>
     529    </exec>
     530    <!-- windows: -->   
     531  </target>
     532 
     533  <target name="compile-gs2building" depends="init" if="gsdl2.islocal">
     534    <!-- gli -->
     535    <property name="gli.home" value="${basedir}/gli"/>
     536    <!-- linux -->
    538537    <exec executable="makegli.sh" os="${os.linux}" dir="${gli.home}"
    539538      resolveExecutable="true"/>
    540539    <!-- windows -->
    541     <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
    542       resolveExecutable="true"/>
    543540    <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
    544541      resolveExecutable="true"/>
    545542    <!-- gs2build -->
    546     <!--linux: make clean, make, make install -->
    547     <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
    548       <arg value="clean"/>
    549     </exec>
     543    <!--linux: make, make install -->
    550544    <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
    551545    </exec>
     
    668662            path="/gsdl3"/>
    669663  </target>
     664
     665<!-- ============ running targets ========================-->
     666  <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external"/>
     667
     668  <target name="gli-local" depends="init" if="gsdl2.islocal">
     669    <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux}" dir="${basedir}/gli" spawn="true">
     670      <env key="GSDLHOME" path="${basedir}/gs2building"/>
     671      <env key="GSDL3HOME" value="${basedir}"/>
     672    </exec>
     673    <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
     674      <env key="GSDLHOME" value="${basedir}/gs2building"/>
     675      <env key="GSDL3HOME" value="${basedir}"/>
     676    </exec>
     677  </target>
     678 
     679  <target name="gli-external" depends="init" unless="gsdl2.islocal">
     680    <exec executable="${gsdl.path}/gli/gli4gs3.sh" os="${os.linux}" dir="${gsdl.path}/gli"/>
     681    <exec executable="${gsdl.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl.path}/gli"/>
     682  </target>
     683
     684  <target name="gli-local-old" depends="init" if="gsdl2.islocal">
     685    <exec executable="${basedir}/gs2building/setup.bash" os="${os.linux}" dir="${basedir}/gs2building"/>
     686    <exec executable="${basedir}/gs2building/setup.bat" os="${os.windows}" dir="${basedir}/gs2building"/>
     687    <!-- check for perl -->
     688    <!-- assume that it is compiled -->
     689    <java classname="org.greenstone.gatherer.GathererProg">
     690      <arg value="-gsdl"/>
     691      <arg value="${basedir}/gs2building"/>
     692      <arg value="-gsdl3"/>
     693      <arg value="${basedir}"/>
     694      <arg value="-wget"/>
     695      <arg value="${gli.wget.path}"/>
     696      <classpath>
     697    <pathelement location="${basedir}/gli/classes/"/>
     698    <pathelement location="${basedir}/gli/GLI.jar"/>
     699    <fileset dir="${basedir}/gli/lib">
     700      <include name="*.jar"/>
     701    </fileset>
     702      </classpath>
     703    </java>
     704  </target>
     705
     706  <target name="gli-external-old" depends="init" unless="gsdl2.islocal">
     707    <exec command="source setup.bash" os="${os.linux}" dir="${gsdl.path}"/>
     708    <exec executable="${gsdl.path}/setup.bat" os="${os.windows}" dir="${gsdl.path}"/>
     709    <!-- check for perl -->
     710    <condition property="gli.compiled">
     711      <or>
     712    <available file="${gsdl.path}/gli/GLI.jar"/>
     713    <available file="${gsdl.path}/gli/classes/org/greenstone/gatherer/GatherProg.class"/>
     714      </or>
     715    </condition>
     716    <fail unless="gli.compiled">You must compile the Librarian Interface before you can run it. Go to ${gsdl.path}/gli and run makegli.sh/bat</fail>
     717    <java classname="org.greenstone.gatherer.GathererProg">
     718      <arg value="-gsdl"/>
     719      <arg value="${gsdl.path}"/>
     720      <arg value="-gsdl3"/>
     721      <arg value="${basedir}"/>
     722      <arg value="-wget"/>
     723      <arg value="${gli.wget.path}"/>
     724      <classpath>
     725    <pathelement location="${gsdl.path}/gli/classes/"/>
     726    <pathelement location="${gsdl.path}/gli/GLI.jar"/>
     727    <fileset dir="${gsdl.path}/gli/lib">
     728      <include name="*.jar"/>
     729    </fileset>
     730      </classpath>
     731    </java>
     732  </target>
     733
     734  <target name="usage">
     735    <echo message="  Execute 'ant -projecthelp' for build file help."/>
     736    <echo message="  Execute 'ant -help' for Ant help."/>
     737  </target>
     738  <target name="help" depends="usage"/>
     739
     740  <target name="launch" description="Launch the Tomcat server" depends="init">
     741   
     742  </target>
     743
     744 
     745  <target name="test" description="Run the JUnit test suite (incomplete)"
     746    depends="init">
     747    <mkdir dir="${basedir}/test"/>
     748    <junit printsummary="withOutAndErr"
     749      errorproperty="test.failed"
     750      failureproperty="test.failed"
     751      fork="${junit.fork}">
     752      <formatter type="plain"/>
     753      <classpath>
     754    <pathelement location="${build.home}/gsdl3test.jar"/>
     755    <path refid="compile.classpath"/>
     756      </classpath>
     757      <test name="${testcase}" if="testcase"/>
     758      <batchtest todir="${basedir}/test" unless="testcase">
     759    <fileset dir="${build.home}"
     760      includes="**/*Test.class"
     761      />
     762      </batchtest>
     763    </junit>
     764    <echo>
     765      *********************************************
     766       Test output can be found in directory 'test'
     767      *********************************************
     768    </echo>
     769  </target>
    670770</project>
    671771
Note: See TracChangeset for help on using the changeset viewer.