/install/build.xml
http://transcriptstudio4isha.googlecode.com/ · XML · 74 lines · 64 code · 9 blank · 1 comment · 0 complexity · f3212ecd5d79feae0658604701155eb6 MD5 · raw file
- <?xml version="1.0" encoding="UTF-8"?>
- <project basedir="." default="all" name="transcript-studio">
-
- <description>Isha Foundation Transcript Studio - Configure eXist</description>
-
- <path id="classpath.core">
- <fileset dir="${exist.home}/lib/core">
- <include name="*.jar"/>
- </fileset>
- <pathelement path="${exist.home}/exist.jar"/>
- <pathelement path="${exist.home}/exist-optional.jar"/>
- </path>
-
- <typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
- <classpath refid="classpath.core"/>
- </typedef>
-
- <property name="dist.exist.app.dir" location="exist-app"/>
- <property name="dist.exist.db.dir" location="exist-db"/>
-
- <target name="init-exist">
- <echo message="Copying TranscriptStudio-specific files to eXist installation..."/>
- <copy todir="${exist.home}" includeEmptyDirs="true">
- <fileset dir="${dist.exist.app.dir}">
- <exclude name="tools/wrapper/conf/wrapper.conf"/>
- </fileset>
- </copy>
- <copy todir="${exist.home}">
- <fileset dir="${dist.exist.app.dir}">
- <include name="tools/wrapper/conf/wrapper.conf"/>
- </fileset>
- <filterset>
- <filter token="JAVA_HOME" value="${java.home}"/>
- </filterset>
- </copy>
- <chmod file="${exist.home}/bin/startup.sh" perm="ugo+x"/>
- <echo message="Initialising database..."/>
- <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">
- <fileset dir="${dist.exist.db.dir}">
- <include name="**"/>
- <exclude name="ts4isha/reference/reference.xml"/>
- </fileset>
- </xdb:store>
- <!-- Cannot get this working properly, so reference.xml will have to be done manually -->
- <condition property="reference.xml.exists">
- <xdb:exist xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha/reference" resource="reference.xml"/>
- </condition>
- <condition property="data.exists">
- <xdb:exist xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha/data"/>
- </condition>
- <antcall target="store-reference-xml"/>
- <antcall target="create-data-collection"/>
- </target>
-
- <target name="closing-message">
- <echo message="Please restart eXist database for changes to take effect"/>
- </target>
-
- <target name="store-reference-xml" unless="reference.xml.exists">
- <echo message="Storing reference.xml"/>
- <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">
- <fileset dir="${dist.exist.db.dir}">
- <include name="ts4isha/reference/reference.xml"/>
- </fileset>
- </xdb:store>
- </target>
- <target name="create-data-collection" unless="data.exists">
- <echo message="Creating data collection"/>
- <xdb:create xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha" collection="data" user="admin" password="admin"/>
- </target>
-
- <target name="all" depends="init-exist,closing-message" description="Configure eXist for TranscriptStudio"/>
- </project>