Omaha #4759 - merge the new CAVE build into the viz rpm build. initial cleanup of the old build.

Former-commit-id: df1a5702f10c088a9c5fe6e9fb79a216839a50ec
This commit is contained in:
Bryan Kowal 2015-10-09 18:17:34 -05:00
parent 79ad314965
commit c1d2997c5c
10 changed files with 157 additions and 521 deletions

View file

@ -1,6 +1,5 @@
# This build.properties file is used exclusively by the cave pde p2 builds.
topLevelElementType=feature
buildType=I
buildId=CAVE
buildLabel=${buildType}.${buildId}
@ -28,4 +27,4 @@ generate.p2.metadata=true
p2.metadata.repo=file:/${buildDirectory}/repository
p2.artifact.repo=file:/${buildDirectory}/repository
p2.publish.artifacts=true
generateVersionsList=true
generateVersionsList=true

View file

@ -20,18 +20,13 @@
############# PRODUCT/PACKAGING CONTROL #############
# The product file is specified in the build.xml as a default and is
# overridable setting 'build.product' from ant.
product=${base}/../../com.raytheon.viz.product.awips/${productFile}
#product=${base}/../../com.raytheon.viz.product.awips/developer.product
runPackager=true
#Needed for p2, comment out these lines if using developer.product
p2.gathering=true
generate.p2.metadata = true
p2.metadata.repo=file:${buildDirectory}/repo
p2.artifact.repo=file:${buildDirectory}/repo
p2.metadata.repo=file:${buildDirectory}/repository
p2.artifact.repo=file:${buildDirectory}/repository
p2.flavor=tooling
p2.publish.artifacts=true

View file

