Omaha #3299 - Updated deploy-install to find features
Change-Id: I107c16d832936d63af5dbc76b07166db119c95e2 Former-commit-id:1a3ca4f8df
[formerly2fd4ace0a2
[formerly6a5463ab87
] [formerly1a3ca4f8df
[formerly a25d39959ccdc41ab99e0eaf4ad87559adfcb362]]] Former-commit-id:2fd4ace0a2
[formerly6a5463ab87
] Former-commit-id:2fd4ace0a2
Former-commit-id:fe5cf3f8e6
This commit is contained in:
parent
e5f5cfc7ae
commit
f74a9a2360
11 changed files with 794 additions and 733 deletions
Binary file not shown.
Binary file not shown.
|
@ -4,7 +4,9 @@
|
|||
<property file="${basedir}/edex/common.properties" />
|
||||
<property file="${basedir}/edex/developer.properties" />
|
||||
<condition property="wa.enabled">
|
||||
<not><equals arg1="${wa.to.deploy}" arg2="" /></not>
|
||||
<not>
|
||||
<equals arg1="${wa.to.deploy}" arg2="" />
|
||||
</not>
|
||||
</condition>
|
||||
|
||||
<dirname property="antfile.dir" file="${ant.file}" />
|
||||
|
@ -21,14 +23,28 @@
|
|||
<dirname property="awips.baseline.directory" file="${base.dir}" />
|
||||
<dirname property="git.directory" file="${awips.baseline.directory}" />
|
||||
<echo message="GIT.DIRECTORY:${git.directory}" />
|
||||
<var name="repository.directories"
|
||||
value="${awips.baseline.directory}" />
|
||||
<var name="repository.directories" value="${awips.baseline.directory}" />
|
||||
<for list="${core.repositories}" param="repo.directory">
|
||||
<sequential>
|
||||
<var name="repository.directories"
|
||||
value="${repository.directories},${git.directory}${file.separator}@{repo.directory}" />
|
||||
<var name="repository.directories" value="${repository.directories},${git.directory}${file.separator}@{repo.directory}" />
|
||||
</sequential>
|
||||
</for>
|
||||
|
||||
<echo message="${optional.repositories}"/>
|
||||
<for list="${optional.repositories}" param="repo.directory">
|
||||
<sequential>
|
||||
<if>
|
||||
<isset property="optional.directories" />
|
||||
<then>
|
||||
<var name="optional.directories" value="${optional.directories},${git.directory}${file.separator}@{repo.directory}" />
|
||||
</then>
|
||||
<else>
|
||||
<var name="optional.directories" value="${git.directory}${file.separator}@{repo.directory}" />
|
||||
</else>
|
||||
</if>
|
||||
</sequential>
|
||||
</for>
|
||||
|
||||
<property name="tab" value=" " />
|
||||
<echo level="info" message=" " />
|
||||
<echo level="info" message="Deploy checks the following directories for source:" />
|
||||
|
@ -42,8 +58,7 @@
|
|||
</not>
|
||||
<then>
|
||||
<echo level="error" message="${tab}@{repository.directory} does not exist!" />
|
||||
<property name="missingDir"
|
||||
value="true" />
|
||||
<property name="missingDir" value="true" />
|
||||
</then>
|
||||
</if>
|
||||
</sequential>
|
||||
|
@ -62,10 +77,8 @@
|
|||
<else>
|
||||
<!-- all of the projects are in the workspace or one single directory -->
|
||||
<echo message="BUILDING: in workspace or flattened directory structure" />
|
||||
<var name="awips.baseline.directory"
|
||||
value="${base.dir}" />
|
||||
<var name="repository.directories"
|
||||
value="${base.dir}" />
|
||||
<var name="awips.baseline.directory" value="${base.dir}" />
|
||||
<var name="repository.directories" value="${base.dir}" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
|
@ -73,52 +86,61 @@
|
|||
<echo message="REPOSITORY.DIRECTORIES:${repository.directories}" />
|
||||
|
||||
<!-- construct the list of "basedirectories" -->
|
||||
<propertyselector property="baseline.variables"
|
||||
delimiter="${path.separator}"
|
||||
match="dir.([0-9][0-9])"
|
||||
select="\1"
|
||||
casesensitive="true" />
|
||||
<propertyselector property="baseline.variables" delimiter="${path.separator}" match="dir.([0-9][0-9])" select="\1" casesensitive="true" />
|
||||
|
||||
<var name="basedirectories"
|
||||
value="${awips.baseline.directory}" />
|
||||
<var name="basedirectories" value="${awips.baseline.directory}" />
|
||||
|
||||
<for list="${baseline.variables}" param="index"
|
||||
delimiter="${path.separator}">
|
||||
<for list="${baseline.variables}" param="index" delimiter="${path.separator}">
|
||||
<sequential>
|
||||
<propertycopy property="variable.name"
|
||||
override="true"
|
||||
from="dir.@{index}" />
|
||||
<propertycopy property="variable.name" override="true" from="dir.@{index}" />
|
||||
<for list="${repository.directories}" param="repo.directory">
|
||||
<sequential>
|
||||
<var name="base.directory"
|
||||
value="@{repo.directory}/${variable.name}" />
|
||||
<var name="base.directory" value="@{repo.directory}/${variable.name}" />
|
||||
<if>
|
||||
<available file="${base.directory}" type="dir" />
|
||||
<then>
|
||||
<echo message="BASE.DIRECTORY:${base.directory}" />
|
||||
<var name="basedirectories"
|
||||
value="${base.directory};${basedirectories}" />
|
||||
<var name="basedirectories" value="${base.directory};${basedirectories}" />
|
||||
</then>
|
||||
</if>
|
||||
</sequential>
|
||||
</for>
|
||||
|
||||
<for list="${optional.directories}" param="repo.directory">
|
||||
<sequential>
|
||||
<var name="optional.directory" value="@{repo.directory}/${variable.name}" />
|
||||
<if>
|
||||
<available file="${optional.directory}" type="dir" />
|
||||
<then>
|
||||
<echo message="OPTIONAL.DIRECTORY:${optional.directory}" />
|
||||
<if>
|
||||
<isset property="optionaldirectories"/>
|
||||
<then>
|
||||
<var name="optionaldirectories" value="${optional.directory};${optionaldirectories}" />
|
||||
</then>
|
||||
<else>
|
||||
<var name="optionaldirectories" value="${optional.directory}" />
|
||||
</else>
|
||||
|
||||
</if>
|
||||
</then>
|
||||
</if>
|
||||
</sequential>
|
||||
</for>
|
||||
|
||||
|
||||
<!-- Loop through the WA directories, if they exist. -->
|
||||
<if>
|
||||
<isset property="wa.enabled" />
|
||||
<then>
|
||||
<for list="${wa.to.deploy}" param="wa"
|
||||
delimiter="${path.separator}">
|
||||
<for list="${wa.to.deploy}" param="wa" delimiter="${path.separator}">
|
||||
<sequential>
|
||||
<var name="wa.base.directory"
|
||||
value="@{wa}/${variable.name}" />
|
||||
<var name="wa.base.directory" value="@{wa}/${variable.name}" />
|
||||
|
||||
<if>
|
||||
<available file="${wa.base.directory}"
|
||||
type="dir" />
|
||||
<available file="${wa.base.directory}" type="dir" />
|
||||
<then>
|
||||
<var name="basedirectories"
|
||||
value="${wa.base.directory};${basedirectories}" />
|
||||
<var name="basedirectories" value="${wa.base.directory};${basedirectories}" />
|
||||
</then>
|
||||
</if>
|
||||
</sequential>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<sequential>
|
||||
<var name="plugin.path" value="" />
|
||||
<!-- first we need to find the plugin -->
|
||||
<for list="${basedirectories}" param="directory"
|
||||
<for list="@{plugin.directories}" param="directory"
|
||||
delimiter=";">
|
||||
<sequential>
|
||||
<if>
|
||||
|
|
|
@ -33,16 +33,14 @@
|
|||
Find the feature associated with
|
||||
Work Assignments.
|
||||
-->
|
||||
<var name="feature.to.find"
|
||||
value="${wa.edex.feature}" />
|
||||
<var name="feature.to.find" value="${wa.edex.feature}" />
|
||||
</then>
|
||||
<else>
|
||||
<!--
|
||||
Find the standard AWIPS II
|
||||
Baseline feature.
|
||||
-->
|
||||
<var name="feature.to.find"
|
||||
value="${edex.feature}" />
|
||||
<var name="feature.to.find" value="${edex.feature}" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
|
@ -52,16 +50,13 @@
|
|||
if multiple Work Assignment directories have been
|
||||
specified.
|
||||
-->
|
||||
<for list="${basedirectories}" param="directory"
|
||||
delimiter=";">
|
||||
<for list="${basedirectories}" param="directory" delimiter=";">
|
||||
<sequential>
|
||||
<if>
|
||||
<available file="@{directory}/${feature.to.find}" />
|
||||
<then>
|
||||
<var name="feature"
|
||||
value="@{directory}/${feature.to.find}" />
|
||||
<deploy.feature
|
||||
feature="${feature}" />
|
||||
<var name="feature" value="@{directory}/${feature.to.find}" />
|
||||
<deploy.feature feature="${feature}" />
|
||||
</then>
|
||||
</if>
|
||||
</sequential>
|
||||
|
@ -91,18 +86,13 @@
|
|||
<if>
|
||||
<isset property="wa.enabled" />
|
||||
<then>
|
||||
<for list="${wa.to.deploy}" param="wa"
|
||||
delimiter="${path.separator}">
|
||||
<for list="${wa.to.deploy}" param="wa" delimiter="${path.separator}">
|
||||
<sequential>
|
||||
<basename property="wa.name" file="@{wa}" />
|
||||
<if>
|
||||
<available file="@{wa}/edex/deploy-${wa.name}/wa-deploy.xml"
|
||||
type="file" />
|
||||
<available file="@{wa}/edex/deploy-${wa.name}/wa-deploy.xml" type="file" />
|
||||
<then>
|
||||
<ant
|
||||
antfile="@{wa}/edex/deploy-${wa.name}/wa-deploy.xml"
|
||||
inheritall="true" inheritrefs="true"
|
||||
useNativeBasedir="true" />
|
||||
<ant antfile="@{wa}/edex/deploy-${wa.name}/wa-deploy.xml" inheritall="true" inheritrefs="true" useNativeBasedir="true" />
|
||||
</then>
|
||||
</if>
|
||||
</sequential>
|
||||
|
@ -110,8 +100,7 @@
|
|||
</then>
|
||||
</if>
|
||||
<tstamp>
|
||||
<format property="TIMESTAMP_COMPLETE" pattern="d-MMM-yyyy h:mm:ss a"
|
||||
locale="en,US" />
|
||||
<format property="TIMESTAMP_COMPLETE" pattern="d-MMM-yyyy h:mm:ss a" locale="en,US" />
|
||||
</tstamp>
|
||||
<echo message="Deploy Complete: ${TIMESTAMP_COMPLETE}" />
|
||||
</target>
|
||||
|
@ -128,8 +117,7 @@
|
|||
<available file="${includes.directory}" type="dir" />
|
||||
<then>
|
||||
<delete verbose="true" includeemptydirs="true">
|
||||
<fileset dir="${includes.directory}"
|
||||
includes="*/**" />
|
||||
<fileset dir="${includes.directory}" includes="*/**" />
|
||||
</delete>
|
||||
</then>
|
||||
</if>
|
||||
|
@ -143,44 +131,37 @@
|
|||
be deployed for a 64-bit system should not be deployed for
|
||||
a 32-bit system, etc.
|
||||
-->
|
||||
<includegen providerfilter="${includegen.filter}"
|
||||
basedirectories="${basedirectories}"
|
||||
featurefile="${feature}"
|
||||
cotsout="${includes.directory}/cots.includes"
|
||||
plugsout="${includes.directory}/plugins.includes"
|
||||
coreout="${includes.directory}/core.includes" />
|
||||
<echo message="${feature}" />
|
||||
<echo message="${includes.directory}/cots.includes" />
|
||||
<echo message="${includes.directory}/core.includes" />
|
||||
|
||||
<var name="destination.directory"
|
||||
value="${edex.root.directory}/lib/plugins" />
|
||||
<mkdir dir="${destination.directory}" />
|
||||
<processPlugins
|
||||
includes.file="${includes.directory}/plugins.includes"
|
||||
plugin.type="plugins"
|
||||
plugin.directories="${basedirectories}"
|
||||
destination.directory="${destination.directory}" />
|
||||
<processPlugins
|
||||
includes.file="${includes.directory}/core.includes"
|
||||
plugin.type="core"
|
||||
plugin.directories="${basedirectories}"
|
||||
destination.directory="${destination.directory}" />
|
||||
<includegen providerfilter="${includegen.filter}" basedirectories="${basedirectories}" optionaldirectories="${optionaldirectories}" featurefile="${feature}" cotsout="${includes.directory}/cots.includes" plugsout="${includes.directory}/plugins.includes" coreout="${includes.directory}/core.includes" />
|
||||
|
||||
<var name="destination.directory"
|
||||
value="${edex.root.directory}/lib/dependencies" />
|
||||
<var name="destination.directory" value="${edex.root.directory}/lib/plugins" />
|
||||
<mkdir dir="${destination.directory}" />
|
||||
<processPlugins
|
||||
includes.file="${includes.directory}/cots.includes"
|
||||
plugin.type="cots"
|
||||
plugin.directories="${basedirectories}"
|
||||
destination.directory="${destination.directory}" />
|
||||
<processPlugins includes.file="${includes.directory}/plugins.includes" plugin.type="plugins" plugin.directories="${basedirectories}" destination.directory="${destination.directory}" />
|
||||
<processPlugins includes.file="${includes.directory}/core.includes" plugin.type="core" plugin.directories="${basedirectories}" destination.directory="${destination.directory}" />
|
||||
|
||||
<var name="destination.directory" value="${edex.root.directory}/lib/dependencies" />
|
||||
<mkdir dir="${destination.directory}" />
|
||||
|
||||
<if>
|
||||
<isset property="optionaldirectories" />
|
||||
<then>
|
||||
<var name="allDir" value="${basedirectories};${optionaldirectories}" />
|
||||
<processPlugins includes.file="${includes.directory}/cots.includes" plugin.type="cots" plugin.directories="${allDir}" destination.directory="${destination.directory}" />
|
||||
</then>
|
||||
<else>
|
||||
<processPlugins includes.file="${includes.directory}/cots.includes" plugin.type="cots" plugin.directories="${basedirectories}" destination.directory="${destination.directory}" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<!-- cleanup the temporary directories -->
|
||||
<if>
|
||||
<available file="${basedir}/tmp"
|
||||
type="dir" />
|
||||
<available file="${basedir}/tmp" type="dir" />
|
||||
<then>
|
||||
<delete includeemptydirs="true">
|
||||
<fileset dir="${basedir}"
|
||||
includes="tmp/**" />
|
||||
<fileset dir="${basedir}" includes="tmp/**" />
|
||||
</delete>
|
||||
</then>
|
||||
</if>
|
||||
|
@ -188,21 +169,16 @@
|
|||
</macrodef>
|
||||
|
||||
<target name="deploy.python">
|
||||
<property name="site-package.directory"
|
||||
value="${python.root.directory}/lib/${python.version.dir}/site-packages" />
|
||||
<property name="site-package.directory" value="${python.root.directory}/lib/${python.version.dir}/site-packages" />
|
||||
|
||||
<echo message="Deploying the Raytheon python site-packages." />
|
||||
<deploy.python.site-package
|
||||
site.package="ufpy" />
|
||||
<deploy.python.site-package
|
||||
site.package="dynamicserialize" />
|
||||
<deploy.python.site-package
|
||||
site.package="pypies" />
|
||||
<deploy.python.site-package site.package="ufpy" />
|
||||
<deploy.python.site-package site.package="dynamicserialize" />
|
||||
<deploy.python.site-package site.package="pypies" />
|
||||
</target>
|
||||
|
||||
<target name="deploy.localization">
|
||||
<for list="${localization.sites}" param="site"
|
||||
delimiter="${path.separator}">
|
||||
<for list="${localization.sites}" param="site" delimiter="${path.separator}">
|
||||
<sequential>
|
||||
<echo message="Deploying localization for site: @{site}" />
|
||||
|
||||
|
@ -210,23 +186,18 @@
|
|||
project should be in. -->
|
||||
<var name="localization.path" value="" />
|
||||
<if>
|
||||
<available file="${awips.baseline.directory}/localization.@{site}"
|
||||
type="dir" />
|
||||
<available file="${awips.baseline.directory}/localization.@{site}" type="dir" />
|
||||
<then>
|
||||
<var name="localization.path"
|
||||
value="${awips.baseline.directory}/localization.@{site}" />
|
||||
<var name="localization.path" value="${awips.baseline.directory}/localization.@{site}" />
|
||||
</then>
|
||||
<else>
|
||||
<var name="localization.path"
|
||||
value="${awips.baseline.directory}/${localization.directory}/localization.@{site}" />
|
||||
<var name="localization.path" value="${awips.baseline.directory}/${localization.directory}/localization.@{site}" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<!-- copy the localization files. -->
|
||||
<copy todir="${edex.root.directory}/data/utility"
|
||||
overwrite="true">
|
||||
<fileset dir="${localization.path}/utility"
|
||||
includes="*/**" />
|
||||
<copy todir="${edex.root.directory}/data/utility" overwrite="true">
|
||||
<fileset dir="${localization.path}/utility" includes="*/**" />
|
||||
</copy>
|
||||
</sequential>
|
||||
</for>
|
||||
|
@ -239,13 +210,10 @@
|
|||
<sequential>
|
||||
<echo message="Deploying @{site.package} ..." />
|
||||
<if>
|
||||
<available file="${site-package.directory}/@{site.package}"
|
||||
type="dir" />
|
||||
<available file="${site-package.directory}/@{site.package}" type="dir" />
|
||||
<then>
|
||||
<delete dir="${site-package.directory}/@{site.package}"
|
||||
includeemptydirs="true">
|
||||
<fileset dir="${site-package.directory}"
|
||||
includes="@{site.package}/**" />
|
||||
<delete dir="${site-package.directory}/@{site.package}" includeemptydirs="true">
|
||||
<fileset dir="${site-package.directory}" includes="@{site.package}/**" />
|
||||
</delete>
|
||||
</then>
|
||||
</if>
|
||||
|
@ -255,14 +223,12 @@
|
|||
<then>
|
||||
<!-- custom rule for pypies due to alternate directory layout -->
|
||||
<copy todir="${site-package.directory}">
|
||||
<fileset dir="${awips.baseline.directory}/pythonPackages/pypies"
|
||||
includes="@{site.package}/**" />
|
||||
<fileset dir="${awips.baseline.directory}/pythonPackages/pypies" includes="@{site.package}/**" />
|
||||
</copy>
|
||||
</then>
|
||||
<else>
|
||||
<copy todir="${site-package.directory}">
|
||||
<fileset dir="${awips.baseline.directory}/pythonPackages"
|
||||
includes="@{site.package}/**" />
|
||||
<fileset dir="${awips.baseline.directory}/pythonPackages" includes="@{site.package}/**" />
|
||||
</copy>
|
||||
</else>
|
||||
</if>
|
||||
|
@ -270,9 +236,6 @@
|
|||
</macrodef>
|
||||
|
||||
<!-- static -->
|
||||
<taskdef name="includegen"
|
||||
classname="com.raytheon.uf.anttasks.includesgen.GenerateIncludesFromFeature"
|
||||
classpathref="ant.classpath" />
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml"
|
||||
classpath="${basedir}/lib/ant/ant-contrib-1.0b3.jar" />
|
||||
<taskdef name="includegen" classname="com.raytheon.uf.anttasks.includesgen.GenerateIncludesFromFeature" classpathref="ant.classpath" />
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${basedir}/lib/ant/ant-contrib-1.0b3.jar" />
|
||||
</project>
|
|
@ -1,14 +1,19 @@
|
|||
edex.root.directory=/awips2/edex
|
||||
architecture=x86_64
|
||||
|
||||
includegen.filter=raytheon|noaa\.nws|noaa\.gsd|gov\.nasa\.msfc|edu\.wisc\.ssec\.cimss
|
||||
includegen.filter=raytheon|noaa\.nws|noaa\.gsd|nasa|edu\.wisc\.ssec\.cimss
|
||||
|
||||
# AWIPSII core repositories required for build
|
||||
core.repo=ufcore
|
||||
core-foss.repo=ufcore-foss
|
||||
awips2-foss.repo=AWIPS2_foss
|
||||
|
||||
awips2-ncep.repo=AWIPS2_NCEP
|
||||
awips2-cimss.repo=AWIPS2_CIMSS
|
||||
awips2-gsd.repo=AWIPS2_GSD
|
||||
|
||||
core.repositories=${core.repo},${core-foss.repo},${awips2-foss.repo}
|
||||
optional.repositories=${awips2-ncep.repo},${awips2-cimss.repo},${awips2-gsd.repo}
|
||||
|
||||
# Note: currently, there is a limit of 99 plugin directories.
|
||||
dir.01=cave
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -7,3 +7,4 @@ Bundle-Vendor: RAYTHEON
|
|||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: org.apache.ant;bundle-version="1.7.1",
|
||||
com.raytheon.uf.featureexplorer;bundle-version="1.0.0"
|
||||
Import-Package: com.raytheon.uf.featureexplorer
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package com.raytheon.uf.anttasks.includesgen;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Matcher;
|
||||
|
@ -28,6 +30,7 @@ import com.raytheon.uf.featureexplorer.FeatureExplorer;
|
|||
* 28Jan2009 1930 MW Fegan Added provider and plugin filtering.
|
||||
* Feb 4, 2013 #1577 bkowal Remove component-deploy.xml suffixes for
|
||||
* core and plugins; remove jar wildcard for cots
|
||||
* Feb 25, 2015 #3299 garmendariz Process a list of included features
|
||||
* </pre>
|
||||
*
|
||||
* @author bclement
|
||||
|
@ -50,6 +53,8 @@ public class GenerateIncludesFromFeature extends Task {
|
|||
|
||||
protected File allOut;
|
||||
|
||||
protected String optionalDirectories;
|
||||
|
||||
/* attributes for filtering */
|
||||
private static final String PATTERN = "^.*(%s).*$";
|
||||
|
||||
|
@ -78,6 +83,21 @@ public class GenerateIncludesFromFeature extends Task {
|
|||
this.baseDirectories = baseDirectories;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the optionalDirectories
|
||||
*/
|
||||
public String getOptionalDirectories() {
|
||||
return optionalDirectories;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param optionalDirectories
|
||||
* the optionalDirectories to set
|
||||
*/
|
||||
public void setOptionalDirectories(String optionalDirectories) {
|
||||
this.optionalDirectories = optionalDirectories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the component provider filter. This is a pipe (|) separated string
|
||||
* of names that identify a component as a non-COTS component. The default
|
||||
|
@ -203,14 +223,45 @@ public class GenerateIncludesFromFeature extends Task {
|
|||
|
||||
FeatureExplorer fe = null;
|
||||
|
||||
ArrayList<File> files = null;
|
||||
|
||||
File[] incFiles = null;
|
||||
|
||||
ArrayList<File> includes = null;
|
||||
|
||||
// list of directories overrides single directory
|
||||
if (baseDirectories != null) {
|
||||
String[] fileNames = baseDirectories.split(";");
|
||||
ArrayList<File> files = new ArrayList<File>(fileNames.length);
|
||||
files = new ArrayList<File>(fileNames.length);
|
||||
for (String fName : fileNames) {
|
||||
File file = new File(fName);
|
||||
files.add(file);
|
||||
}
|
||||
|
||||
if (optionalDirectories != null) {
|
||||
fileNames = optionalDirectories.split(";");
|
||||
includes = new ArrayList<File>();
|
||||
for (String fName : fileNames) {
|
||||
|
||||
File file = new File(fName);
|
||||
files.add(file);
|
||||
|
||||
// iterate through each optional dir to find edex features
|
||||
final Pattern p = Pattern.compile(".*edex.*feature");
|
||||
incFiles = file.listFiles(new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File file) {
|
||||
return p.matcher(file.getName()).matches();
|
||||
}
|
||||
});
|
||||
|
||||
if (incFiles != null) {
|
||||
includes.addAll(Arrays.asList(incFiles));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fe = new FeatureExplorer(new WorkspaceFeatureSearch(files),
|
||||
new WorkspacePluginSearch(files));
|
||||
} else if (baseDirectory != null) {
|
||||
|
@ -222,7 +273,7 @@ public class GenerateIncludesFromFeature extends Task {
|
|||
}
|
||||
|
||||
try {
|
||||
rval = fe.getPlugins(featureFile);
|
||||
rval = fe.getPlugins(featureFile, includes);
|
||||
} catch (FeatureException e) {
|
||||
throw new BuildException(e);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.Manifest;
|
||||
|
@ -36,6 +37,7 @@ import com.raytheon.uf.featureexplorer.search.IPluginSearch;
|
|||
* Oct 10, 2008 SP#15 bclement Added static functions for reading manifests
|
||||
* Feb 4, 2013 #1577 bkowal Verify that a plugin has not been included in more than one feature.
|
||||
* May 22, 2013 #1927 bkowal Fix improper String comparison
|
||||
* Feb 25, 2015 #3299 garmendariz Process a list of included features
|
||||
* </pre>
|
||||
*
|
||||
* @author dglazesk
|
||||
|
@ -102,7 +104,7 @@ public class FeatureExplorer {
|
|||
* @throws FeatureException
|
||||
*/
|
||||
public ArrayList<File> getPlugins() throws FeatureException {
|
||||
return getPlugins(feature);
|
||||
return getPlugins(feature, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -114,9 +116,10 @@ public class FeatureExplorer {
|
|||
* @return The list of file objects for all of the plugins in the feature
|
||||
* @throws FeatureException
|
||||
*/
|
||||
public ArrayList<File> getPlugins(String aPath) throws FeatureException {
|
||||
public ArrayList<File> getPlugins(String aPath, ArrayList<File> incList)
|
||||
throws FeatureException {
|
||||
File feat = new File(aPath);
|
||||
return getPlugins(feat);
|
||||
return getPlugins(feat, incList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,13 +129,15 @@ public class FeatureExplorer {
|
|||
*
|
||||
* @param aFeature
|
||||
* The file object for the feature to be scanned
|
||||
* @param incList
|
||||
* @return The list of file objects for the located plugins
|
||||
* @throws FeatureException
|
||||
*/
|
||||
public ArrayList<File> getPlugins(File aFeature) throws FeatureException {
|
||||
public ArrayList<File> getPlugins(File aFeature, ArrayList<File> incList)
|
||||
throws FeatureException {
|
||||
ArrayList<File> rval = new ArrayList<File>();
|
||||
|
||||
HashMap<String, File> plugins = getFeaturePlugins(aFeature);
|
||||
HashMap<String, File> plugins = getFeaturePlugins(aFeature, incList);
|
||||
rval = new ArrayList<File>(plugins.values());
|
||||
|
||||
return rval;
|
||||
|
@ -145,13 +150,14 @@ public class FeatureExplorer {
|
|||
*
|
||||
* @param aFile
|
||||
* The feature file that is being scanned
|
||||
* @param incList
|
||||
* @return A hash map that links the plugin id to its file system location
|
||||
* @throws FeatureException
|
||||
* If there are any problems with JAXB, a feature cannot be
|
||||
* found, or a plugin cannot be found
|
||||
*/
|
||||
protected HashMap<String, File> getFeaturePlugins(File aFile)
|
||||
throws FeatureException {
|
||||
protected HashMap<String, File> getFeaturePlugins(File aFile,
|
||||
ArrayList<File> incList) throws FeatureException {
|
||||
HashMap<String, File> rval = new HashMap<String, File>();
|
||||
if (aFile == null || !aFile.exists() || !aFile.canRead())
|
||||
return rval;
|
||||
|
@ -165,13 +171,25 @@ public class FeatureExplorer {
|
|||
throw new FeatureException("Unable to unmarshal file " + aFile, e);
|
||||
}
|
||||
|
||||
// if additional includes are passed in, add them for processing
|
||||
if (incList != null && feat != null) {
|
||||
List<Includes> featList = feat.getIncludes();
|
||||
|
||||
for (Iterator<File> iterator = incList.iterator(); iterator
|
||||
.hasNext();) {
|
||||
File incFile = (File) iterator.next();
|
||||
featList.add(new Includes(incFile.getName(), "0.0.0", false));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Includes include : feat.getIncludes()) {
|
||||
// go through all of the included features and try to find them
|
||||
List<File> features = featureSearch.findFeature(include.getId(),
|
||||
include.getVersion());
|
||||
try {
|
||||
// get all of the plugin id to file objects and add them
|
||||
rval.putAll(getFeaturePlugins(features.get(0)));
|
||||
rval.putAll(getFeaturePlugins(features.get(0), null));
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
if (!include.getOptional()) {
|
||||
// this means we received an empty list, no feature found
|
||||
|
@ -188,7 +206,8 @@ public class FeatureExplorer {
|
|||
plugin.getVersion());
|
||||
try {
|
||||
if (this.pluginLookupMap.containsKey(plugin.getId())
|
||||
&& !this.pluginLookupMap.get(plugin.getId()).equals(aFile)) {
|
||||
&& !this.pluginLookupMap.get(plugin.getId()).equals(
|
||||
aFile)) {
|
||||
StringBuilder stringBuilder = new StringBuilder("Plugin ");
|
||||
stringBuilder.append(plugin.getId());
|
||||
stringBuilder.append(" is in Feature ");
|
||||
|
|
Loading…
Add table
Reference in a new issue