+++ /dev/null
-<project name="app-tenant-mgmt" default="clone-tenant" basedir=".">
- <description>Manage Application layer folders and files containing per-tenant configurations</description>
-
- <!-- Location of the 'tenants' directory for this CollectionSpace source code layer. -->
- <property name="src.dir" value="${basedir}" />
- <property name="tenants.dir" value="${src.dir}/services/common/src/main/cspace/config/services/tenants"/>
-
- <!-- Locations of the tenant folders for the
- template tenant and newly-cloned tenant. -->
- <property name="template.tenant.dir" value="${tenants.dir}/${template.tenant.shortname}"/>
- <property name="tenant.dir" value="${tenants.dir}/${tenant.shortname}"/>
-
- <!-- Location of the tenant bindings delta files for the
- template tenant and newly-cloned tenant. -->
- <property name="tenant.bindings.delta.suffix" value="-tenant-bindings.delta.xml"/>
- <property name="template.bindings.delta.file"
- value="${template.tenant.dir}/${template.tenant.shortname}${tenant.bindings.delta.suffix}"/>
- <property name="tenant.bindings.delta.file"
- value="${tenant.dir}/${tenant.shortname}${tenant.bindings.delta.suffix}"/>
-
- <!-- Imports a set of utility routines for managing tenant folders
- from a separate Ant buildfile.
- See http://wiki.apache.org/ant/NewAntFeaturesInDetail/Import -->
- <import file="./tenant-utils-build.xml"/>
-
- <!-- This target inherits from an existing target in the imported
- utility routines buildfile, and adds its own behavior specific to this
- CollectionSpace source code layer. -->
- <target name="rename-files-in-cloned-tenant" depends="tenant-utils.rename-files-in-cloned-tenant">
- <move todir="${tenants.dir}/${tenant.shortname}" includeemptydirs="false">
- <fileset dir="${tenants.dir}/${tenant.shortname}"/>
- <mapper type="regexp" from="^(.*?)${template.tenant.shortname}(.*)$" to="\1${tenant.shortname}\2"/>
- </move>
- </target>
-
- <!-- This target inherits from an (essentially empty) target in the imported
- utility routines buildfile, and adds its own behavior specific to this
- CollectionSpace source code layer. -->
- <target name="delete-files-in-cloned-tenant"
- depends="tenant-utils.delete-files-in-cloned-tenant,
- delete-obsolete-tenant-bindings-delta,
- delete-merged-tenant-bindings">
- </target>
-
- <!-- TODO: Delete the (obsolete) tenant-bindings.delta.xml file, if any,
- as this file is used only by CollectionSpace 3.3 and earlier versions. -->
- <target name="delete-obsolete-tenant-bindings-delta">
- <delete file="${tenant.dir}/tenant-bindings.delta.xml" failonerror="false"/>
- </target>
-
- <target name="delete-merged-tenant-bindings">
- <delete file="${tenant.dir}/tenant-bindings.merged.xml" failonerror="false"/>
- </target>
-
- <!-- This target inherits from an (essentially empty) target in the imported
- utility routines buildfile, and adds its own behavior specific to this
- CollectionSpace source code layer. -->
- <target name="update-text-in-cloned-tenant"
- depends="tenant-utils.update-text-in-cloned-tenant,
- update-text-in-tenant-bindings-delta">
- </target>
-
- <target name="update-text-in-tenant-bindings-delta"
- depends="update-tenant-id-in-tenant-bindings-delta,
- remove-enclosing-xml-comments-in-tenant-bindings-delta">
- </target>
-
- <target name="update-tenant-id-in-tenant-bindings-delta">
- <replaceregexp
- file="${tenant.bindings.delta.file}"
- match="<tenant:tenantBinding id="(.*)">"
- replace="<tenant:tenantBinding id="${tenant.id}">"/>
- </target>
-
- <!-- Remove opening and closing XML comment tags, when found
- on lines by themselves: the convention currently used
- in the tenant bindings delta file. -->
- <target name="remove-enclosing-xml-comments-in-tenant-bindings-delta">
- <replaceregexp
- file="${tenant.bindings.delta.file}"
- match="^\s*?<!--\s*$"
- replace=""
- byline="true"
- flags="gm"/>
- <replaceregexp
- file="${tenant.bindings.delta.file}"
- match="^\s*?-->\s*$"
- replace=""
- byline="true"
- flags="gm"/>
- </target>
-
- <!-- This target inherits from an (essentially empty) target in the imported
- utility routines buildfile, and adds its own behavior specific to this
- CollectionSpace source code layer. -->
- <target name="check-tenant-extended-properties"
- depends="tenant-utils.check-tenant-extended-properties">
- <!-- ID of the new tenant to create -->
- <antcall target="check-property-is-defined">
- <param name="property-to-check" value="tenant.id"/>
- </antcall>
- <antcall target="check-property-value-is-not-blank">
- <param name="property-to-check" value="tenant.id"/>
- <param name="property-to-check-value" value="${tenant.id}"/>
- </antcall>
- <echo message="tenant.id=${tenant.id}"/>
- </target>
-
-</project>
\ No newline at end of file
<arg value="${mvn.opts}" />
</exec>
</target>
+
+ <!-- ################################################
+ Tenant management-related properties and targets
+ ################################################ -->
+
+ <!-- Location of the 'tenants' directory for this CollectionSpace source code layer. -->
+ <property name="src.dir" value="${basedir}" />
+ <property name="tenants.dir" value="${src.dir}/services/common/src/main/cspace/config/services/tenants"/>
+
+ <!-- Locations of the tenant folders for the
+ template tenant and newly-cloned tenant. -->
+ <property name="template.tenant.dir" value="${tenants.dir}/${template.tenant.shortname}"/>
+ <property name="tenant.dir" value="${tenants.dir}/${tenant.shortname}"/>
+
+ <!-- Location of the tenant bindings delta files for the
+ template tenant and newly-cloned tenant. -->
+ <property name="tenant.bindings.delta.suffix" value="-tenant-bindings.delta.xml"/>
+ <property name="template.bindings.delta.file"
+ value="${template.tenant.dir}/${template.tenant.shortname}${tenant.bindings.delta.suffix}"/>
+ <property name="tenant.bindings.delta.file"
+ value="${tenant.dir}/${tenant.shortname}${tenant.bindings.delta.suffix}"/>
+
+ <!-- Imports a set of utility routines for managing tenant folders
+ from a separate Ant buildfile.
+ See http://wiki.apache.org/ant/NewAntFeaturesInDetail/Import -->
+ <import file="./tenant-utils-build.xml"/>
+
+ <!-- This target inherits from an existing target in the imported
+ utility routines buildfile, and adds its own behavior specific to this
+ CollectionSpace source code layer. -->
+ <target name="rename-files-in-cloned-tenant" depends="tenant-utils.rename-files-in-cloned-tenant">
+ <move todir="${tenants.dir}/${tenant.shortname}" includeemptydirs="false">
+ <fileset dir="${tenants.dir}/${tenant.shortname}"/>
+ <mapper type="regexp" from="^(.*?)${template.tenant.shortname}(.*)$" to="\1${tenant.shortname}\2"/>
+ </move>
+ </target>
+
+ <!-- This target inherits from an (essentially empty) target in the imported
+ utility routines buildfile, and adds its own behavior specific to this
+ CollectionSpace source code layer. -->
+ <target name="delete-files-in-cloned-tenant"
+ depends="tenant-utils.delete-files-in-cloned-tenant,
+ delete-obsolete-tenant-bindings-delta,
+ delete-merged-tenant-bindings">
+ </target>
+
+ <!-- TODO: Delete the (obsolete) tenant-bindings.delta.xml file, if any,
+ as this file is used only by CollectionSpace 3.3 and earlier versions. -->
+ <target name="delete-obsolete-tenant-bindings-delta">
+ <delete file="${tenant.dir}/tenant-bindings.delta.xml" failonerror="false"/>
+ </target>
+
+ <target name="delete-merged-tenant-bindings">
+ <delete file="${tenant.dir}/tenant-bindings.merged.xml" failonerror="false"/>
+ </target>
+
+ <!-- This target inherits from an (essentially empty) target in the imported
+ utility routines buildfile, and adds its own behavior specific to this
+ CollectionSpace source code layer. -->
+ <target name="update-text-in-cloned-tenant"
+ depends="tenant-utils.update-text-in-cloned-tenant,
+ update-text-in-tenant-bindings-delta">
+ </target>
+
+ <target name="update-text-in-tenant-bindings-delta"
+ depends="update-tenant-id-in-tenant-bindings-delta,
+ remove-enclosing-xml-comments-in-tenant-bindings-delta">
+ </target>
+
+ <target name="update-tenant-id-in-tenant-bindings-delta">
+ <replaceregexp
+ file="${tenant.bindings.delta.file}"
+ match="<tenant:tenantBinding id="(.*)">"
+ replace="<tenant:tenantBinding id="${tenant.id}">"/>
+ </target>
+
+ <!-- Remove opening and closing XML comment tags, when found
+ on lines by themselves: the convention currently used
+ in the tenant bindings delta file. -->
+ <target name="remove-enclosing-xml-comments-in-tenant-bindings-delta">
+ <replaceregexp
+ file="${tenant.bindings.delta.file}"
+ match="^\s*?<!--\s*$"
+ replace=""
+ byline="true"
+ flags="gm"/>
+ <replaceregexp
+ file="${tenant.bindings.delta.file}"
+ match="^\s*?-->\s*$"
+ replace=""
+ byline="true"
+ flags="gm"/>
+ </target>
+
+ <!-- This target inherits from an (essentially empty) target in the imported
+ utility routines buildfile, and adds its own behavior specific to this
+ CollectionSpace source code layer. -->
+ <target name="check-tenant-extended-properties"
+ depends="tenant-utils.check-tenant-extended-properties">
+ <!-- ID of the new tenant to create -->
+ <antcall target="check-property-is-defined">
+ <param name="property-to-check" value="tenant.id"/>
+ </antcall>
+ <antcall target="check-property-value-is-not-blank">
+ <param name="property-to-check" value="tenant.id"/>
+ <param name="property-to-check-value" value="${tenant.id}"/>
+ </antcall>
+ <echo message="tenant.id=${tenant.id}"/>
+ </target>
</project>