awips2/edexOsgi/build.edex/deploy-common/plugin-methods.xml
Dustin Johnson fe8a2a3b09 Issue #1302 Merge branch '5-Data_Delivery' into development
Conflicts:
    edexOsgi/build.edex/deploy-common/external-rules.xml
    edexOsgi/build.edex/deploy-common/plugin-methods.xml
    edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/dao/TextDao.java
    edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java
    edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/Executor.java
    edexOsgi/build.edex/build.xml
    edexOsgi/build.edex/esb/conf/modes.xml
    edexOsgi/com.raytheon.edex.feature.uframe/feature.xml
    edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-ingest.xml
    edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/Grib1Decoder.java
    edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java
    edexOsgi/com.raytheon.uf.common.gridcoverage/src/com/raytheon/uf/common/gridcoverage/GridCoverage.java

Change-Id: I32226e8c316eb393d6f372eaa53b8811d0a954a0

Former-commit-id: 7d0e4a6e75 [formerly 8e69107b5a] [formerly 98d7beae50] [formerly 31d7d09c10 [formerly 98d7beae50 [formerly 89583d97c8823818f87dc1a234078d85ba7bea4a]]]
Former-commit-id: 31d7d09c10
Former-commit-id: 465044dd2793505eba62cb46e6b3a8ac48623765 [formerly bcf575966b]
Former-commit-id: e7a0f96a9a
2012-11-01 13:36:06 -05:00

290 lines
8 KiB
XML

