/install/build.xml

http://transcriptstudio4isha.googlecode.com/ · XML · 74 lines · 64 code · 9 blank · 1 comment · 0 complexity · f3212ecd5d79feae0658604701155eb6 MD5 · raw file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project basedir="." default="all" name="transcript-studio">
  3. <description>Isha Foundation Transcript Studio - Configure eXist</description>
  4. <path id="classpath.core">
  5. <fileset dir="${exist.home}/lib/core">
  6. <include name="*.jar"/>
  7. </fileset>
  8. <pathelement path="${exist.home}/exist.jar"/>
  9. <pathelement path="${exist.home}/exist-optional.jar"/>
  10. </path>
  11. <typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
  12. <classpath refid="classpath.core"/>
  13. </typedef>
  14. <property name="dist.exist.app.dir" location="exist-app"/>
  15. <property name="dist.exist.db.dir" location="exist-db"/>
  16. <target name="init-exist">
  17. <echo message="Copying TranscriptStudio-specific files to eXist installation..."/>
  18. <copy todir="${exist.home}" includeEmptyDirs="true">
  19. <fileset dir="${dist.exist.app.dir}">
  20. <exclude name="tools/wrapper/conf/wrapper.conf"/>
  21. </fileset>
  22. </copy>
  23. <copy todir="${exist.home}">
  24. <fileset dir="${dist.exist.app.dir}">
  25. <include name="tools/wrapper/conf/wrapper.conf"/>
  26. </fileset>
  27. <filterset>
  28. <filter token="JAVA_HOME" value="${java.home}"/>
  29. </filterset>
  30. </copy>
  31. <chmod file="${exist.home}/bin/startup.sh" perm="ugo+x"/>
  32. <echo message="Initialising database..."/>
  33. <xdb:store xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db" createcollection="true" createsubcollections="true" user="admin" password="admin">
  34. <fileset dir="${dist.exist.db.dir}">
  35. <include name="**"/>
  36. <exclude name="ts4isha/reference/reference.xml"/>
  37. </fileset>
  38. </xdb:store>
  39. <!-- Cannot get this working properly, so reference.xml will have to be done manually -->
  40. <condition property="reference.xml.exists">
  41. <xdb:exist xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha/reference" resource="reference.xml"/>
  42. </condition>
  43. <condition property="data.exists">
  44. <xdb:exist xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha/data"/>
  45. </condition>
  46. <antcall target="store-reference-xml"/>
  47. <antcall target="create-data-collection"/>
  48. </target>
  49. <target name="closing-message">
  50. <echo message="Please restart eXist database for changes to take effect"/>
  51. </target>
  52. <target name="store-reference-xml" unless="reference.xml.exists">
  53. <echo message="Storing reference.xml"/>
  54. <xdb:store xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db" createcollection="true" createsubcollections="true" user="admin" password="admin">
  55. <fileset dir="${dist.exist.db.dir}">
  56. <include name="ts4isha/reference/reference.xml"/>
  57. </fileset>
  58. </xdb:store>
  59. </target>
  60. <target name="create-data-collection" unless="data.exists">
  61. <echo message="Creating data collection"/>
  62. <xdb:create xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha" collection="data" user="admin" password="admin"/>
  63. </target>
  64. <target name="all" depends="init-exist,closing-message" description="Configure eXist for TranscriptStudio"/>
  65. </project>