@ -65,63 +65,7 @@
<!-- ===================================================================== -->
<!-- Steps to do after setup but before starting the build proper -->
<!-- ===================================================================== -->
<target name="postSetup">
<echo message="${buildDirectory}"/>
<mkdir dir="${buildDirectory}/plugins"/>
<echo message="com.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="com.*/**"/>
</copy>
<echo message="ucar.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ucar.*/**"/>
</copy>
<echo message="features.*/**"/>
<copy todir="${buildDirectory}/features">
<fileset dir="${buildDirectory}/../../../" includes="*.feature*/**"/>
</copy>
<echo message="ncsa.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ncsa.*/**"/>
</copy>
<echo message="org.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="org.*/**"/>
</copy>
<echo message="net.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="net.*/**"/>
</copy>
<echo message="ohd.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ohd*/**"/>
</copy>
<echo message="javax.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="javax.*/**"/>
</copy>
<echo message="gov.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="gov.*/**"/>
</copy>
<echo message="edu.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="edu.*/**"/>
</copy>
<echo message="ogc.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ogc.*/**"/>
</copy>
<echo message="de.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="de.*/**"/>
</copy>
<echo message="ch.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ch.*/**"/>
</copy>
<target name="postSetup">
<antcall target="getBaseComponents" />
</target>
@ -214,236 +158,8 @@
<!-- ===================================================================== -->
<!-- Steps to do after the build is done. -->
<!-- ===================================================================== -->
<target name="postBuild">
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${builder}/../lib/ant/ant-contrib-1.0b3.jar" />
<!-- TODO: cleanup unused tasks + libs; next changeset -->
<taskdef name="xmltask"
classname="com.oopsconsultancy.xmltask.ant.XmlTask">
<classpath>
<pathelement path="${builder}/../lib/ant/xmltask-v1.15.1.jar"/>
<pathelement path="${builder}/../lib/ant/xalan-2.7.2.jar"/>
</classpath>
</taskdef>
<target name="postBuild">
</target>
<macrodef name="extractCAVEini">
<attribute name="zip.file" />
<sequential>
<unzip src="@{zip.file}"
dest="/tmp">
<patternset>
<include name="**/cave/cave.ini" />
</patternset>
</unzip>
</sequential>
</macrodef>
<macrodef name="verifyVersion">
<attribute name="file.version" />
<sequential>
<property name="___memorySettingsVersion___"
value="4.0"/>
<if>
<not>
<equals
arg1="${___memorySettingsVersion___}"
arg2="@{file.version}" />
</not>
<then>
<fail
message="ERROR: memorySettings.xml Version Mismatch." />
</then>
</if>
</sequential>
</macrodef>
<target name="generateDynamicCAVE">
<xmlproperty file="${builder}/memorySettings.xml"
collapseAttributes="true"/>
<verifyVersion
file.version="${cave-memory-settings.file-version}" />
<property name="iniLookupScript"
value="/tmp/cave/iniLookup.sh" />
<!-- Start the iniLookup.sh script -->
<echo message="#!/bin/bash${line.separator}"
file="${iniLookupScript}" />
<echo message="${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="# This auto-generated script will be sourced by caveUtil.sh.${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="export ASSOCIATED_INI=${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="function retrieveAssociatedINI()${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="{${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" # Arguments${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" # ${1} == one in the set: {-component, -perspective}${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" # ${2} == the argument that corresponds to the first argument${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" # AUTOGENERATED IF STATEMENTS."
file="${iniLookupScript}"
append="true" />
<xmltask source="${builder}/memorySettings.xml">
<call path="//${cave.arch}/memory-setting">
<param name="first-arg"
path="command-line-args/first-arg/text()" />
<param name="second-arg"
path="command-line-args/second-arg/text()" />
<!-- TODO: Explore using copy and buffers to do
the following actions in a better way. -->
<param name="max-memory"
path="ini-substitutions/max-memory/value/text()" />
<param name="max-perm"
path="ini-substitutions/max-perm/value/text()" />
<actions>
<!-- Create a component-specific ini file -->
<copy verbose="true"
file="/tmp/cave/cave.ini"
tofile="/tmp/cave/@{second-arg}.ini"
overwrite="true" />
<!-- Update the ini file -->
<update.ini
ini.file="@{second-arg}.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-memory.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-memory.value}"
new.value="@{max-memory}" />
<update.ini
ini.file="@{second-arg}.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-perm.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-perm.value}"
new.value="@{max-perm}" />
<!-- Add to the ini lookup utility script -->
<echo message="${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" if [ &quot;$${1}&quot; == &quot;@{first-arg}&quot; ] &amp;&amp;${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" [ &quot;$${2}&quot; == &quot;@{second-arg}&quot; ]; then${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" export ASSOCIATED_INI=&quot;@{second-arg}.ini&quot;${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" return 0${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" fi${line.separator}"
file="${iniLookupScript}"
append="true" />
</actions>
</call>
<!-- site type specific overrides (wfo, ncep, etc) -->
<call path="//${cave.arch}/site-type-override">
<param name="site-type"
path="site-type/text()" />
<param name="max-memory"
path="ini-substitutions/max-memory/value/text()" />
<param name="max-perm"
path="ini-substitutions/max-perm/value/text()" />
<actions>
<!-- Create a site-type-specific ini file -->
<copy verbose="true"
file="/tmp/cave/cave.ini"
tofile="/tmp/cave/@{site-type}.ini"
overwrite="true" />
<!-- Update the ini file -->
<update.ini
ini.file="@{site-type}.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-memory.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-memory.value}"
new.value="@{max-memory}" />
<update.ini
ini.file="@{site-type}.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-perm.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-perm.value}"
new.value="@{max-perm}" />
</actions>
</call>
</xmltask>
<!-- Finish the iniLookup.sh script -->
<echo message="${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message=" return 1${line.separator}"
file="${iniLookupScript}"
append="true" />
<echo message="}"
file="${iniLookupScript}"
append="true" />
</target>
<macrodef name="update.ini">
<attribute name="ini.file" />
<attribute name="jvm.arg" />
<attribute name="current.value" />
<attribute name="new.value" />
<sequential>
<if>
<not>
<equals arg1="@{new.value}"
arg2="DEFAULT" />
</not>
<then>
<exec executable="/bin/sed"
output="/tmp/cave/ini.tmp">
<arg value="-e" />
<arg value="s/@{jvm.arg}@{current.value}/@{jvm.arg}@{new.value}/" />
<arg value="/tmp/cave/@{ini.file}" />
</exec>
<move verbose="true"
file="/tmp/cave/ini.tmp"
tofile="/tmp/cave/@{ini.file}"
overwrite="true" />
</then>
</if>
</sequential>
</macrodef>
<!-- ===================================================================== -->

View file

@ -33,6 +33,7 @@ import java.util.HashSet;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 29, 2015 4759 bkowal Initial creation
* Oct 09, 2015 4759 bkowal Build cycles now cause failure.
*
* </pre>
*
@ -79,17 +80,13 @@ public class BuildFeature {
}
public void addDependentFeatures(Set<BuildFeature> buildFeatures,
final String pluginId) {
final String resource, String pluginId) {
for (BuildFeature buildFeature : buildFeatures) {
if (buildFeature.dependsOn(this)) {
/*
* Only a sysout for now because we do have a single build cycle
* in our current baseline.
*/
System.out.println("Build cycle detected: "
throw new IllegalStateException("Build cycle detected: "
+ buildFeature.getId() + " and " + this.id
+ " are dependent on each other! Linked by plugin = "
+ pluginId + " ...");
+ " are dependent on each other! Linked by resource = "
+ resource + " required by plugin " + pluginId + " ...");
}
this.addDependentFeature(buildFeature);
}
@ -187,4 +184,4 @@ public class BuildFeature {
public String toString() {
return this.id;
}
}
}

View file

@ -34,6 +34,7 @@ import java.nio.file.Paths;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 30, 2015 4759 bkowal Initial creation
* Oct 06, 2015 4759 bkowal Added toString.
*
* </pre>
*
@ -116,4 +117,9 @@ public class BuildPlugin {
public Set<BuildFeature> getContainingFeatures() {
return this.containingFeatures;
}
}
@Override
public String toString() {
return this.id;
}
}

View file

@ -20,6 +20,7 @@
package awips.dependency.evaluator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
@ -71,6 +72,7 @@ import org.eclipse.pde.internal.core.product.ProductModel;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 29, 2015 4759 bkowal Initial creation
* Oct 09, 2015 4759 bkowal Added an exclude features parameter.
*
* </pre>
*
@ -115,6 +117,8 @@ public class Main {
*/
private static final String BUILD_FEATURES_ARG = "buildFeatures";
private static final String EXCLUDE_FEATURES_ARG = "excludeFeatures";
/*
* Argument specifying the product that will need to be prepared for
* building. The existence of all features specified in the product will be
@ -139,6 +143,8 @@ public class Main {
private String buildFeatures;
private String excludeFeatures;
private String buildProduct;
private static final String COMMON_BASE_FEATURE = "com.raytheon.uf.common.base.feature";
@ -206,6 +212,7 @@ public class Main {
+ " has not been specified.");
}
this.buildFeatures = System.getProperty(BUILD_FEATURES_ARG);
this.excludeFeatures = System.getProperty(EXCLUDE_FEATURES_ARG);
this.buildProduct = System.getProperty(BUILD_PRODUCT_ARG);
/*
* At least one must be specified.
@ -350,8 +357,6 @@ public class Main {
if (ALL_FEATURES.equals(this.buildFeatures)) {
featuresToBuild.addAll(this.buildFeaturesMap.values());
productModel.getProduct().removeFeatures(
productModel.getProduct().getFeatures());
allFeatures = true;
} else {
for (IProductFeature feature : productModel.getProduct()
@ -365,6 +370,8 @@ public class Main {
featuresToBuild.add(buildFeature);
}
}
productModel.getProduct().removeFeatures(
productModel.getProduct().getFeatures());
}
// Ensure all dependencies are present for the features that need to be
@ -536,7 +543,8 @@ public class Main {
for (BuildFeature dependencyFeature : buildPluginDependency
.getContainingFeatures()) {
dependencyFeature.addDependentFeatures(
buildPlugin.getContainingFeatures(), pluginId);
buildPlugin.getContainingFeatures(),
requiredBundle, pluginId);
for (BuildFeature containingFeature : buildPlugin
.getContainingFeatures()) {
containingFeature
@ -598,7 +606,7 @@ public class Main {
.getContainingFeatures()) {
dependencyFeature.addDependentFeatures(
buildPlugin.getContainingFeatures(),
pluginId);
importedPackage, pluginId);
for (BuildFeature containingFeature : buildPlugin
.getContainingFeatures()) {
containingFeature
@ -616,12 +624,30 @@ public class Main {
* the staging directory.
*/
private List<BuildFeature> findFeatures() {
/*
* Determine if there are any features that should be excluded ...
*/
final List<String> excludedFeaturesList;
if (this.excludeFeatures != null
&& this.excludeFeatures.isEmpty() == false) {
excludedFeaturesList = new ArrayList<>();
for (String excludedFeature : this.excludeFeatures
.split(CSV_SEPARATOR)) {
excludedFeaturesList.add(excludedFeature);
}
} else {
excludedFeaturesList = Collections.emptyList();
}
final List<BuildFeature> stagedFeatures = new ArrayList<>();
this.stagingPath.toFile().list(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if ((name.contains(FEATURE) && name.contains(VIZ))
|| COMMON_BASE_FEATURE.equals(name)) {
if (excludedFeaturesList.contains(name)) {
return false;
}
final Path featurePath = stagingPath.resolve(name).resolve(
BuildFeature.FILENAME);
/*
@ -892,4 +918,4 @@ public class Main {
return resourcePaths;
}
}
}

View file

@ -10,6 +10,7 @@ VAR_AWIPSII_VERSION=""
VAR_AWIPSII_RELEASE=""
VAR_UFRAME_ECLIPSE="/opt/uframe-eclipse"
VAR_AWIPSCM_SHARE="/awipscm"
VAR_REPO_DEST="/tmp/repo"
# -----------------------------------------------------------------------------
if [ "${AWIPSII_TOP_DIR}" = "" ] &&
@ -56,6 +57,10 @@ function prepareBuildEnvironment()
if [ "${AWIPSCM_SHARE}" = "" ]; then
export AWIPSCM_SHARE="${VAR_AWIPSCM_SHARE}"
fi
if [ "${REPO_DEST}" = "" ]; then
export REPO_DEST="${VAR_REPO_DEST}"
fi
}
function setTargetArchitecture()
@ -86,26 +91,113 @@ setTargetArchitecture
if [ ! -d ${WORKSPACE}/rpms/awips2.cave/setup/dist ]; then
mkdir -p ${WORKSPACE}/rpms/awips2.cave/setup/dist
if [ $? -ne 0 ]; then
exit 1
fi
fi
if [ ! -d ${WORKSPACE}/rpms/awips2.cave/Installer.cave-feature/feature.setup ]; then
mkdir -p ${WORKSPACE}/rpms/awips2.cave/Installer.cave-feature/feature.setup
if [ $? -ne 0 ]; then
exit 1
exit 0
fi
fi
if [ ! -f ${WORKSPACE}/rpms/awips2.cave/setup/scripts/prepare_dist.sh ]; then
echo "ERROR: Unable to find the setup script."
exit 1
# prepare to complete the RCP builds.
build_project_dir=${WORKSPACE}/build
pde_base_dir=${build_project_dir}/cave
pde_build_dir=${pde_base_dir}/tmp
prepare_dir=${pde_base_dir}/prepare
awips_product=com.raytheon.viz.product.awips/awips.product
if [ ${prepare_dir} ]; then
rm -rf ${prepare_dir}
fi
/bin/bash ${WORKSPACE}/rpms/awips2.cave/setup/scripts/prepare_dist.sh
RC=$?
if [ ${RC} -ne 0 ]; then
echo "ERROR: setup failed."
exit 1
mkdir ${prepare_dir}
# First, we need to build the dependency utility.
pushd . > /dev/null 2>&1
cd ${WORKSPACE}/awips.dependency.evaluator
if [ ! -d bin ]; then
mkdir bin
fi
/awips2/ant/bin/ant -f build.xml -Dbaseline.dir=${WORKSPACE} \
-Declipse.dir=${UFRAME_ECLIPSE} -Ddest.dir=${prepare_dir}
if [ $? -ne 0 ]; then
exit 1
fi
cd ${prepare_dir}
# Next, stage the plugins and determine what needs to be built.
# In another scenario that jar utility could be ran again with only the subset of features
# that need to be built prior to the repository build.
/awips2/java/bin/java -jar -DbaseLocation=${UFRAME_ECLIPSE} \
-DbuildDirectory=${pde_build_dir} -DstagingDirectory=${WORKSPACE} -DbuildFeatures=* \
-DexcludeFeatures=com.raytheon.viz.feature.awips.developer,com.raytheon.uf.viz.feature.alertviz \
-DbuildProduct=${awips_product} AwipsDependencyEvaluator.jar
if [ $? -ne 0 ]; then
exit 1
fi
_pde_launcher_jar=${UFRAME_ECLIPSE}/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
_pde_product_xml=${UFRAME_ECLIPSE}/plugins/org.eclipse.pde.build_3.8.2.v20121114-140810/scripts/productBuild/productBuild.xml
# Complete the CAVE RCP build.
/awips2/java/bin/java -jar ${_pde_launcher_jar} -application org.eclipse.ant.core.antRunner \
-buildfile ${_pde_product_xml} -DbaseLocation=${UFRAME_ECLIPSE} \
-Dbuilder=${pde_base_dir} -DbuildDirectory=${pde_build_dir} \
-Dbase=${pde_base_dir} -Dproduct=${WORKSPACE}/${awips_product}
if [ $? -ne 0 ]; then
exit 1
fi
# Copy the CAVE binary to the location expected by the RPM build
cp ${pde_build_dir}/I.CAVE/CAVE-linux.gtk.x86_64.zip ${WORKSPACE}/rpms/awips2.cave/setup/dist/
# Prepare for the CAVE repository build. Need to create more resuse for a single build
# properties file so that it can be used for both product and feature builds.
pde_build_dir=${pde_base_dir}/p2
pde_base_dir=${pde_base_dir}/p2
/awips2/java/bin/java -jar -DbaseLocation=${UFRAME_ECLIPSE} \
-DbuildDirectory=${pde_build_dir} -DstagingDirectory=${WORKSPACE} -DbuildFeatures=* \
-DexcludeFeatures=com.raytheon.viz.feature.awips.developer,com.raytheon.uf.viz.feature.alertviz \
-DoutputFile=${prepare_dir}/repositoriesToBuild.txt \
AwipsDependencyEvaluator.jar
if [ $? -ne 0 ]; then
exit 1
fi
_pde_build_xml=${UFRAME_ECLIPSE}/plugins/org.eclipse.pde.build_3.8.2.v20121114-140810/scripts/build.xml
repo_dist_dir=${pde_build_dir}/dist
mkdir -p ${pde_base_dir}
repo_dist_dir=${pde_build_dir}/dist
p2_repo_dir=${pde_build_dir}/repository
if [ -d ${REPO_DEST} ]; then
rm -rf ${REPO_DEST}
fi
mkdir -p ${REPO_DEST}
cp -v ${build_project_dir}/build.properties.p2 ${pde_base_dir}/build.properties
for feature in `cat ${prepare_dir}/repositoriesToBuild.txt`; do
/awips2/java/bin/java -jar ${_pde_launcher_jar} -application org.eclipse.ant.core.antRunner \
-buildfile ${_pde_build_xml} -DbaseLocation=${UFRAME_ECLIPSE} \
-Dbuilder=${pde_base_dir} -DbuildDirectory=${pde_build_dir} \
-DtopLevelElementType=feature \
-Dbase=${pde_base_dir} -DtopLevelElementId=${feature} \
-Dconfigs=linux,gtk,x86_64
if [ $? -ne 0 ]; then
exit 1
fi
pushd . > /dev/null 2>&1
# zip the built repository.
cd ${p2_repo_dir}
zip -r ${REPO_DEST}/${feature}.zip *
if [ $? -ne 0 ]; then
exit 1
fi
popd > /dev/null 2>&1
# cleanup the repository contents
rm -rf ${p2_repo_dir}/*
if [ $? -ne 0 ]; then
exit 1
fi
done
popd > /dev/null 2>&1
# Arguments
# ${1} == The Directory With The Specs File And Possibly Other Custom
@ -134,108 +226,9 @@ function buildRPM()
fi
}
function buildFeatureRPMs()
{
local CONST_COMPONENT_SPECS="Installer.cave-feature/component.spec"
local CONST_SETUP_DIR="Installer.cave-feature/feature.setup"
local CONST_SETUP_DIR_FULL="${WORKSPACE}/rpms/awips2.cave/${CONST_SETUP_DIR}"
local CONST_FEATURE_DIR="${WORKSPACE}/build/cave/p2/features"
local CONST_FEATURES_TXT="${WORKSPACE}/build/cave/p2/dist/features.txt"
if [ ! -f ${CONST_FEATURES_TXT} ]; then
echo "ERROR: Unable to find the list of features - ${CONST_FEATURES_TXT}."
exit 1
fi
local PROCESS_FEATURE_JAR="${WORKSPACE}/build/tools/ProcessFeature.jar"
for feature in `cat ${CONST_FEATURES_TXT}`;
do
if [ "${feature}" = "com.raytheon.uf.common.base.feature" ]; then
continue
fi
echo "feature = ${feature}"
if [ "${feature}" = "com.raytheon.uf.viz.cots.feature" ] ||
[ "${feature}" = "com.raytheon.uf.viz.base.feature" ] ||
[ "${feature}" = "com.raytheon.uf.viz.localization.perspective.feature" ] ||
[ "${feature}" = "com.raytheon.uf.viz.archive.feature" ] ||
[ "${feature}" = "com.raytheon.viz.satellite.feature" ] ||
[ "${feature}" = "com.raytheon.uf.viz.nwsauth.feature" ]; then
_component_name=""
_downstream_requires="awips2-common-base"
if [ "${feature}" = "com.raytheon.uf.viz.cots.feature" ]; then
_component_name="awips2-cave-viz-cots"
fi
if [ "${feature}" = "com.raytheon.uf.viz.base.feature" ]; then
_component_name="awips2-cave-viz-base"
fi
if [ "${feature}" = "com.raytheon.uf.viz.localization.perspective.feature" ]; then
_component_name="awips2-cave-viz-localization-perspective"
_downstream_requires="awips2-common-base awips2-cave-viz-base"
fi
if [ "${feature}" = "com.raytheon.uf.viz.archive.feature" ]; then
_component_name="awips2-cave-viz-archive"
_downstream_requires="awips2-common-base awips2-cave-viz-base"
fi
if [ "${feature}" = "com.raytheon.viz.satellite.feature" ]; then
_component_name="awips2-cave-viz-satellite"
_downstream_requires="awips2-common-base awips2-cave-viz-base awips2-cave-viz-core"
fi
if [ "${feature}" = "com.raytheon.uf.viz.nwsauth.feature" ]; then
_component_name="awips2-cave-viz-nwsauth"
_downstream_requires="awips2-common-base awips2-cave-viz-base"
fi
echo 'export COMPONENT_NAME="${_component_name}"' > \
${CONST_SETUP_DIR}/feature.setup
echo 'export COMPONENT_FEATURE="${feature}"' >> \
${CONST_SETUP_DIR}/feature.setup
echo 'export COMPONENT_DESC="${_component_name}"' >> \
${CONST_SETUP_DIR}/feature.setup
echo 'export DOWNSTREAM_REQUIRES="${_downstream_requires}"' >> \
${CONST_SETUP_DIR}/feature.setup
else
java -jar ${PROCESS_FEATURE_JAR} \
-p \
${CONST_FEATURE_DIR}/${feature} \
${CONST_SETUP_DIR_FULL}
if [ $? -ne 0 ]; then
echo "ERROR: ${PROCESS_FEATURE_JAR} Failed."
exit 1
fi
fi
if [ ! -f ${CONST_SETUP_DIR}/feature.setup ]; then
echo "ERROR: ${CONST_SETUP_DIR}/feature.setup Does Not Exist."
exit 1
fi
source ${CONST_SETUP_DIR}/feature.setup
echo "Building Feature ... ${feature}"
rpmbuild -ba --target=${TARGET_BUILD_ARCH} \
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
--define '_component_name %(echo ${COMPONENT_NAME})' \
--define '_component_feature %(echo ${COMPONENT_FEATURE})' \
--define '_component_desc %(echo ${COMPONENT_DESC})' \
--define '_downstream_requires %(echo ${DOWNSTREAM_REQUIRES})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_baseline_workspace %(echo ${WORKSPACE})' \
--define '_build_arch %(echo ${CAVE_BUILD_ARCH})' \
--buildroot ${AWIPSII_BUILD_ROOT} ${CONST_COMPONENT_SPECS}
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
done
}
# Adjust Our Execution Position.
cd ../
# Only Build The RPMs That May Have Changed - AWIPS II-Specific Components.
buildRPM "Installer.cave"
buildRPM "Installer.cave-wrapper"
buildFeatureRPMs

View file

@ -1,96 +0,0 @@
#!/bin/bash
# This is the initial version of the new script that will perform
# the CAVE PDE builds. This script will produce both the CAVE RCP
# applications for products in the baseline as well as the Eclipse
# p2 repositories for features in the baseline.
#
# Note: this script is not yet fully integrated. Another changeset is
# waiting in review that the full integration is dependent on.
VAR_WORKSPACE="workspace"
VAR_UFRAME_ECLIPSE="/opt/eclipse"
# Initially, we will demonstrate building an RCP application for awips.product
# with all features found in the main baseline as well as p2 repositories for each
# feature.
if [ "${UFRAME_ECLIPSE}" = "" ]; then
export UFRAME_ECLIPSE="${VAR_UFRAME_ECLIPSE}"
fi
if [ "${WORKSPACE}" = "" ]; then
export WORKSPACE="${VAR_WORKSPACE}"
fi
build_project_dir=${WORKSPACE}/build
pde_base_dir=${build_project_dir}/cave
pde_build_dir=${pde_base_dir}/tmp
prepare_dir=${pde_base_dir}/prepare
awips_product=com.raytheon.viz.product.awips/awips.product
if [ ! -d ${prepare_dir} ]; then
mkdir ${prepare_dir}
fi
# First, we need to build the dependency utility.
pushd . > /dev/null 2>&1
cd ${WORKSPACE}/awips.dependency.evaluator
/awips2/ant/bin/ant -f build.xml -Dbaseline.dir=${WORKSPACE} \
-Declipse.dir=${UFRAME_ECLIPSE} -Ddest.dir=${prepare_dir}
if [ $? -ne 0 ]; then
exit 1
fi
cd ${prepare_dir}
# Next, stage the plugins and determine what needs to be built.
# In another scenario that jar utility could be ran again with only the subset of features
# that need to be built prior to the repository build.
/awips2/java/bin/java -jar -DbaseLocation=${UFRAME_ECLIPSE} \
-DbuildDirectory=${pde_build_dir} -DstagingDirectory=${WORKSPACE} -DbuildFeatures=* \
-DbuildProduct=${awips_product} AwipsDependencyEvaluator.jar
if [ $? -ne 0 ]; then
exit 1
fi
_pde_launcher_jar=${UFRAME_ECLIPSE}/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
_pde_product_xml=${UFRAME_ECLIPSE}/plugins/org.eclipse.pde.build_3.8.2.v20121114-140810/scripts/productBuild/productBuild.xml
# Complete the CAVE RCP build.
/awips2/java/bin/java -jar ${_pde_launcher_jar} -application org.eclipse.ant.core.antRunner \
-buildfile ${_pde_product_xml} -DbaseLocation=${UFRAME_ECLIPSE} \
-Dbuilder=${pde_base_dir} -DbuildDirectory=${pde_build_dir} \
-Dbase=${pde_base_dir} -DproductFile=awips.product
if [ $? -ne 0 ]; then
exit 1
fi
# Prepare for the CAVE repository build. Need to create more resuse for a single build
# properties file so that it can be used for both product and feature builds.
pde_build_dir=${pde_base_dir}/p2
pde_base_dir=${pde_base_dir}/p2
/awips2/java/bin/java -jar -DbaseLocation=${UFRAME_ECLIPSE} \
-DbuildDirectory=${pde_build_dir} -DstagingDirectory=${WORKSPACE} -DbuildFeatures=* \
-DoutputFile=${prepare_dir}/repositoriesToBuild.txt \
AwipsDependencyEvaluator.jar
if [ $? -ne 0 ]; then
exit 1
fi
_pde_build_xml=${UFRAME_ECLIPSE}/plugins/org.eclipse.pde.build_3.8.2.v20121114-140810/scripts/build.xml
mkdir -p ${pde_base_dir}
cp -v ${build_project_dir}/build.properties.p2 ${pde_base_dir}/build.properties
for feature in `cat ${prepare_dir}/repositoriesToBuild.txt`; do
/awips2/java/bin/java -jar ${_pde_launcher_jar} -application org.eclipse.ant.core.antRunner \
-buildfile ${_pde_build_xml} -DbaseLocation=${UFRAME_ECLIPSE} \
-Dbuilder=${pde_base_dir} -DbuildDirectory=${pde_build_dir} \
-Dbase=${pde_base_dir} -DtopLevelElementId=${feature} \
-Dconfigs=linux,gtk,x86_64
if [ $? -ne 0 ]; then
exit 1
fi
# At this point, we will also store the repository that was produced in a zip archive
# for distribution.
done
popd > /dev/null 2>&1

View file

@ -443,7 +443,6 @@ fi
if [ "${1}" = "-viz" ]; then
buildRPM "awips2"
buildRPM "awips2-common-base"
#buildRPM "awips2-python-numpy"
#buildRPM "awips2-ant"
#buildRPM "awips2-python-dynamicserialize"

View file

@ -9,3 +9,4 @@ export WORKSPACE="/tmp/${USER}/baseline"
export UFRAME_ECLIPSE="/opt/uframe-eclipse"
export AWIPSCM_SHARE="/awipscm"
export AWIPSII_BUILD_ROOT="/tmp/${USER}/awips-component"
export REPO_DEST="/tmp/${USER}/repo"