<project>
<macrodef name="processPlugins">
<attribute name="includes.file" />
<attribute name="plugin.type" />
<attribute name="plugin.directories" />
<attribute name="destination.directory" />
<sequential>
<loadfile property="includefile.@{plugin.type}"
srcfile="@{includes.file}" />
<var name="index" value="1" />
<for param="line" list="${includefile.@{plugin.type}}"
delimiter="${line.separator}">
<sequential>
<!-- skip the first line -->
<if>
<not>
<equals arg1="${index}" arg2="1" />
</not>
<then>
<if>
<!-- TODO: we need our own ant plugin so this
becomes unnecessary [SPECIAL CASE]. -->
<equals arg1="@{plugin.type}" arg2="cots" />
<then>
<propertyregex property="plugin.name"
override="true"
input="@{line}"
regexp="(.+)/(.+)"
select="\1"
casesensitive="true" />
</then>
<else>
<propertyregex property="plugin.name"
override="true"
input="@{line}"
regexp="(.+)/component-deploy.xml"
select="\1"
casesensitive="true" />
</else>
</if>
<deployPlugins
plugin.name="${plugin.name}"
original.pattern="@{line}"
plugin.type="@{plugin.type}"
plugin.directories="@{plugin.directories}"
destination.directory="@{destination.directory}" />
</then>
</if>
<math result="index"
operand1="${index}"
operation="+"
operand2="1"
datatype="int" />
</sequential>
</for>
</sequential>
</macrodef>
<macrodef name="deployPlugins">
<attribute name="plugin.name" />
<attribute name="original.pattern" />
<attribute name="plugin.type" />
<attribute name="plugin.directories" />
<attribute name="destination.directory" />
<sequential>
<var name="plugin.path" value="" />
<!-- first we need to find the plugin -->
<for list="${basedirectories}" param="directory"
delimiter=";">
<sequential>
<if>
<available file="@{directory}/@{plugin.name}" />
<then>
<var name="plugin.path"
value="@{directory}" />
</then>
</if>
</sequential>
</for>
<if>
<equals arg1="${plugin.path}" arg2="" />
<then>
<fail message="Failed to find plugin: @{plugin.name}" />
</then>
</if>
<var name="plugin.base" value="${plugin.path}/@{plugin.name}" />
<var name="plugin.bin" value="${plugin.base}/bin" />
<var name="jar.destfile"
value="${destination.directory}/@{plugin.name}.jar" />
<!-- deploy the plugin - cots plugins are deployed differently -->
<if>
<equals arg1="@{plugin.type}" arg2="cots" />
<then>
<!-- copy the cots jars to the destination -->
<copyFOSS
plugin.directory323="${plugin.base}"
jar.file323="${jar.destfile}"
destination.directory323="${destination.directory}/@{plugin.name}" />
<!-- jar any compiled cots source -->
<if>
<available file="${plugin.bin}" type="dir" />
<then>
<jar destfile="${jar.destfile}">
<fileset dir="${plugin.bin}"
includes="**/*.class" />
</jar>
</then>
</if>
</then>
<else>
<jarPlugin
plugin.directory323="${plugin.base}"
jar.file323="${jar.destfile}" />
</else>
</if>
<ant antfile="${basedir}/deploy-common/external-rules.xml"
inheritAll="false">
<property name="plugin._directory"
value="${plugin.base}" />
<property name="deployment._root"
value="${edex.root.directory}" />
</ant>
</sequential>
</macrodef>
<macrodef name="jarPlugin">
<!--
random character suffixes added to
maintain uniqueness of variable names
-->
<attribute name="plugin.directory323" />
<attribute name="jar.file323" />
<sequential>
<!--
initial jar file: currently we make the assumption
every plugin has a manifest file.
-->
<jar destfile="@{jar.file323}"
manifest="@{plugin.directory323}/META-INF/MANIFEST.MF" />
<!-- scan build.properties -->
<var file="@{plugin.directory323}/build.properties" />
<!--
* iterate through bin.includes
* '.' is seen as the ${output..} directory, itself
* artifacts are only deployed if they are present
-->
<for list="${bin.includes}" param="include"
delimiter="," trim="true">
<sequential>
<if>
<available file="@{plugin.directory323}/@{include}"
type="dir" />
<then>
<!-- deploy a directory -->
<!-- is this the output directory? -->
<if>
<equals arg1="@{include}" arg2="." />
<then>
<jar destfile="@{jar.file323}" update="true">
<fileset
dir="@{plugin.directory323}/${output..}"
includes="**" />
</jar>
</then>
<else>
<jar destfile="@{jar.file323}" update="true">
<fileset
dir="@{plugin.directory323}"
includes="@{include}/**" />
</jar>
</else>
</if>
</then>
<else>
<!-- are we deploying a file? -->
<if>
<available file="@{plugin.directory323}/@{include}"
type="file" />
<then>
<jar destfile="@{jar.file323}" update="true">
<fileset
file="@{plugin.directory323}/@{include}" />
</jar>
</then>
<else>
<!-- fail: unknown deployment artifact -->
<fail
message="Unable to deploy '@{include}' specified in @{plugin.directory323}/build.properties; unable to find the file / directory." />
</else>
</if>
</else>
</if>
</sequential>
</for>
</sequential>
</macrodef>
<macrodef name="copyFOSS">
<!--
random character suffixes added to
maintain uniqueness of variable names
-->
<attribute name="plugin.directory323" />
<attribute name="jar.file323" />
<attribute name="destination.directory323" />
<sequential>
<mkdir dir="@{destination.directory323}" />
<!-- scan build.properties -->
<var file="@{plugin.directory323}/build.properties" />
<!--
* iterate through bin.includes
* '.' is seen as the ${output..} directory, itself
* artifacts are only deployed if they are present
-->
<for list="${bin.includes}" param="include"
delimiter="," trim="true">
<sequential>
<if>
<available file="@{plugin.directory323}/@{include}"
type="dir" />
<then>
<!-- deploy a directory -->
<!-- is this the output directory? -->
<if>
<equals arg1="@{include}" arg2="." />
<then>
<if>
<available file="@{plugin.directory323}/${output..}"
type="dir" />
<then>
<jar destfile="@{jar.file323}" update="true">
<fileset
dir="@{plugin.directory323}/${output..}"
includes="**" />
</jar>
</then>
</if>
</then>
<else>
<copy todir="@{destination.directory323}"
overwrite="true" verbose="true">
<fileset dir="@{plugin.directory323}"
includes="@{include}/**" />
</copy>
</else>
</if>
</then>
<else>
<!-- are we deploying a file? -->
<if>
<available file="@{plugin.directory323}/@{include}"
type="file" />
<then>
<copy todir="@{destination.directory323}"
overwrite="true" verbose="true">
<fileset dir="@{plugin.directory323}"
includes="@{include}" />
</copy>
</then>
<else>
<!-- fail: unknown deployment artifact -->
<fail
message="Unable to deploy '@{include}' specified in @{plugin.directory323}/build.properties; unable to find the file / directory." />
</else>
</if>
</else>
</if>
</sequential>
</for>
</sequential>
</macrodef>
</project>