Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
385 lines (284 sloc) 13 KB
<?xml version="1.0"?>
<project default="deploy" basedir="." name="GAR package for delivery into GT4.0.x">
<description>GAR package for delivery into GT4.0.x</description>
<!-- load user nimbus.build.properties file, if it exists -->
<property file="${user.home}/nimbus.build.properties"/>
<!-- load some defaults from colocated build.properties file -->
<property file="build.properties"/>
<!-- *******************************************************************
MODULE NAME
******************************************************************* -->
<target name="disp">
<echo message="**** Module: ${basedir}" />
</target>
<!-- *******************************************************************
LOCATE GT DEPENDENCIES
******************************************************************* -->
<property environment="env"/>
<property name="abs.deploy.dir"
location="${env.GLOBUS_LOCATION}"/>
<property name="gt4_0.lib.dir" location="${abs.deploy.dir}/lib"/>
<property name="build.packages"
location="${nimbus.messaging.gt4_0.gar.build.packages.xml}"/>
<!-- *******************************************************************
GT RELATED NAMES
******************************************************************* -->
<!-- gar.name -->
<property name="gar.name"
value="${nimbus.messaging.gt4_0.gar.garname}"/>
<!-- garjars.id -->
<fileset dir="${nimbus.messaging.gt4_0.gar.build.lib.dir}" id="garjars"/>
<property name="garjars.id" value="garjars"/>
<!-- garshare.id -->
<fileset dir="${nimbus.messaging.gt4_0.gar.build.share.dir}" id="garshare"/>
<property name="garshare.id" value="garshare"/>
<!-- not used for GAR that broker uses -->
<target name="init-deployment-properties">
<!-- garetc.id -->
<fileset dir="${nimbus.messaging.gt4_0.gar.build.etc.dir}" id="garEtc"/>
<property name="garetc.id" value="garEtc"/>
<property name="garserverdeployment.file"
location="${nimbus.messaging.gt4_0.gar.wsddfile}"/>
<property name="garjndiconfigdeployment.file"
location="${nimbus.messaging.gt4_0.gar.jndifile}"/>
</target>
<!-- *********************
unused GAR properties
setting these to avoid build warning messages from GT...
********************* -->
<!-- garschema.id -->
<fileset dir="${nimbus.messaging.gt4_0.gar.build.schema.dir}" id="garschema"/>
<property name="garschema.id" value="garschema"/>
<!-- gardocs.id -->
<fileset dir="${nimbus.messaging.gt4_0.gar.build.docs.dir}" id="gardocs"/>
<property name="gardocs.id" value="gardocs"/>
<!-- garbin.id -->
<fileset dir="${nimbus.messaging.gt4_0.gar.build.bin.dir}" id="garbin"/>
<property name="garbin.id" value="garbin"/>
<!-- *******************************************************************
INITIALIZE
******************************************************************* -->
<target name="init">
<mkdir dir="${nimbus.messaging.gt4_0.gar.dist.dir}"/>
<mkdir dir="${nimbus.messaging.gt4_0.gar.build.dir}"/>
<mkdir dir="${nimbus.messaging.gt4_0.gar.build.lib.dir}"/>
<mkdir dir="${nimbus.messaging.gt4_0.gar.build.etc.dir}"/>
<mkdir dir="${nimbus.messaging.gt4_0.gar.build.share.dir}"/>
<mkdir dir="${nimbus.messaging.gt4_0.gar.build.schema.dir}"/>
<mkdir dir="${nimbus.messaging.gt4_0.gar.build.docs.dir}"/>
<mkdir dir="${nimbus.messaging.gt4_0.gar.build.bin.dir}"/>
</target>
<!-- *******************************************************************
COPIES FOR LIB DIRECTORY
******************************************************************* -->
<target name="lib_copies" depends="base_lib_copies">
<copy todir="${nimbus.messaging.gt4_0.gar.build.lib.dir}">
<fileset dir="${nimbus.service.main.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.metadata-server.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.libservices.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
</copy>
</target>
<target name="base_lib_copies" depends="init">
<copy todir="${nimbus.messaging.gt4_0.gar.build.lib.dir}">
<fileset dir="${nimbus.baselibservices.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.service.api.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.authzdbmodule.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.querygenmodule.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.autocommon.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.messaging.gt4_0.common.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.messaging.gt4_0.msgbridge.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.messaging.gt4_0-elastic.msgbridge.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
<fileset dir="${nimbus.messaging.query.dist.dir}">
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
</copy>
</target>
<!-- *******************************************************************
COPIES FOR ETC DIRECTORY
******************************************************************* -->
<target name="etc_copies" depends="base_etc_copies">
<copy todir="${nimbus.messaging.gt4_0.gar.build.etc.dir}">
<fileset dir="${nimbus.service.main.etc.dir}" />
</copy>
</target>
<target name="base_etc_copies" depends="init">
<copy todir="${nimbus.messaging.gt4_0.gar.build.etc.dir}">
<fileset dir="${nimbus.messaging.gt4_0-elastic.etc.dir}" />
</copy>
<copy todir="${nimbus.messaging.gt4_0.gar.build.etc.dir}">
<fileset dir="${nimbus.messaging.query.etc.dir}" />
</copy>
<copy todir="${nimbus.messaging.gt4_0.gar.build.etc.dir}">
<fileset dir="${nimbus.messaging.gt4_0.gar.etc.dir}" />
</copy>
</target>
<!-- *******************************************************************
COPIES FOR SHARE DIRECTORY
******************************************************************* -->
<target name="share_copies" depends="init">
<copy todir="${nimbus.messaging.gt4_0.gar.build.share.dir}">
<fileset dir="${nimbus.service.main.share.dir}" />
</copy>
</target>
<!-- *******************************************************************
CLEAN
******************************************************************* -->
<target name="clean">
<delete dir="${nimbus.messaging.gt4_0.gar.build.dir}"/>
<delete dir="${nimbus.messaging.gt4_0.gar.dist.dir}"/>
<delete dir="tmp"/>
<echo message="Cleaned: ${basedir}" />
</target>
<!-- *******************************************************************
CREATE DISTRIBUTION
******************************************************************* -->
<target name="_dist" depends="init-deployment-properties, lib_copies, etc_copies, share_copies">
<ant antfile="${build.packages}" target="makeGar">
<property name="forget.client-deploy.wsdd" value="x" />
<reference refid="${garjars.id}"/>
<reference refid="${garetc.id}"/>
<reference refid="${garshare.id}"/>
<reference refid="${garschema.id}"/>
<reference refid="${gardocs.id}"/>
<reference refid="${garbin.id}"/>
<!-- makeGar is also looking at:
- gar.name
- garserverdeployment.file
- garjndiconfigdeployment.file
-->
</ant>
<delete dir="tmp" />
</target>
<target name="dist">
<echo message="**** Module: ${basedir}" />
<echo>Building: ${nimbus.messaging.gt4_0.gar.print-noun}</echo>
<antcall target="clean" /> <!-- every time is a brand new time -->
<antcall target="_dist" />
<echo>Built: ${nimbus.messaging.gt4_0.gar.print-noun}
</echo>
</target>
<!-- *******************************************************************
DEPLOY ONLY JARS (development target)
******************************************************************* -->
<target name="justjars" depends="lib_copies">
<echo message="Copying JARs: ${basedir}" />
<copy todir="${gt4_0.lib.dir}" >
<fileset refid="garjars" />
</copy>
</target>
<!-- *******************************************************************
DEPLOYMENT
******************************************************************* -->
<target name="assessGarPresence">
<available property="garIsPresent"
type="file"
file="${gar.name}" />
</target>
<target name="gar.not.present"
depends="assessGarPresence"
unless="garIsPresent">
<echo>
***************** ERROR *****************
Cannot find archive to install: ${gar.name}
Did you build? Use the build-and-install script.
</echo>
<fail message="Cannot find archive to install: ${gar.name}" />
</target>
<target name="_deploy" depends="gar.not.present">
<ant antfile="${build.packages}" target="deployGar">
<property name="gar.id" value="${nimbus.messaging.gt4_0.gar.package.name}"/>
<property name="createBackup" value="true" />
</ant>
<delete dir="tmp"/>
</target>
<target name="deploy" depends="disp">
<echo>Installing: ${nimbus.messaging.gt4_0.gar.print-noun}</echo>
<antcall target="_deploy" />
<echo>Installed: ${nimbus.messaging.gt4_0.gar.print-noun}
</echo>
</target>
<target name="assessDeployed">
<available property="isDeployed"
type="dir"
file="${abs.deploy.dir}/etc/globus_packages/${nimbus.messaging.gt4_0.gar.package.name}" />
<condition property="isNotDeployed" value="true">
<not><isset property="isDeployed" /></not>
</condition>
</target>
<target name="printDeployed"
depends="assessDeployed"
unless="isDeployed">
<echo message="Already undeployed: ${nimbus.messaging.gt4_0.gar.package.name}"/>
</target>
<target name="assessPersistence">
<property name="persistence.dir"
value="${abs.deploy.dir}/var/${nimbus.messaging.gt4_0.gar.package.name}" />
<available property="persistenceExists"
type="dir"
file="${persistence.dir}" />
<condition property="persistenceDoesNotExist" value="true">
<not><isset property="persistenceExists" /></not>
</condition>
</target>
<target name="printPersistence"
depends="assessPersistence"
unless="persistenceDoesNotExist">
<echo message="Persistence directory exists @ ${persistence.dir}" />
</target>
<target name="printNoPersistence"
depends="assessPersistence"
unless="persistenceExists">
<echo message="Persistence directory does not exist @ ${persistence.dir}" />
</target>
<target name="deletePersistence"
depends="printPersistence,printNoPersistence"
unless="persistenceDoesNotExist">
<echo message="Deleting persistence directory @ ${persistence.dir}" />
<delete dir="${persistence.dir}" />
<echo message="Done." />
</target>
<target name="_undeploy" depends="printDeployed" unless="isNotDeployed">
<ant antfile="${build.packages}" target="undeployGar">
<property name="gar.id" value="${nimbus.messaging.gt4_0.gar.package.name}"/>
</ant>
<echo message="Undeployed: ${nimbus.messaging.gt4_0.gar.package.name}"/>
</target>
<target name="undeploy">
<antcall target="_undeploy" />
<antcall target="printPersistence" />
</target>
</project>
Something went wrong with that request. Please try again.