Changeset 9693


Ignore:
Timestamp:
2005-04-15T12:11:05+12:00 (19 years ago)
Author:
kjdon
Message:

rearranged the layout a bit

File:
1 edited

Legend:

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

    r9690 r9693  
    162162  <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? -->
    163163
    164   <target name="install" depends="accept-properties,init,prepare,cvsupdate,configure,clean,compile" description="Install Greenstone 3. Use this when you first checkout the code. Also running this target later on will reinstall Greenstone. Most things will be reset back to their defaults, except for code changes.">
    165   </target>
    166 
    167   <target name="all" depends="init,compile"
    168     description="Recompile the code?"/>
     164  <target name="install" depends="accept-properties,init,prepare,cvsupdate,configure,clean,compile"
     165    description="Install Greenstone 3. Use this when you first checkout the code. Also running this target later on will reinstall Greenstone. Most things will be reset back to their defaults, except for code changes."/>
     166
     167  <target name="prepare" depends="init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-collections"/>
     168
     169  <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building"
     170    description="Do a cvs update for all sources. Doesn't reompile the code."/>
     171
     172    <target name="configure" depends="init,configure-tomcat,configure-files,configure-packages,configure-core,configure-gs2building"
     173    description="Configure the installation. Includes setting up config files and configuring the C/C++ packages. This is called from install and update. Should be re-run if you change the build.properties file."/>
    169174
    170175  <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building"
     
    177182    description="Update (thru CVS) all the source (including core, packages and gs2building) and recompile. Similar to install but doesn't reinstall components such as Tomcat and axis."/>
    178183
    179   <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building"
    180     description="Do a cvs update for all sources. Doesn't reompile teh code."/>
    181     <!-- this is config stuff, that can be done more than once - should be rerun is the build.properties file changes -->
    182     <target name="configure" depends="init,configure-tomcat,configure-files,configure-packages,configure-core,configure-gs2building"
    183     description="Configure the installation. Includes setting up config files and configuring the C/C++ packages. This is called from install and update. Should be re-run if you change the build.properties file."/>
     184  <target name="startup" depends="init,startup-mysql,startup-tomcat"
     185    description="Startup the (local) Greenstone servers (tomcat,mysql...)" />
     186
     187  <target name="shutdown" depends="init,shutdown-tomcat,shutdown-mysql"
     188    description="Shutdown the (local) Greenstone servers."/>
     189 
     190  <target name="restart" description="Shutdown and restart the Greenstone servers" depends="init,shutdown,startup"/>
    184191
    185192
     
    290297  </target>
    291298
    292  <!-- this is all the do-once things -->
    293   <target name="prepare" depends="init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-collections">
    294   </target>
     299 <!-- ========== Miscellaneous Targets ================================ -->
    295300 
    296301  <target name="prepare-collections">
     
    334339  </target>
    335340
     341   <target name="compile-extra" depends="init">
     342    <javac srcdir="${web.home}/WEB-INF/classes"
     343      destdir="${web.home}/WEB-INF/classes"
     344      debug="${compile.debug}"
     345      deprecation="${compile.deprecation}"
     346      optimize="${compile.optimize}">
     347      <classpath>
     348    <path refid="compile.classpath"/>
     349      </classpath>
     350    </javac>
     351  </target>
     352
     353 
     354
     355
     356<!-- ======================= Tomcat Targets ========================== -->
     357
    336358  <!-- this target sets up tomcat for teh first time, or resets it any subsequent times -->
    337359  <target name="prepare-tomcat" depends="init,setup-proxy">
     
    375397    </copy>
    376398  </target>
    377  
     399
     400  <target name="reload" description="Reload web application"
     401          depends="init,setup-catalina-ant-tasks">
     402    <reload  url="http://kanuka:7070/manager" username="admin" password="admin"
     403            path="/gsdl3"/>
     404  </target>
     405
     406
     407  <target name="startup-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
     408    <property name="tomcat.classpath" refid="compile.classpath"/>
     409    <property name="tomcat.path" value="${basedir}/packages/mysql/bin:${basedir}/bin/script:${basedir}/bin:${env.PATH}"/>
     410    <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
     411    <exec executable="${catalina.home}/bin/startup.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false">
     412      <env key="GSDLOS" value="linux"/>
     413      <env key="GSDL3HOME" value="${basedir}"/>
     414      <env key="PATH" path="${tomcat.path}"/>
     415      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
     416      <env key="CLASSPATH" path="${tomcat.classpath}"/>
     417      <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${basedir}/lib:${mysql.home}/lib/mysql"/>
     418    </exec>
     419    <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
     420      <env key="GSDLOS" value="windows"/>
     421      <env key="GSDL3HOME" value="${basedir}"/>
     422      <env key="PATH" path="${tomcat.path}:${basedir}/lib"/>
     423      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
     424      <env key="CLASSPATH" path="${tomcat.classpath}"/>
     425    </exec>
     426    <!-- wait for the server to startup in case other targets need it running -->
     427    <waitfor maxwait="5" maxwaitunit="second">
     428      <and>
     429    <socket server="${tomcat.server}" port="${tomcat.port}"/>
     430    <http url="http://${tomcat.server}:${tomcat.port}/gsdl3/index.html"/>
     431      </and>
     432    </waitfor>
     433  </target>
     434  <!-- windows:
     435  set CATALINA_HOME=%GSDL3HOME%\comms\jakarta\tomcat
     436set CATALINA_OPTS="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=%GSDL3HOME% -DGSDLOS=%GSDLOS% -DPATH=%PATH%"
     437    call "%GSDL3HOME%\comms\jakarta\tomcat\bin\startup.bat"
     438  # launch a web browser
     439    start http://localhost:8080/gsdl3
     440
     441-->
     442  <target name="shutdown-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
     443    <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false"/>
     444    <!-- windows:
     445
     446    call "%GSDL3HOME%\comms\jakarta\tomcat\bin\shutdown.bat"
     447-->
     448  </target>
     449
     450  <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,shutdown-tomcat,startup-tomcat"/>
     451
     452  <target name="setup-catalina-ant-tasks">
     453    <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
     454    <taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"
     455      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     456    <taskdef name="list"      classname="org.apache.catalina.ant.ListTask"
     457      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     458    <taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"
     459      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     460    <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
     461      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     462    <taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"
     463      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     464    <taskdef name="start"     classname="org.apache.catalina.ant.StartTask"
     465      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     466    <taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"
     467      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     468    <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"
     469      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
     470  </target>
     471
     472
     473<!-- ======================= Mysql Targets =========================== -->
     474
    378475  <!-- this is one target that we only want to run once. -->
    379   <target name="prepare-mysql" depends="init,install-mysql,startup-mysql" if="mysql.islocal" unless="mysql.present">
     476  <target name="prepare-mysql" depends="init,init-mysql-vars,install-mysql,startup-mysql,setup-mysql,shutdown-mysql"/>
     477
     478  <!-- is this just linux or both??-->
     479  <target name="setup-mysql" if="mysql.islocal" unless="mysql.present">
    380480    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    381481      <arg value="--user=root"/>
     
    399499      <arg value="localsite_gs3mgdemo"/>
    400500    </exec>
    401   </target>
    402 
    403   <target name="install-mysql" depends="init,install-mysql-linux,install-mysql-windows" if="mysql.islocal"/>
     501    <antcall target="shutdown-mysql"/>
     502  </target>
     503
     504  <target name="init-mysql-vars">
     505    <condition property="mysql.islocal.linux">
     506      <and>
     507    <isset property="mysql.islocal"/>
     508    <isset property="current.os.islinux"/>
     509      </and>
     510    </condition>
     511
     512    <condition property="mysql.islocal.windows">
     513      <and>
     514    <isset property="mysql.islocal"/>
     515    <isset property="current.os.iswindows"/>
     516      </and>
     517    </condition>
     518  </target>
     519  <target name="install-mysql" depends="init,install-mysql-linux,install-mysql-windows"/>
    404520 
    405521  <!-- install and set up the database -->
    406   <target name="install-mysql-linux" depends="init" if="current.os.islinux" unless="mysql.present">
     522  <target name="install-mysql-linux" depends="init" if="mysql.islocal.linux" unless="mysql.present">
    407523    <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
    408524      dest="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
     
    432548  </target>
    433549
    434   <target name="install-mysql-windows" depends="init" if="current.os.iswindows">
     550  <target name="install-mysql-windows" depends="init" if="mysql.islocal.windows" unless="mysql.present">
    435551    <get src="http://www.greenstone.org/gs3files/mysql-essential-4.1.11-win32.msi"
    436552      dest="${packages.home}/mysql-essential-4.1.11-win32.msi"
     
    438554   <!-- can we run the installer?? -->
    439555  </target>
     556
     557  <!-- mysql targets -->
     558  <!-- windows:
     559    cd %GSDL3HOME%\packages\mysql
     560    start bin\mysqld
     561    cd %GSDL3HOME%
     562-->
     563  <target name="startup-mysql" depends="init" if="mysql.islocal"
     564    description="Startup only mysql">
     565    <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
     566      spawn="true">
     567      <arg value="--user=root"/>
     568      <arg value="--datadir=./data"/>
     569      <arg value="--basedir=."/>
     570      <arg value="--pid_file=gsdl3.pid"/>
     571      <arg value="--socket=/tmp/mysql.sock"/>
     572      <arg value="--err-log=./var/log/mysql.log"/>
     573    </exec>
     574    <sleep seconds="2"/>
     575    <!-- need to test that the server has started up -->   
     576    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
     577      failonerror="true" outputproperty="throw.away">
     578      <arg value="--user=root"/>
     579      <arg value="--execute=show databases;"/>
     580    </exec>
     581    <echo>MYSQL database server started successfully</echo>
     582  </target>
     583
     584  <target name="shutdown-mysql" depends="init" if="mysql.islocal"
     585    description="Shutdown only mysql">
     586    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
     587      failonerror="true" os="${os.linux}">
     588      <arg value="--user=root"/>
     589      <arg value="--socket=/tmp/mysql.sock"/>
     590      <arg value="shutdown"/>
     591    </exec>
     592    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
     593      failonerror="true" os="${os.windows}">
     594      <arg value="--user=root"/>
     595      <arg value="shutdown"/>
     596    </exec>
     597    <echo>MYSQL database server shutdown successfully</echo>
     598  </target>
     599  <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,shutdown-mysql,startup-mysql"/>
     600
     601
     602<!-- ======================= Axis Targets ============================ -->
    440603
    441604  <target name="prepare-axis" depends="init">
     
    458621    </copy>
    459622  </target>
     623
     624  <target name="soap-deploy-site" depends="get-sitename,get-siteuri,create-deployment-files,restart-tomcat"
     625    description="Deploy a SOAP web service for a local Greenstone site">
     626    <java classname="org.apache.axis.client.AdminClient">
     627      <classpath refid="compile.classpath"/>
     628      <arg value="-p"/>
     629      <arg value="${tomcat.port}"/>
     630      <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
     631    </java>   
     632  </target>
     633 
     634  <target name="soap-undeploy-site" depends="get-sitename"
     635    description="Undeploy a SOAP web service for a local Greenstone site">
     636    <java classname="org.apache.axis.client.AdminClient">
     637      <classpath refid="compile.classpath"/>
     638      <arg value="-p"/>
     639      <arg value="${tomcat.port}"/>
     640      <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
     641    </java>
     642  </target>
     643
     644  <target name="get-sitename">
     645    <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
     646    <condition property="deploy.exists">
     647      <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
     648    </condition>
     649    <condition property="undeploy.exists">
     650      <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
     651    </condition>
     652    <echo>${axis.sitename}, ${deploy.exists}, ${undeploy.exists}</echo>
     653  </target>
     654
     655  <target name="get-siteuri" depends="get-sitename">
     656    <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
     657    <echo>${axis.sitename}, ${axis.siteuri}</echo>
     658  </target>
     659  <target name="create-deployment-files" depends="get-sitename"
     660    if="axis.sitename" unless="deploy.exists">
     661    <filter token="sitename" value="${axis.sitename}"/>
     662    <filter token="siteuri" value="${axis.siteuri}"/>
     663    <copy file="${basedir}/resources/soap/site.wsdd.template"
     664      tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
     665      filtering="true"/>
     666     <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
     667      tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
     668      filtering="true"/>
     669    <!-- create the java files and compile them -->
     670    <copy file="${gsdl3.home}/SOAPServer.java.in"
     671      tofile="${gsdl3.home}/SOAPServer${axis.sitename}.java"
     672      filtering="true"/>
     673    <javac srcdir="${src.home}"
     674      destdir="${build.home}"
     675      debug="${compile.debug}"
     676      deprecation="${compile.deprecation}"
     677      optimize="${compile.optimize}">
     678      <classpath refid="compile.classpath"/>
     679      <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
     680    </javac>
     681    <jar destfile="${build.home}/gsdl3.jar">
     682      <fileset dir="${build.home}">
     683    <include name="org/greenstone/gsdl3/**"/>
     684    <exclude name="**/Test.class"/>
     685      </fileset>
     686      <manifest>
     687    <attribute name="Built-By" value="${user.name}" />
     688      </manifest>
     689    </jar>
     690    <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
     691    <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
     692  </target>
     693   
    460694
    461695<!-- ====================== Core targets ============================== -->
     
    7891023  </target>
    7901024
    791 
    792 <!-- ============ running targets ========================-->
    793 
    794   <target name="setup-catalina-ant-tasks">
    795     <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
    796     <taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"
    797       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    798     <taskdef name="list"      classname="org.apache.catalina.ant.ListTask"
    799       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    800     <taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"
    801       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    802     <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
    803       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    804     <taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"
    805       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    806     <taskdef name="start"     classname="org.apache.catalina.ant.StartTask"
    807       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    808     <taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"
    809       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    810     <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"
    811       classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
    812   </target>
    813 
    8141025  <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external">
    8151026    <echo>Running GLI from Ant means that you don't get to see any of the terminal output. If you have problems with GLI and want to see the output, please run the script gli4gs3.sh/bat from the gsdl3/gli directory.
     
    8341045
    8351046
    836   <target name="reload" description="Reload web application"
    837           depends="init,setup-catalina-ant-tasks">
    838     <reload  url="http://kanuka:7070/manager" username="admin" password="admin"
    839             path="/gsdl3"/>
    840   </target>
    841 
    842   <target name="startup" description="Startup the (local) Greenstone servers (tomcat,mysql...)" depends="init,startup-mysql,startup-tomcat"/>
    843 
    844   <target name="startup-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
    845     <property name="tomcat.classpath" refid="compile.classpath"/>
    846     <property name="tomcat.path" value="${basedir}/packages/mysql/bin:${basedir}/bin/script:${basedir}/bin:${env.PATH}"/>
    847     <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
    848     <exec executable="${catalina.home}/bin/startup.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false">
    849       <env key="GSDLOS" value="linux"/>
    850       <env key="GSDL3HOME" value="${basedir}"/>
    851       <env key="PATH" path="${tomcat.path}"/>
    852       <env key="CATALINA_OPTS" value="${catalina.opts}"/>
    853       <env key="CLASSPATH" path="${tomcat.classpath}"/>
    854       <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${basedir}/lib:${mysql.home}/lib/mysql"/>
    855     </exec>
    856     <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
    857       <env key="GSDLOS" value="windows"/>
    858       <env key="GSDL3HOME" value="${basedir}"/>
    859       <env key="PATH" path="${tomcat.path}:${basedir}/lib"/>
    860       <env key="CATALINA_OPTS" value="${catalina.opts}"/>
    861       <env key="CLASSPATH" path="${tomcat.classpath}"/>
    862     </exec>
    863     <!-- wait for the server to startup in case other targets need it running -->
    864     <waitfor maxwait="5" maxwaitunit="second">
    865       <and>
    866     <socket server="${tomcat.server}" port="${tomcat.port}"/>
    867     <http url="http://${tomcat.server}:${tomcat.port}/gsdl3/index.html"/>
    868       </and>
    869     </waitfor>
    870   </target>
    871   <!-- windows:
    872   set CATALINA_HOME=%GSDL3HOME%\comms\jakarta\tomcat
    873 set CATALINA_OPTS="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=%GSDL3HOME% -DGSDLOS=%GSDLOS% -DPATH=%PATH%"
    874     call "%GSDL3HOME%\comms\jakarta\tomcat\bin\startup.bat"
    875   # launch a web browser
    876     start http://localhost:8080/gsdl3
    877 
    878 -->
    879   <target name="shutdown" depends="init,shutdown-tomcat,shutdown-mysql" description="Shutdown the (local) Greenstone servers."/>
    880  
    881   <target name="shutdown-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
    882     <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false"/>
    883     <!-- windows:
    884 
    885     call "%GSDL3HOME%\comms\jakarta\tomcat\bin\shutdown.bat"
    886 -->
    887   </target>
    888  
    889   <target name="restart" description="Shutdown and restart the Greenstone servers" depends="init,shutdown,startup"/>
    890   <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,shutdown-tomcat,startup-tomcat"/>
    891   <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,shutdown-mysql,startup-mysql"/>
    892 
     1047<!-- ======================== TESTING Targets ========================= -->
     1048 
    8931049  <target name="test" description="Run the (incomplete) JUnit test suite "
    8941050    depends="init">
     
    9171073  </target>
    9181074
    919   <target name="compile-extra" depends="init">
    920     <javac srcdir="${web.home}/WEB-INF/classes"
    921       destdir="${web.home}/WEB-INF/classes"
    922       debug="${compile.debug}"
    923       deprecation="${compile.deprecation}"
    924       optimize="${compile.optimize}">
    925       <classpath>
    926     <path refid="compile.classpath"/>
    927       </classpath>
    928     </javac>
    929   </target>
    930 
    931   <target name="get-sitename">
    932     <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
    933     <condition property="deploy.exists">
    934       <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
    935     </condition>
    936     <condition property="undeploy.exists">
    937       <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
    938     </condition>
    939     <echo>${axis.sitename}, ${deploy.exists}, ${undeploy.exists}</echo>
    940   </target>
    941 
    942   <target name="get-siteuri" depends="get-sitename">
    943     <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
    944     <echo>${axis.sitename}, ${axis.siteuri}</echo>
    945   </target>
    946   <target name="create-deployment-files" depends="get-sitename"
    947     if="axis.sitename" unless="deploy.exists">
    948     <filter token="sitename" value="${axis.sitename}"/>
    949     <filter token="siteuri" value="${axis.siteuri}"/>
    950     <copy file="${basedir}/resources/soap/site.wsdd.template"
    951       tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
    952       filtering="true"/>
    953      <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
    954       tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
    955       filtering="true"/>
    956     <!-- create the java files and compile them -->
    957     <copy file="${gsdl3.home}/SOAPServer.java.in"
    958       tofile="${gsdl3.home}/SOAPServer${axis.sitename}.java"
    959       filtering="true"/>
    960     <javac srcdir="${src.home}"
    961       destdir="${build.home}"
    962       debug="${compile.debug}"
    963       deprecation="${compile.deprecation}"
    964       optimize="${compile.optimize}">
    965       <classpath refid="compile.classpath"/>
    966       <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
    967     </javac>
    968     <jar destfile="${build.home}/gsdl3.jar">
    969       <fileset dir="${build.home}">
    970     <include name="org/greenstone/gsdl3/**"/>
    971     <exclude name="**/Test.class"/>
    972       </fileset>
    973       <manifest>
    974     <attribute name="Built-By" value="${user.name}" />
    975       </manifest>
    976     </jar>
    977     <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
    978     <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
    979   </target>
    980    
    981   <target name="soap-deploy-site" depends="get-sitename,get-siteuri,create-deployment-files,restart-tomcat"
    982     description="Deploy a SOAP web service for a local Greenstone site">
    983     <java classname="org.apache.axis.client.AdminClient">
    984       <classpath refid="compile.classpath"/>
    985       <arg value="-p"/>
    986       <arg value="${tomcat.port}"/>
    987       <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
    988     </java>   
    989   </target>
    990  
    991   <target name="soap-undeploy-site" depends="get-sitename"
    992     description="Undeploy a SOAP web service for a local Greenstone site">
    993     <java classname="org.apache.axis.client.AdminClient">
    994       <classpath refid="compile.classpath"/>
    995       <arg value="-p"/>
    996       <arg value="${tomcat.port}"/>
    997       <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
    998     </java>
    999   </target>
    1000 
    1001   <!-- mysql targets -->
    1002   <!-- windows:
    1003     cd %GSDL3HOME%\packages\mysql
    1004     start bin\mysqld
    1005     cd %GSDL3HOME%
    1006 -->
    1007   <target name="startup-mysql" depends="init" if="mysql.islocal"
    1008     description="Startup only mysql">
    1009     <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
    1010       spawn="true">
    1011       <arg value="--user=root"/>
    1012       <arg value="--datadir=./data"/>
    1013       <arg value="--basedir=."/>
    1014       <arg value="--pid_file=gsdl3.pid"/>
    1015       <arg value="--socket=/tmp/mysql.sock"/>
    1016       <arg value="--err-log=./var/log/mysql.log"/>
    1017     </exec>
    1018     <sleep seconds="2"/>
    1019     <!-- need to test that the server has started up -->   
    1020     <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
    1021       failonerror="true" outputproperty="throw.away">
    1022       <arg value="--user=root"/>
    1023       <arg value="--execute=show databases;"/>
    1024     </exec>
    1025     <echo>MYSQL database server started successfully</echo>
    1026   </target>
    1027 
    1028   <target name="shutdown-mysql" depends="init" if="mysql.islocal"
    1029     description="Shutdown only mysql">
    1030     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    1031       failonerror="true" os="${os.linux}">
    1032       <arg value="--user=root"/>
    1033       <arg value="--socket=/tmp/mysql.sock"/>
    1034       <arg value="shutdown"/>
    1035     </exec>
    1036     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    1037       failonerror="true" os="${os.windows}">
    1038       <arg value="--user=root"/>
    1039       <arg value="shutdown"/>
    1040     </exec>
    1041     <echo>MYSQL database server shutdown successfully</echo>
    1042   </target>
     1075
    10431076
    10441077</project>
Note: See TracChangeset for help on using the changeset viewer.