2012-06-19 16:43:31 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
|
|
|
|
|
|
|
<!-- ======================================================================
|
|
|
|
Build script for the ORNG Shindig webapp.
|
|
|
|
|
|
|
|
This can be used on its own, or invoked from the "orng" target of the main build file.
|
|
|
|
====================================================================== -->
|
|
|
|
|
|
|
|
<project name="ORNG-shindig" default="describe">
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: describe
|
|
|
|
================================= -->
|
|
|
|
<target name="describe" description="--> Describe the targets (this is the default).">
|
|
|
|
<echo>
|
|
|
|
all - Runs "clean", then "deploy".
|
|
|
|
clean - Delete all artifacts so the next build will be from scratch.
|
|
|
|
deploy - Configure the application and deploy directly into the Tomcat webapps directory.
|
|
|
|
</echo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: all
|
|
|
|
================================= -->
|
|
|
|
<target name="all" depends="clean, deploy" description="--> Run 'clean', then 'deploy'" />
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: properties
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="properties">
|
2013-01-16 14:54:33 -05:00
|
|
|
<property name="build.properties.file" location="../webapp/config/build.properties" />
|
2012-06-19 16:43:31 +00:00
|
|
|
|
2013-01-16 14:54:33 -05:00
|
|
|
<fail message="You must create a "${build.properties.file}" file.">
|
2012-06-19 16:43:31 +00:00
|
|
|
<condition>
|
|
|
|
<not>
|
2013-01-16 14:54:33 -05:00
|
|
|
<available file="${build.properties.file}" />
|
2012-06-19 16:43:31 +00:00
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
2013-01-16 14:54:33 -05:00
|
|
|
|
|
|
|
<property file="${build.properties.file}" />
|
2012-06-19 16:43:31 +00:00
|
|
|
|
2013-01-16 14:54:33 -05:00
|
|
|
<fail unless="tomcat.home" message="${build.properties.file} must contain a value for tomcat.home" />
|
|
|
|
<fail unless="vitro.home" message="${build.properties.file} must contain a value for vitro.home" />
|
2012-06-19 16:43:31 +00:00
|
|
|
|
2013-01-16 14:54:33 -05:00
|
|
|
<property name="runtime.properties.file" location="${vitro.home}/runtime.properties" />
|
2012-06-19 16:43:31 +00:00
|
|
|
|
2013-01-16 14:54:33 -05:00
|
|
|
<fail message="The runtime properties file "${runtime.properties.file}" does not exist.">
|
2012-06-19 16:43:31 +00:00
|
|
|
<condition>
|
|
|
|
<not>
|
2013-01-16 14:54:33 -05:00
|
|
|
<available file="${runtime.properties.file}" />
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<property file="${runtime.properties.file}" />
|
|
|
|
|
|
|
|
<fail unless="VitroConnection.DataSource.url" message="${runtime.properties.file} must contain a value for VitroConnection.DataSource.url" />
|
|
|
|
<fail unless="VitroConnection.DataSource.username" message="${runtime.properties.file} must contain a value for VitroConnection.DataSource.username" />
|
|
|
|
<fail unless="VitroConnection.DataSource.password" message="${runtime.properties.file} must contain a value for VitroConnection.DataSource.password" />
|
|
|
|
<fail unless="VitroConnection.DataSource.driver" message="${runtime.properties.file} must contain a value for VitroConnection.DataSource.driver" />
|
|
|
|
<fail unless="OpenSocial.shindigURL" message="${runtime.properties.file} must contain a value for OpenSocial.shindigURL" />
|
|
|
|
<fail unless="OpenSocial.tokenService" message="${runtime.properties.file} must contain a value for OpenSocial.tokenService" />
|
|
|
|
<fail unless="OpenSocial.tokenKeyFile" message="${runtime.properties.file} must contain a value for OpenSocial.tokenKeyFile" />
|
|
|
|
|
|
|
|
<fail message="The Vitro home directory "${vitro.home}" does not exist.">
|
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="${vitro.home}" />
|
2012-06-19 16:43:31 +00:00
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
|
2013-01-16 14:54:33 -05:00
|
|
|
<fail message="The Vitro home directory "${vitro.home}" is not writable.">
|
2012-06-19 16:43:31 +00:00
|
|
|
<condition>
|
|
|
|
<not>
|
2013-01-16 14:54:33 -05:00
|
|
|
<isfileselected file="${vitro.home}">
|
2012-06-19 16:43:31 +00:00
|
|
|
<writable />
|
|
|
|
</isfileselected>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<fail message="The Shindig token key file "${OpenSocial.tokenKeyFile}" does not exist.">
|
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="${OpenSocial.tokenKeyFile}" />
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<!-- build directories -->
|
|
|
|
<property name="build.dir" location="./build" />
|
|
|
|
<property name="build.shindig.dir" location="${build.dir}/shindig" />
|
|
|
|
|
|
|
|
<!-- deploy directories -->
|
2013-01-16 14:54:33 -05:00
|
|
|
<property name="shindig.home.dir" location="${vitro.home}/shindig" />
|
2012-06-19 16:43:31 +00:00
|
|
|
<property name="shindig.config.dir" location="${shindig.home.dir}/conf" />
|
|
|
|
<property name="tomcat.webapps.dir" location="${tomcat.home}/webapps" />
|
|
|
|
|
|
|
|
<!-- the Shindig WAR -->
|
|
|
|
<property name="shindig.war.original.file" location="./shindigorng.war" />
|
|
|
|
<property name="shindig.war.deployed.file" location="${tomcat.webapps.dir}/shindigorng.war" />
|
2012-06-24 17:51:08 +00:00
|
|
|
<property name="shindig.war.deployed.dir" location="${tomcat.webapps.dir}/shindigorng" />
|
2012-06-19 16:43:31 +00:00
|
|
|
|
|
|
|
<!-- Shindig properties file -->
|
2012-06-24 17:51:08 +00:00
|
|
|
<property name="shindig.properties.template.file" location="${basedir}/shindigorng.properties.template" />
|
|
|
|
<property name="shindig.properties.modified.file" location="${build.shindig.dir}/shindigorng.properties" />
|
|
|
|
<property name="shindig.properties.deployed.file" location="${shindig.config.dir}/shindigorng.properties" />
|
2012-06-19 16:43:31 +00:00
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: clean
|
|
|
|
================================= -->
|
|
|
|
<target name="clean" depends="properties" description="--> Delete all artifacts">
|
2012-06-19 17:03:24 +00:00
|
|
|
<delete includeemptydirs="true" failonerror="false">
|
2012-06-19 16:43:31 +00:00
|
|
|
<fileset dir="${build.shindig.dir}" />
|
|
|
|
</delete>
|
2012-06-24 17:51:08 +00:00
|
|
|
<delete includeemptydirs="true" failonerror="false">
|
|
|
|
<fileset dir="${shindig.war.deployed.dir}" />
|
|
|
|
</delete>
|
2012-06-19 16:43:31 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: prepare
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="prepare" depends="properties">
|
|
|
|
<mkdir dir="${build.dir}" />
|
|
|
|
<mkdir dir="${build.shindig.dir}" />
|
|
|
|
|
|
|
|
<mkdir dir="${shindig.home.dir}" />
|
|
|
|
<mkdir dir="${shindig.config.dir}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: modifyPropertiesFile
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="modifyPropertiesFile" depends="properties, prepare">
|
|
|
|
<copy file="${shindig.properties.template.file}" toFile="${shindig.properties.modified.file}">
|
|
|
|
<filterset>
|
|
|
|
<filter token="TOKEN_KEY_FILE" value="${OpenSocial.tokenKeyFile}" />
|
|
|
|
<filter token="DATA_SOURCE_URL" value="${VitroConnection.DataSource.url}" />
|
|
|
|
<filter token="DATA_SOURCE_USERNAME" value="${VitroConnection.DataSource.username}" />
|
|
|
|
<filter token="DATA_SOURCE_PASSWORD" value="${VitroConnection.DataSource.password}" />
|
|
|
|
<filter token="DATA_SOURCE_DRIVER" value="${VitroConnection.DataSource.driver}" />
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: deploy
|
|
|
|
================================= -->
|
2012-06-24 17:51:08 +00:00
|
|
|
<target name="deploy" depends="modifyPropertiesFile" description="--> Deploy the application directly into the Tomcat webapps directory.">
|
2012-06-19 16:43:31 +00:00
|
|
|
<copy file="${shindig.properties.modified.file}" tofile="${shindig.properties.deployed.file}" />
|
2012-06-24 17:51:08 +00:00
|
|
|
<copy file="${shindig.war.original.file}" tofile="${shindig.war.deployed.file}" overwrite="true" />
|
2012-06-19 16:43:31 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|