<description>
CollectionSpace UI Component build
</description>
-
+
<!-- set global properties for this build -->
<property name="services.trunk" value=".."/>
-
+
<!-- Enviornment should be declared before reading build.properties -->
<property environment="env" />
<property file="${services.trunk}/build.properties" />
-
+
<!--
Properties set in this file will override all corresponding <property> definitions
made in this Ant file.
<property name="cspace.profile.herbarium.default.id" value="4000"/>
<property name="cspace.profile.lhmc.default.id" value="501"/>
<property name="cspace.profile.materials.default.id" value="2000"/>
-
+
<condition property="osfamily-unix">
<os family="unix" />
</condition>
<condition property="osfamily-windows">
<os family="windows" />
</condition>
-
+
<target name="package" depends="deploy">
</target>
-->
<echo>The value of primary.profile.plugin.name is ${primary.profile.plugin.name}</echo>
-
+
<property name="primary.profile.plugin.version" value="${env.CSPACE_PRIMARY_UIPLUGIN_VERSION}" />
- <property name="primary.profile.plugin.package" value="${env.CSPACE_PRIMARY_UIPLUGIN_PACKAGE}" />
+ <property name="primary.profile.plugin.package" value="${env.CSPACE_PRIMARY_UIPLUGIN_PACKAGE}" />
<property name="primary.profile.plugin.dir" value="${env.CSPACE_PRIMARY_UIPLUGIN_DIR}" />
- <property name="primary.profile.plugin.basename" value="${env.CSPACE_PRIMARY_UIPLUGIN_BASENAME}" />
+ <property name="primary.profile.plugin.basename" value="${env.CSPACE_PRIMARY_UIPLUGIN_BASENAME}" />
<property name="primary.profile.plugin.tenantid" value="${env.CSPACE_PRIMARY_UIPLUGIN_TENANTID}" />
<property name="primary.profile.plugin.message.title" value="${env.CSPACE_PRIMARY_UIPLUGIN_TITLE_MESSAGE}" />
<property name="primary.profile.plugin.message.about" value="${env.CSPACE_PRIMARY_UIPLUGIN_ABOUT_MESSAGE}" />
<!-- Derived from the other props -->
<property name="primary.profile.plugin.js" value="${primary.profile.plugin.name}@${primary.profile.plugin.version}.min.js" />
-
+
<!-- Set the logo URL value base on the env var CSPACE_PRIMARY_UIPLUGIN_LOGO value.
#
# Use empty string or "undefined" for default logo, a full URL to an image file, or a partial URL path to a local image resource
-->
<condition property="primary.profile.plugin.logo.final" value="undefined">
<matches pattern="^undefined$" string="${primary.profile.plugin.logo}"/>
- </condition>
+ </condition>
<condition property="primary.profile.plugin.logo.final" value="undefined">
<matches pattern="^$" string="${primary.profile.plugin.logo}"/>
</condition>
<condition property="primary.profile.plugin.logo.final" value="'${primary.profile.plugin.logo}'">
<matches pattern="^(?!\s*$).+" string="primary.profile.plugin.logo"/>
</condition>
-
+
<!--
-
+
-->
<condition property="primary.profile.plugin.message.about.final" value="undefined">
<matches pattern="^undefined$" string="${primary.profile.plugin.message.about}"/>
- </condition>
+ </condition>
<condition property="primary.profile.plugin.message.about.final" value="undefined">
<matches pattern="^$" string="${primary.profile.plugin.message.about}"/>
</condition>
<condition property="primary.profile.plugin.message.about.final" value="`${primary.profile.plugin.message.about}`">
<matches pattern="^(?!\s*$).+" string="${primary.profile.plugin.message.about}"/>
</condition>
-
+
<!-- Test to see if "core" tenant is being asked for, since we'll need to do something special for it. -->
<condition property="is.primary.core" value="true">
<matches pattern="^cspaceUI$" string="${primary.profile.plugin.name}"/>
<property name="webapp.template.dir" value="cspace#core#template" />
<antcall target="deploy_primary" />
</target>
-
+
<!--
Since "core" is a special tenant, we need to do a special check
-->
<target name="deploy_other_as_generic" unless="${is.primary.core}">
- <property name="webapp.template.dir" value="cspace#template" />
- <antcall target="deploy_primary" />
+ <property name="webapp.template.dir" value="cspace#template" />
+ <antcall target="deploy_primary" />
</target>
-
+
<target name="deploy_generic" depends="set_primary">
<antcall target="deploy_core_as_generic" />
<antcall target="deploy_other_as_generic" />
</target>
-
+
<!--
Primary tenant - Use the props to decide what tenant plugin to deploy
-->
- <target name="download_primary" if="${primary.profile.plugin.enabled}">
+ <target name="download_primary" if="${primary.profile.plugin.enabled}">
<!-- Default primary tenant -->
<echo>-o ${primary.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/${primary.profile.plugin.package}@${primary.profile.plugin.version}/dist/${primary.profile.plugin.name}.min.js</echo>
<exec executable="curl" failonerror="true">
</target>
<target name="deploy_primary" depends="download_primary" if="${primary.profile.plugin.enabled}" description="deploy cspace ui to ${jee.server.cspace}">
- <filter token="UI_VERSION" value="${cspace.ui.version}" />
+ <filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="PLUGIN_VERSION" value="${primary.profile.plugin.version}" />
<filter token="PLUGIN_NAME" value="${primary.profile.plugin.name}" />
<filter token="PLUGIN_BASENAME" value="${primary.profile.plugin.basename}" />
<filter token="MESSAGE_TITLE" value="${primary.profile.plugin.message.title}" />
<filter token="LOGO" value="${primary.profile.plugin.logo.final}" />
<filter token="ABOUT" value="${primary.profile.plugin.message.about.final}" />
-
+
<copy todir="${jee.deploy.cspace}/${primary.profile.plugin.dir}" filtering="true" overwrite="true">
<fileset dir="${webapp.template.dir}"/>
</copy>
<move file="${primary.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
- </target>
-
- <target name="undeploy_primary" if="${primary.profile.plugin.enabled}" depends="set_primary" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ </target>
+
+ <target name="undeploy_primary" if="${primary.profile.plugin.enabled}" depends="set_primary" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<delete dir="${jee.deploy.cspace}/${primary.profile.plugin.dir}" />
<delete file="${jee.deploy.cspace.ui.shared}/${primary.profile.plugin.js}" />
- </target>
-
+ </target>
+
<!--
Common UI components
-->
<arg line="-o ${cspace.ui.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui@${cspace.ui.version}/dist/${cspace.ui.webapp.name}.min.js"/>
</exec>
</target>
-
+
<target name="deploy_common" depends="download_common">
<move file="${cspace.ui.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
-
+
<target name="undeploy_common" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- Core webapp -->
- <delete file="${jee.deploy.cspace.ui.shared}/${cspace.ui.js}" />
+ <delete file="${jee.deploy.cspace.ui.shared}/${cspace.ui.js}" />
</target>
-
+
<!--
Core UI components
-->
<target name="download_core">
<!-- Core UI -->
<echo>Downloading from https://unpkg.com/cspace-ui@${cspace.ui.version}/dist/${cspace.ui.webapp.name}.min.js</echo>
-
+
<exec executable="curl" failonerror="true">
<arg line="-o ${cspace.ui.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui@${cspace.ui.version}/dist/${cspace.ui.webapp.name}.min.js"/>
</exec>
<move file="${cspace.ui.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
-
+
<target name="deploy_core" depends="download_core" unless="${env.CSPACE_CORE_CREATE_DISABLED_OPT}">
<property name="cspace.profile.core.default.id" value="${cspace.ui.tenantid}" />
<condition property="cspace.profile.core.default.id" value="1234">
- <not>
+ <not>
<isset property="cspace.profile.core.default.id"/>
</not>
- </condition>
-
+ </condition>
+
<!-- Core UI Webapp-->
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="PLUGIN_BASENAME" value="${cspace.ui.basename}" />
<filter token="TENANT_ID" value="${cspace.profile.core.default.id}" />
<filter token="MESSAGE_TITLE" value="${cspace.ui.message.title}" />
<filter token="LOGO" value="${cspace.ui.logo}" />
-
+
<copy todir="${jee.deploy.cspace}/${cspace.ui.webapp}" filtering="true" overwrite="true">
<fileset dir="${cspace.ui.webapp}"/>
</copy>
</target>
-
+
<target name="undeploy_core" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- Core webapp -->
<delete dir="${jee.deploy.cspace}/${cspace.ui.webapp}" />
- <delete file="${jee.deploy.cspace.ui.shared}/${cspace.ui.js}" />
+ <delete file="${jee.deploy.cspace.ui.shared}/${cspace.ui.js}" />
</target>
-
+
<!--
Public Art Tenant
-->
<arg line="-o ${publicart.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui-plugin-profile-publicart@${publicart.profile.plugin.version}/dist/${publicart.profile.plugin.name}.min.js"/>
</exec>
</target>
-
+
<target name="deploy_publicart" depends="download_publicart" unless="${env.CSPACE_PUBLICART_CREATE_DISABLED_OPT}">
<!-- Public Art Profile -->
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="TENANT_ID" value="${publicart.profile.plugin.tenantid}" />
<filter token="MESSAGE_TITLE" value="${publicart.profile.plugin.message.title}" />
<filter token="LOGO" value="${publicart.profile.plugin.logo}" />
-
+
<copy todir="${jee.deploy.cspace}/${publicart.profile.plugin.dir}" filtering="true" overwrite="true">
<fileset dir="${publicart.profile.plugin.dir}"/>
</copy>
<property name="anthro.profile.plugin.dir" value="cspace#anthro" />
<property name="anthro.profile.plugin.js" value="${anthro.profile.plugin.name}@${anthro.profile.plugin.version}.min.js" />
<property name="anthro.profile.plugin.basename" value="/cspace/anthro" />
-
+
<target name="download_anthro" unless="${env.CSPACE_ANTHRO_CREATE_DISABLED_OPT}">
<!-- Anthropology Profile -->
<exec executable="curl" failonerror="true">
<arg line="-o ${anthro.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui-plugin-profile-anthro@${anthro.profile.plugin.version}/dist/${anthro.profile.plugin.name}.min.js"/>
</exec>
</target>
-
+
<target name="deploy_anthro" unless="${env.CSPACE_ANTHRO_CREATE_DISABLED_OPT}" depends="download_anthro">
<!-- Anthropology Profile -->
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="TENANT_ID" value="${anthro.profile.plugin.tenantid}" />
<filter token="MESSAGE_TITLE" value="${anthro.profile.plugin.message.title}" />
<filter token="LOGO" value="${anthro.profile.plugin.logo}" />
-
+
<copy todir="${jee.deploy.cspace}/${anthro.profile.plugin.dir}" filtering="true" overwrite="true">
<fileset dir="${anthro.profile.plugin.dir}"/>
</copy>
<move file="${anthro.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
-
+
<target name="undeploy_anthro" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- Anthropology Profile -->
<delete dir="${jee.deploy.cspace}/${anthro.profile.plugin.dir}" />
<delete file="${jee.deploy.cspace.ui.shared}/${anthro.profile.plugin.js}" />
</target>
-
+
+ <!--
+ Bonsai Tenant
+ -->
+ <property name="bonsai.profile.plugin.tenantid" value="${cspace.profile.bonsai.default.id}" />
+ <property name="bonsai.profile.plugin.message.title" value="Default Bonsai Profile" />
+ <property name="bonsai.profile.plugin.logo" value="undefined" />
+ <property name="bonsai.profile.plugin.version" value="latest" />
+ <property name="bonsai.profile.plugin.name" value="cspaceUIPluginProfileBonsai" />
+ <property name="bonsai.profile.plugin.dir" value="cspace#bonsai" />
+ <property name="bonsai.profile.plugin.js" value="${bonsai.profile.plugin.name}@${bonsai.profile.plugin.version}.min.js" />
+ <property name="bonsai.profile.plugin.basename" value="/cspace/bonsai" />
+
+ <target name="download_bonsai" unless="${env.CSPACE_BONSAI_CREATE_DISABLED_OPT}">
+ <!-- Bonsai Profile -->
+ <exec executable="curl" failonerror="true">
+ <arg line="-o ${bonsai.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui-plugin-profile-bonsai@${bonsai.profile.plugin.version}/dist/${bonsai.profile.plugin.name}.min.js"/>
+ </exec>
+ </target>
+
+ <target name="deploy_bonsai" unless="${env.CSPACE_BONSAI_CREATE_DISABLED_OPT}" depends="download_bonsai">
+ <!-- Bonsai Profile -->
+ <filter token="UI_VERSION" value="${cspace.ui.version}" />
+ <filter token="PLUGIN_VERSION" value="${bonsai.profile.plugin.version}" />
+ <filter token="PLUGIN_BASENAME" value="${bonsai.profile.plugin.basename}" />
+ <filter token="TENANT_ID" value="${bonsai.profile.plugin.tenantid}" />
+ <filter token="MESSAGE_TITLE" value="${bonsai.profile.plugin.message.title}" />
+ <filter token="LOGO" value="${bonsai.profile.plugin.logo}" />
+
+ <copy todir="${jee.deploy.cspace}/${bonsai.profile.plugin.dir}" filtering="true" overwrite="true">
+ <fileset dir="${bonsai.profile.plugin.dir}"/>
+ </copy>
+ <move file="${bonsai.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
+ </target>
+
+ <target name="undeploy_bonsai" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ <!-- Bonsai Profile -->
+ <delete dir="${jee.deploy.cspace}/${bonsai.profile.plugin.dir}" />
+ <delete file="${jee.deploy.cspace.ui.shared}/${bonsai.profile.plugin.js}" />
+ </target>
+
<!--
Fine and Contemporary Art Tenant
-->
<property name="fcart.profile.plugin.dir" value="cspace#fcart" />
<property name="fcart.profile.plugin.js" value="${fcart.profile.plugin.name}@${fcart.profile.plugin.version}.min.js" />
<property name="fcart.profile.plugin.basename" value="/cspace/fcart" />
-
+
<target name="download_fcart" unless="${env.CSPACE_FCART_CREATE_DISABLED_OPT}">
<!-- FCart Profile -->
<exec executable="curl" failonerror="true">
<arg line="-o ${fcart.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui-plugin-profile-fcart@${fcart.profile.plugin.version}/dist/${fcart.profile.plugin.name}.min.js"/>
</exec>
</target>
-
+
<target name="deploy_fcart" unless="${env.CSPACE_FCART_CREATE_DISABLED_OPT}" depends="download_fcart">
<!-- FCart Profile -->
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="TENANT_ID" value="${fcart.profile.plugin.tenantid}" />
<filter token="MESSAGE_TITLE" value="${fcart.profile.plugin.message.title}" />
<filter token="LOGO" value="${fcart.profile.plugin.logo}" />
-
+
<copy todir="${jee.deploy.cspace}/${fcart.profile.plugin.dir}" filtering="true" overwrite="true">
<fileset dir="${fcart.profile.plugin.dir}"/>
</copy>
<move file="${fcart.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
-
+
<target name="undeploy_fcart" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- FCart Profile -->
<delete dir="${jee.deploy.cspace}/${fcart.profile.plugin.dir}" />
<delete file="${jee.deploy.cspace.ui.shared}/${fcart.profile.plugin.js}" />
</target>
+ <!--
+ Local History and Material Culture Tenant
+ -->
+ <property name="lhmc.profile.plugin.tenantid" value="${cspace.profile.lhmc.default.id}" />
+ <property name="lhmc.profile.plugin.message.title" value="Default Local History and Material Culture Profile" />
+ <property name="lhmc.profile.plugin.logo" value="undefined" />
+ <property name="lhmc.profile.plugin.version" value="latest" />
+ <property name="lhmc.profile.plugin.name" value="cspaceUIPluginProfileLHMC" />
+ <property name="lhmc.profile.plugin.dir" value="cspace#lhmc" />
+ <property name="lhmc.profile.plugin.js" value="${lhmc.profile.plugin.name}@${lhmc.profile.plugin.version}.min.js" />
+ <property name="lhmc.profile.plugin.basename" value="/cspace/lhmc" />
+
+ <target name="download_lhmc" unless="${env.CSPACE_LHMC_CREATE_DISABLED_OPT}">
+ <!-- LHMC Profile -->
+ <exec executable="curl" failonerror="true">
+ <arg line="-o ${lhmc.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui-plugin-profile-lhmc@${lhmc.profile.plugin.version}/dist/${lhmc.profile.plugin.name}.min.js"/>
+ </exec>
+ </target>
+
+ <target name="deploy_lhmc" unless="${env.CSPACE_LHMC_CREATE_DISABLED_OPT}" depends="download_lhmc">
+ <!-- LHMC Profile -->
+ <filter token="UI_VERSION" value="${cspace.ui.version}" />
+ <filter token="PLUGIN_VERSION" value="${lhmc.profile.plugin.version}" />
+ <filter token="PLUGIN_BASENAME" value="${lhmc.profile.plugin.basename}" />
+ <filter token="TENANT_ID" value="${lhmc.profile.plugin.tenantid}" />
+ <filter token="MESSAGE_TITLE" value="${lhmc.profile.plugin.message.title}" />
+ <filter token="LOGO" value="${lhmc.profile.plugin.logo}" />
+
+ <copy todir="${jee.deploy.cspace}/${lhmc.profile.plugin.dir}" filtering="true" overwrite="true">
+ <fileset dir="${lhmc.profile.plugin.dir}"/>
+ </copy>
+ <move file="${lhmc.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
+ </target>
+
+ <target name="undeploy_lhmc" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ <!-- LHMC Profile -->
+ <delete dir="${jee.deploy.cspace}/${lhmc.profile.plugin.dir}" />
+ <delete file="${jee.deploy.cspace.ui.shared}/${lhmc.profile.plugin.js}" />
+ </target>
+
<!--
Materials Authority Tenant
-->
<property name="materials.profile.plugin.dir" value="cspace#materials" />
<property name="materials.profile.plugin.js" value="${materials.profile.plugin.name}@${materials.profile.plugin.version}.min.js" />
<property name="materials.profile.plugin.basename" value="/cspace/materials" />
-
+
<target name="download_materials" unless="${env.CSPACE_MATERIALS_CREATE_DISABLED_OPT}">
<!-- Materials Authority Profile -->
<exec executable="curl" failonerror="true">
<arg line="-o ${materials.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui-plugin-profile-materials@${materials.profile.plugin.version}/dist/${materials.profile.plugin.name}.min.js"/>
</exec>
</target>
-
+
<target name="deploy_materials" unless="${env.CSPACE_MATERIALS_CREATE_DISABLED_OPT}" depends="download_materials">
<!-- Materials Authority Profile -->
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="TENANT_ID" value="${materials.profile.plugin.tenantid}" />
<filter token="MESSAGE_TITLE" value="${materials.profile.plugin.message.title}" />
<filter token="LOGO" value="${materials.profile.plugin.logo}" />
-
+
<copy todir="${jee.deploy.cspace}/${materials.profile.plugin.dir}" filtering="true" overwrite="true">
<fileset dir="${materials.profile.plugin.dir}"/>
</copy>
<move file="${materials.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
-
+
<target name="undeploy_materials" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- Materials Authority Profile -->
<delete dir="${jee.deploy.cspace}/${materials.profile.plugin.dir}" />
</target>
<!--
- General deploy target
- -->
+ General deploy target
+ -->
<target name="deploy_others" unless="${primary.profile.plugin.enabled}">
<antcall target="deploy_common" />
- <antcall target="deploy_core" />
+ <antcall target="deploy_core" />
<antcall target="deploy_publicart" />
<antcall target="deploy_anthro" />
+ <antcall target="deploy_bonsai" />
<antcall target="deploy_fcart" />
+ <antcall target="deploy_lhmc" />
<antcall target="deploy_materials" />
</target>
-
- <target name="deploy" depends="deploy_common, deploy_generic, deploy_others" description="deploy cspace ui to ${jee.server.cspace}">
+
+ <target name="deploy" depends="deploy_common, deploy_generic, deploy_others" description="deploy cspace ui to ${jee.server.cspace}">
<ant antfile="incubator/build.xml" target="deploy" inheritAll="false" />
</target>
-
+
<!-- General undeploy target -->
<target name="undeploy_others">
<antcall target="undeploy_materials" />
+ <antcall target="undeploy_lhmc" />
<antcall target="undeploy_fcart" />
+ <antcall target="undeploy_bonsai" />
<antcall target="undeploy_anthro" />
<antcall target="undeploy_publicart" />
<antcall target="undeploy_core" />
<antcall target="undeploy_common" />
<ant antfile="incubator/build.xml" target="undeploy" inheritAll="false" />
</target>
-
+
<target name="undeploy" depends="undeploy_common, undeploy_primary, undeploy_others" description="undeploy collectionspace ui components from ${jee.server.cspace}">
</target>