awips2/edexOsgi/build.edex/build.xml
Bryan Kowal 8faa97d87a Omaha #5151 - allow additional features to be read from an external file and built in the exact order specified.
Eliminates the need for separate WA-specific properties files now that WAs are permanent separate repositories.


Former-commit-id: de0f6e355d849c3dec8c7878d6d00e584812795d
2015-11-24 14:55:33 -06:00

275 lines
9.3 KiB
XML

<project name="Build EDEX" default="main">
<property name="uframe.eclipse"
value="/opt/uframe-eclipse" />
<property name="build.version"
value="1.0.0" />
<property name="build.os"
value="linux" />
<property name="build.ws"
value="gtk" />
<property name="build.arch"
value="x86" />
<property name="lightning"
value="false" />
<property name="pde.build.script"
value="./org.eclipse.pde.build_3.8.2.v20121114-140810/scripts/build.xml" />
<property name="eclipse.launcher.jar"
value="org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar" />
<target name="main-build" depends="clean">
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.common.base.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.base.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.cots.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.common.core.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.core.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.dataplugins.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.bufr.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.grid.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.archive.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.text.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.satellite.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.gfe.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.hydro.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.radar.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.dat.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.ncep.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.ncep.nco.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.ost.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.npp.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.registry.request.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.registry.client.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.registry.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.remote.script.feature" />
</antcall>
<!-- SPECIAL CASE -->
<if>
<equals arg1="${lightning}" arg2="true" />
<then>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.binlightning.feature" />
</antcall>
</then>
</if>
</target>
<!--
In the work assignment's edexOsgi/build.edex directory, create a file named similar to the following:
edexOsgi/build.edex/5-Data_Delivery-wa-build.properties
In the file, there should be one line such as:
wa.features=feature1,feature2
-->
<target name="wa-build" depends="main-build" description="Builds work assignment specific features after the main build">
<if>
<available file="${basedir}/features.txt" type="file" />
<then>
<loadfile property="wa.features"
srcfile="${basedir}/features.txt" />
<for param="line" list="${wa.features}"
delimiter="${line.separator}">
<sequential>
<antcall target="build">
<param name="feature" value="@{line}" />
</antcall>
</sequential>
</for>
</then>
</if>
<antcall target="wa-cleanup" />
<antcall target="clean" />
</target>
<target name="wa-cleanup" description="Removes references to WA-specific features that should not be built as an RPM.">
<for param="wa.feature.list.file">
<fileset dir="${basedir}" includes="*-wa-build.properties" />
<sequential>
<var name="wa.features.ignore" unset="true" />
<property file="@{wa.feature.list.file}" />
<for list="${wa.features.ignore}" param="wa.feature">
<sequential>
<propertyregex property="edex.component"
override="true"
input="@{wa.feature}"
regexp="\."
replace="-" />
<propertyregex property="edex.component"
override="true"
input="${edex.component}"
regexp="com-raytheon-uf-(.+)-feature"
select="\1" />
<if>
<available file="${basedir}/edex/dist/${edex.component}.zip" />
<then>
<!-- Remove the feature zip file. -->
<delete file="${basedir}/edex/dist/${edex.component}.zip"
failonerror="true" />
</then>
</if>
</sequential>
</for>
</sequential>
</for>
</target>
<target name="main" depends="clean, main-build, wa-build" />
<target name="build">
<!-- Execute the eclipse pde build script. -->
<echo message="feature=${feature}" />
<java
classname="org.eclipse.core.launcher.Main"
fork="true"
failonerror="true">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
<arg value="${uframe.eclipse}/plugins/${pde.build.script}" />
<arg value="-DbaseLocation=${uframe.eclipse}" />
<arg value="-Dbuilder=${basedir}/edex" />
<arg value="-DbuildDirectory=${basedir}/edex/tmp" />
<arg value="-DtopLevelElementId=${feature}" />
<arg value="-Dbase=${basedir}/edex" />
<arg value="-Dconfigs=${build.os},${build.ws},${build.arch}" />
<classpath>
<pathelement
location="${uframe.eclipse}/plugins/${eclipse.launcher.jar}" />
</classpath>
</java>
</target>
<target name="buildHybrid" depends="clean">
<echo message="feature=com.raytheon.uf.common.base.feature" />
<java
classname="org.eclipse.core.launcher.Main"
fork="true"
failonerror="true">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
<arg value="${uframe.eclipse}/plugins/${pde.build.script}" />
<arg value="-DbaseLocation=${uframe.eclipse}" />
<arg value="-Dbuilder=${basedir}/edex" />
<arg value="-DbuildDirectory=${basedir}/edex/tmp" />
<arg value="-DtopLevelElementId=com.raytheon.uf.common.base.feature" />
<arg value="-Dbase=${basedir}/edex" />
<arg value="-Dconfigs=${build.os},${build.ws},${build.arch}" />
<arg value="-Dgenerate.p2.metadata=true" />
<arg value="-Dp2.metadata.repo=file:/${basedir}/edex/postBuild/awips2/cave/.repository" />
<arg value="-Dp2.artifact.repo=file:/${basedir}/edex/postBuild/awips2/cave/.repository" />
<arg value="-Dp2.publish.artifacts=true" />
<arg value="-DgenerateVersionsList=true" />
<classpath>
<pathelement
location="${uframe.eclipse}/plugins/${eclipse.launcher.jar}" />
</classpath>
</java>
<antcall target="clean" />
</target>
<target name="clean">
<if>
<available file="${basedir}/edex/includes"
type="dir" />
<then>
<delete includeemptydirs="true">
<fileset dir="${basedir}/edex"
includes ="includes/**" />
</delete>
</then>
</if>
<if>
<available file="${basedir}/edex/tmp"
type="dir" />
<then>
<delete includeemptydirs="true">
<fileset dir="${basedir}/edex"
includes ="tmp/**" />
</delete>
</then>
</if>
</target>
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${basedir}/lib/ant/ant-contrib-1.0b3.jar" />
</project>