Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
510 lines (438 sloc) 20.2 KB
<?xml version="1.0"?>
<!DOCTYPE project [ <!ENTITY common SYSTEM "./etc/common.xml"> ]>
<project name="main" default="all" basedir=".">
<!-- ==================================================== -->
<!-- JacORB build file -->
<!-- $Id: build.xml,v 1.93 2011-11-23 15:30:00 nick.cross Exp $ -->
<!-- ==================================================== -->
<property file="${basedir}/build.properties" />
<property environment="env" />
<property name="jvm-name" value="java"/>
&common;
<!-- top-level target -->
<target name="all" depends="init,src-check,version-gen,compiler,omg_idl,jacorb,libs"
description="Build JacORB. To build with debugging, use -Ddebug=true."/>
<target name="src-check">
<fail message="Unable to find src files. Is this a binary distribution?">
<condition>
<not>
<available file="${src}/org/jacorb/build.xml"/>
</not>
</condition>
</fail>
</target>
<target name="version-gen" >
<tstamp />
<property name="BuildNo" value="${TODAY} ${TSTAMP}" />
<property name="jacorb_version_info" value=" CVS Build (${BuildNo})" />
<echo>
using BUILD_NUMBER: ${BuildNo}
using VERSION_INFO: ${jacorb_version_info}
</echo>
<copy file="${src}/org/jacorb/util/BuildVersion.template" tofile="${src.generated}/org/jacorb/util/BuildVersion.java" overwrite="true">
<filterset>
<filter token="BUILD_NUMBER" value="${BuildNo}"/>
<filter token="VERSION_INFO" value="${jacorb_version_info}" />
</filterset>
</copy>
<!-- need to delete the classes that depend on the version number -->
<delete failonerror="false">
<fileset dir="${classdir}">
<include name="org/jacorb/orb/ORB.class" />
<include name="org/jacorb/idl/parser.class" />
<include name="org/jacorb/orb/giop/CodeSet.class" />
</fileset>
</delete>
</target>
<!-- ==================================================== -->
<!-- IDL compiler -->
<!-- ==================================================== -->
<target name="compiler" depends="init,idlsrc,idllib"/>
<!-- package idl.jar -->
<target name="idllib" depends="idlsrc" >
<jar jarfile="${lib}/idl.jar"
basedir="${classdir}"
includes="org/jacorb/idl/**"
/>
</target>
<target name="idlsrc">
<ant antfile="${src}/org/jacorb/idl/build.xml" dir="${basedir}" />
</target>
<!-- ==================================================== -->
<!-- OMG IDL files -->
<!-- ==================================================== -->
<target name="omg_idl" depends="compiler">
<ant antfile="${basedir}/idl/build.xml" dir="${basedir}"/>
</target>
<!-- ==================================================== -->
<!-- JacORB implementation -->
<!-- ==================================================== -->
<target name="jacorb" depends="init">
<ant antfile="${src}/org/jacorb/build.xml" dir="${basedir}"/>
</target>
<!-- ==================================================== -->
<!-- Libraries -->
<!-- ==================================================== -->
<target name="libs" depends="init,jar,scripts"/>
<target name="jar" depends="init">
<delete file="${lib}/jacorb.jar" failonerror="false"/>
<delete file="${lib}/jacorb-services.jar" failonerror="false"/>
<jar jarfile="${lib}/jacorb.jar"
basedir="${classdir}"
includes="org/jacorb/**,org/omg/**"
excludes="org/jacorb/idl/**,
org/jacorb/demo/**,
org/jacorb/test/**,
org/jacorb/concurrency/**,
org/jacorb/collection/**,
org/jacorb/dds/**,
org/jacorb/events/**,
org/jacorb/notification/**,
org/jacorb/transaction/**,
org/omg/BridgeTransactionMgmt/**,
org/omg/CosBridgeAdmin/**,
org/omg/CosCollection/**,
org/omg/CosConcurrencyControl/**,
org/omg/CosEventChannelAdmin/**,
org/omg/CosEventComm/**,
org/omg/CosNotification/**,
org/omg/CosNotifyChannelAdmin/**,
org/omg/CosNotifyChannelAdminAck/**,
org/omg/CosNotifyComm/**,
org/omg/CosNotifyCommAck/**,
org/omg/CosNotifyFilter/**,
org/omg/CosTime/**,
org/omg/CosTrading/**,
org/omg/CosTransactions/**,
org/omg/CosTypedEventChannelAdmin/**,
org/omg/CosTypedEventComm/**,
org/omg/CosTypedEventNotifyChannelAdmin/**,
org/omg/CosTypedEventNotifyComm/**,
org/omg/dds/**,
org/omg/TimeBase/**
"
index="true">
<manifest>
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
<attribute name="Class-Path" value="slf4j-api-1.6.4.jar slf4j-jdk14-1.6.4.jar"/>
</manifest>
</jar>
<jar jarfile="${lib}/jacorb-services.jar"
basedir="${classdir}"
includes="org/jacorb/concurrency/**,
org/jacorb/collection/**,
org/jacorb/dds/**,
org/jacorb/events/**,
org/jacorb/notification/**,
org/jacorb/transaction/**,
org/omg/BridgeTransactionMgmt/**,
org/omg/CosBridgeAdmin/**,
org/omg/CosCollection/**,
org/omg/CosConcurrencyControl/**,
org/omg/CosEventChannelAdmin/**,
org/omg/CosEventComm/**,
org/omg/CosNotification/**,
org/omg/CosNotifyChannelAdmin/**,
org/omg/CosNotifyChannelAdminAck/**,
org/omg/CosNotifyComm/**,
org/omg/CosNotifyCommAck/**,
org/omg/CosNotifyFilter/**,
org/omg/CosTime/**,
org/omg/CosTrading/**,
org/omg/CosTransactions/**,
org/omg/CosTypedEventChannelAdmin/**,
org/omg/CosTypedEventComm/**,
org/omg/CosTypedEventNotifyChannelAdmin/**,
org/omg/CosTypedEventNotifyComm/**,
org/omg/TimeBase/**
org/omg/dds/**,
"
index="true">
<manifest>
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
<attribute name="Class-Path" value="antlr-2.7.2.jar picocontainer-1.2.jar"/>
</manifest>
</jar>
</target>
<!-- This target will split the JacORB jar into jacorb.jar containing JUST the implementation -->
<!-- code and omg.jar containing the generated stubs -->
<target name="jar_impl_omg" depends="init">
<delete file="${lib}/jacorb.jar" failonerror="false"/>
<delete file="${lib}/omg.jar" failonerror="false"/>
<jar jarfile="${lib}/jacorb.jar"
basedir="${classdir}"
includes="org/jacorb/**"
excludes="org/jacorb/idl/**,
org/jacorb/demo/**,
org/jacorb/test/**,
org/jacorb/concurrency/**,
org/jacorb/collection/**,
org/jacorb/dds/**,
org/jacorb/events/**,
org/jacorb/notification/**,
org/jacorb/transaction/**,
"
index="true">
<manifest>
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
<attribute name="Class-Path" value="slf4j-api-1.6.4.jar slf4j-jdk14-1.6.4.jar"/>
</manifest>
</jar>
<jar jarfile="${lib}/omg.jar"
basedir="${classdir}"
includes="org/omg/**"
excludes="org/omg/BridgeTransactionMgmt/**,
org/omg/CosBridgeAdmin/**,
org/omg/CosCollection/**,
org/omg/CosConcurrencyControl/**,
org/omg/CosEventChannelAdmin/**,
org/omg/CosEventComm/**,
org/omg/CosNotification/**,
org/omg/CosNotifyChannelAdmin/**,
org/omg/CosNotifyChannelAdminAck/**,
org/omg/CosNotifyComm/**,
org/omg/CosNotifyCommAck/**,
org/omg/CosNotifyFilter/**,
org/omg/CosTime/**,
org/omg/CosTrading/**,
org/omg/CosTransactions/**,
org/omg/CosTypedEventChannelAdmin/**,
org/omg/CosTypedEventComm/**,
org/omg/CosTypedEventNotifyChannelAdmin/**,
org/omg/CosTypedEventNotifyComm/**,
org/omg/dds/**,
org/omg/TimeBase/**
"
index="true">
<manifest>
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
<attribute name="Class-Path" value="slf4j-api-1.6.4.jar slf4j-jdk14-1.6.4.jar"/>
</manifest>
</jar>
</target>
<target name="scripts" depends="init" description="Generate the scripts">
<macrodef name="jacorb-loadfile">
<attribute name="srcFile" />
<attribute name="property" />
<sequential>
<loadfile srcFile="@{srcFile}"
property="@{property}"
failonerror="true" />
</sequential>
</macrodef>
<jacorb-loadfile
srcFile="bin/resolve_jacorb_home.tok"
property="token.resolve-jacorb-home" />
<jacorb-loadfile
srcFile="bin/resolve_java_cmd.tok"
property="token.resolve-java-cmd" />
<jacorb-loadfile
srcFile="bin/resolve_jaco_cmd.tok"
property="token.resolve-jaco-cmd" />
<copy todir="bin" overwrite="true">
<fileset dir="bin">
<include name="*.tpl"/>
</fileset>
<globmapper from="*.tpl" to="*"/>
<filterset>
<filter token="JACORB_BOOTCLASSPATH"
value="-Djava.endorsed.dirs=&quot;${JACORB_HOME}/lib&quot;" />
<filter token="RESOLVE_JACORB_HOME"
value="${token.resolve-jacorb-home}" />
<filter token="RESOLVE_JAVA_CMD"
value="${token.resolve-java-cmd}" />
<filter token="RESOLVE_JACO_CMD"
value="${token.resolve-jaco-cmd}" />
<filter token="JAVA_CMD" value="${jvm-name}" />
<filter token="JACORB_HOME"
value="${basedir}" />
<filter token="DONT_EDIT"
value="don't edit this file. edit the template instead" />
</filterset>
</copy>
<condition property="eol" value="crlf">
<or>
<os family="windows"/>
<os family="dos"/>
</or>
</condition>
<!-- shell scripts should always be set to LF -->
<property name="eol" value="lf" />
<fixcrlf srcDir="bin"
includes="*"
excludes="*.exe,*.conf,*template*"
eol="${eol}" />
<chmod perm="ugo+rx">
<fileset dir="bin">
<include name="*" />
<exclude name="*.bat" />
<exclude name="*.exe" />
<exclude name="*.conf" />
<exclude name="*template*" />
</fileset>
</chmod>
</target>
<!-- ==================================================== -->
<!-- clean up -->
<!-- ==================================================== -->
<target name="clean" depends="init" description="Clean the checkout">
<delete file="${basedir}/bin/idl"/>
<delete file="${basedir}/bin/idl.bat"/>
<delete file="${basedir}/bin/jaco"/>
<delete file="${basedir}/bin/jaco.bat"/>
<delete file="${basedir}/bin/ntfy-wrapper" />
<delete file="${basedir}/bin/ns-wrapper" />
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${classdir}" includes="**/*" />
</delete>
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${src.generated}" includes="**/*" />
</delete>
<delete failonerror="false" >
<fileset dir="${basedir}/src/org/jacorb/idl" >
<include name="**/parser.java"/>
<include name="**/sym.java"/>
</fileset>
</delete>
</target>
<target name="realclean" depends="clean" description="Clean the checkout including generated jars">
<delete failonerror="false" >
<fileset dir="lib/" includes="jacorb.jar, idl.jar"/>
</delete >
</target>
<!-- ==================================================== -->
<!-- API documentation -->
<!-- ==================================================== -->
<target name="doc" depends="init" description="Create the Javadoc">
<property name="PKGNAMES" value="org.jacorb.idl.*,org.jacorb.util.*,org.jacorb.orb.*,org.jacorb.imr.*,org.jacorb.ir.*,org.jacorb.poa.*,org.jacorb.events.*,org.jacorb.naming.*,org.jacorb.security.sas.*,org.omg.*,org.jacorb.notification.*" />
<property name="PKGNAMES_EXCLUDED" value="org.jacorb.notification.filter.bsh" />
<property name="SRCDIR2" value="" />
<!-- ignore xdoclet tags -->
<property name="IGNORED_TAGS" value="-tag jmx.mbean:X -tag jboss.xmbean:X -tag jmx.managed-attribute:X -tag jmx.managed-operation:X" />
<mkdir dir="${basedir}/doc/api"/>
<javadoc destdir="${basedir}/doc/api"
additionalparam="${IGNORED_TAGS}"
classpathref="path.base"
Splitindex="Yes"
Use="Yes"
maxmemory="256m"
packagenames="${PKGNAMES}"
excludepackagenames="${PKGNAMES_EXCLUDED}">
<sourcepath>
<path refid="sourcepath.base" />
<path path="${SRCDIR2}" />
</sourcepath>
</javadoc>
</target>
<!-- ==================================================== -->
<!-- PMD -->
<!-- ==================================================== -->
<target name="pmd-locate" if="env.PMD_HOME" >
<property name="pmd.home" value="${env.PMD_HOME}" />
</target>
<target name="pmd-path1" depends="pmd-locate" if="pmd.home">
<path id="pmd.path" >
<fileset dir="${pmd.home}/lib" >
<include name="*.jar" />
</fileset>
</path>
</target>
<target name="pmd-path2" depends="pmd-path1" unless="pmd.home">
<path id="pmd.path" >
<pathelement path="${java.class.path}"/>
</path>
</target>
<target name="pmd-check" depends="pmd-path2" >
<available classname="net.sourceforge.pmd.ant.PMDTask" property="pmd.isavailable" classpathref="pmd.path"/>
<fail unless="pmd.isavailable" >
error
unable to locate PMD (http://pmd.sourceforge.net).
either set the environment variable PMD_HOME,
set the ant property pmd.home or add the PMD
classes to your CLASSPATH.
</fail>
<pathconvert property="_pmd.cp" refid="pmd.path" />
<echo level="verbose">pmd is using classpath: ${_pmd.cp}</echo>
</target>
<target name="pmd-taskdef" depends="init, pmd-check">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.path"/>
</target>
<target name="pmd" depends="init, pmd-taskdef">
<echo message="this might take some time..." />
<pmd rulesetfiles="${basedir}/etc/pmd-ruleset.xml" shortFilenames="true">
<formatter type="summaryhtml" toFile="pmd_report.html"/>
<fileset dir="${src}/org/jacorb">
<!-- So much is generated code is there much point? -->
<!-- <include name="idl/**/*.java"/> -->
<include name="imr/**/*.java"/>
<include name="orb/**/*.java"/>
<include name="poa/**/*.java"/>
<include name="security/**/*.java"/>
<include name="util/**/*.java"/>
<!-- Exclude tracing as very old unsupported code -->
<exclude name="util/tracing/*.java"/>
</fileset>
</pmd>
</target>
<!-- ==================================================== -->
<!-- FINDBUGS -->
<!-- ==================================================== -->
<target name="findbugs-locate" if="env.FINDBUGS_HOME">
<property name="findbugs.home" value="${env.FINDBUGS_HOME}" />
</target>
<target name="findbugs-path1" depends="findbugs-locate" if="findbugs.home" >
<path id="findbugs.path">
<fileset dir="${findbugs.home}/lib" >
<include name="*.jar" />
</fileset>
</path>
</target>
<target name="findbugs-path2" depends="findbugs-path1" unless="findbugs.home">
<echo message="findbugs-path2" />
<path id="findbugs.path" >
<pathelement path="${java.class.path}"/>
</path>
</target>
<target name="findbugs-check" depends="findbugs-path2">
<available classname="edu.umd.cs.findbugs.anttask.FindBugsTask" property="findbugs.isavailable" classpathref="findbugs.path"/>
<fail unless="findbugs.isavailable" >
error
unable to locate FindBugs (http://findbugs.sourceforge.net/).
either set the environment variable FINDBUGS_HOME,
set the ant property findbugs.home or add the FindBugs
classes to your CLASSPATH.
</fail>
<pathconvert property="_findbugs.cp" refid="findbugs.path" />
<echo level="verbose">findbugs is using classpath: ${_findbugs.cp}</echo>
</target>
<target name="findbugs-taskdef" depends="init, findbugs-check">
<pathconvert property="_findbugs.cp" refid="findbugs.path" />
<echo level="verbose">findbugs is using classpath: ${_findbugs.cp}</echo>
<taskdef name="findBugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.path"/>
</target>
<target name="findbugs" depends="findbugs-taskdef">
<echo message="this might take some time..." />
<findBugs home="${findbugs.home}"
output="html"
outputFile="${basedir}/findbugs_report.html"
excludeFilter="${basedir}/etc/findbugs-ruleset.xml"
reportLevel="medium"
effort="default"
jvmargs="-Xmx500M"
timeout="12000000">
<sourcePath path="${src}"/>
<auxClasspath path="${classdir}"/>
<auxClasspath path="${basedir}/lib/slf4j-api-1.6.4.jar"/>
<systemProperty name="findbugs.de.comment" value="true"/>
<class location="${basedir}/classes/org/jacorb/imr"/>
<class location="${basedir}/classes/org/jacorb/orb"/>
<class location="${basedir}/classes/org/jacorb/poa"/>
<class location="${basedir}/classes/org/jacorb/security"/>
<class location="${basedir}/classes/org/jacorb/util"/>
</findBugs>
</target>
</project>