awips2/edexOsgi/build.edex/build.xml
2017-10-04 12:28:09 -06:00

183 lines
5.8 KiB
XML

<project name="Build EDEX" default="main">
<property name="uframe.eclipse"
value="/awips2/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" />
<target name="init">
<exec executable="/usr/bin/find"
outputproperty="eclipse.launcher.jar">
<arg value="${uframe.eclipse}/plugins" />
<arg value="-name" />
<arg value="org.eclipse.equinox.launcher_*.jar" />
</exec>
<exec executable="/usr/bin/find"
outputproperty="pde.dir">
<arg value="${uframe.eclipse}/plugins" />
<arg value="-name" />
<arg value="org.eclipse.pde.build_*" />
</exec>
</target>
<target name="main-build" depends="clean, init">
<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.gfe.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.ncep.feature" />
</antcall>
</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, init, main-build, wa-build" />
<target name="build" depends="init">
<!-- 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="${pde.dir}/scripts/build.xml" />
<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="${eclipse.launcher.jar}" />
</classpath>
</java>
</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>