Update of /cvsroot/mocklib/osgimgr/bldfiles
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5023/bldfiles
Added Files:
ant.properties build.xml checkin.xml design.xml
directory.properties
Log Message:
add osgimgr to mocklib project for now.
--- NEW FILE: design.xml ---
<design>
<!-- See the documentation of the ant-contrib project to fill in the package design here
ant-contrib is at http://sourceforge.net/projects/ant-contrib. Currently, this
template is using a version from the CVS head, and the docs are up to date on the
CVS head, but not in the latest download yet as I have not asked for a new release
on ant-contrib yet(wanted to finish a few more things), but this is stable and works.
I just want to add one more feature-->
<!-- DO NOT MODIFY THE NEXT LINES -->
<package name="manifest" package="biz.xsoftware.manifest"
needdeclarations="true" subpackages="include" needdepends="false"/>
<package name="junit" package="junit" subpackages="include" needdeclarations="false"/>
<package name="mock" package="biz.xsoftware.mock" needdeclarations="false"/>
<!-- this is a jmx bundle and everyone depends on jmx so allow not
having to declare dependencies on jmx -->
<package name="jmx" package="javax.management" subpackages="include" needdeclarations="false"/>
<package name="mx4j" package="mx4j.tools.adaptor.http"/>
<package name="servicebinder" package="org.ungoverned.gravity.servicebinder" subpackages="include"/>
<package name="osgimgrapi" package="biz.xsoftware.api.osgimgr">
<depends>servicebinder</depends>
</package>
<package name="mgmtapi" package="biz.xsoftware.api.mgmt"/>
<package name="osgimgr" package="biz.xsoftware.osgimgr">
<depends>mgmtapi</depends>
<depends>osgimgrapi</depends>
<depends>mx4j</depends>
</package>
<package name="osgi" package="org.osgi.framework"/>
<package name="activator" package="osgi" subpackages="include">
<depends>servicebinder</depends>
<depends>osgimgrapi</depends>
<depends>osgi</depends>
</package>
<package name="test" package="biz.xsoftware.test" subpackages="include">
<depends>osgimgrapi</depends>
</package>
</design>
--- NEW FILE: ant.properties ---
#-----------------------------------------------------------------------
# MANIFEST and JAR properties - Make sure you change these to your settings.
#-----------------------------------------------------------------------
name = osgimgr
#used as the jar file name(ie. ${name}.jar)
#used as zip file name(ie. ${name}-version.jar)
#used as the directory staging name
#version info may be retrieved using java -jar ${name}.jar -version
imports =org.ungoverned.gravity.servicebinder
exports =biz.xsoftware.api.osgimgr
impl.pattern =biz/xsoftware/osgi/mgr/**,biz/xsoftware/test/**
#The packages to make private
build.source=5
manifest.mainclass = TOOLS.JAVA.Main
#The class that is run when java -jar xxxx.jar is run
manifest.title = Ant Build Template
manifest.vendor = http://www.xsoftware.biz
manifest.builder = Dean Hiller
manifest.description = Put a project description here
manifest.icon =
copyright = Copyright © 2000 Dean Hiller All Rights Reserved.
javadoc.title = Build Template
javadoc.bottom = http://www.xsoftware.biz
#-----------------------------------------------------------------------
# Properties to run the program using the "run" target in build.xml(ie. build run)
# Just try ./build run to execute org.NO.MAIN.YET below(of course, that class
# doesn't exist, so I would suggest changing that.
#-----------------------------------------------------------------------
client.to.run = org.NO.MAIN.YET
#Class run when "build run" target is used
client.args =
#params to the java app for the run target to run the application
client.jvm.args = -enableassertions
#params to the JVM for the run target to run the application
###########################################################
# If you need JNI header files, uncomment the following property
# and put the classes that need to generate header files
# in this property(a comma delimted list)
##########################################################
#
#javah.classes=com.avaya.example.callinfo.mci.MCI
#
###########################################################
#If you need to use castor set 'xsd.start' to the name
#of your main xsd file, and uncomment the line
##########################################################
#
#xsd.start=yourName.xsd
#
--- NEW FILE: checkin.xml ---
<?xml version="1.0"?>
<!--
Run "ant -projecthelp" to view all the possible targets and descriptions.
-->
<project name="std_buildfile" default="testall" basedir="..">
<target name="checkinApi">
<cvs command="commit -m Delivery-of-new-release input/libinclude" failonerror="true"/>
</target>
<target name="checkinFramework">
<cvs command="commit -m Delivery-of-new-release input/libexclude" failonerror="true"/>
</target>
<target name="checkinServiceBinder">
<cvs command="commit -m Delivery-of-new-release input/libexclude" failonerror="true"/>
</target>
</project>
--- NEW FILE: build.xml ---
<?xml version="1.0"?>
<!--
Run "ant -projecthelp" to view all the possible targets and descriptions.
-->
<project name="std_buildfile" default="all" basedir="..">
<!-- Now allow any of the properties to be overridden -->
<property file="${user.home}/ant.properties" />
<property file="bldfiles/ant.properties"/>
<property file="bldfiles/directory.properties"/>
<available property="makeExists" file="${native}/Makefile"/>
<!--convert the lib file separators to this file system for later use in pathconvert
to put together the manifest file -->
<!--we can't do this if there are tool jars in the lib as we don't want tool jars in
the manifest classpath???? or do we? -->
<property name="full.lib.path" location="${lib}"/>
<property name="jar.name" value="${name}.jar"/>
<description>
This is a generic build file template. All the customizable properties are
in ant.properties file. All the directories used by this template are in
directory.properties file.
</description>
<!--
***********************************************************************
TASK DEFINITIONS
***********************************************************************
-->
<property name="junit.location" location="${tool.dir}/ant-junit"/>
<path id="junit.lib">
<pathelement path="${junit.location}/ant-junit.jar"/>
<pathelement path="${junit.location}/junit.jar"/>
</path>
<property name="antcontrib.location" location="${tool.dir}/ant-contrib"/>
<path id="antcontrib.lib">
<fileset dir="${antcontrib.location}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- directory that contains emma.jar and emma_ant.jar: -->
<property name="emma.dir" value="${tool.dir}/emma" />
<path id="emma.lib" >
<fileset dir="${emma.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<property name="findbugs.dir" value="${tool.dir}/findbugs" />
<path id="findbugs.lib" >
<fileset dir="${findbugs.dir}/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<property name="checkstyle.dir" value="${tool.dir}/checkstyle" />
<!-- directory that contains osgi ant tasks -->
<property name="osgi.dir" value="${tool.dir}/osgi" />
<path id="osgi.lib" >
<fileset dir="${osgi.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!--
***********************************************************************
PATH DEFINITIONS
***********************************************************************
-->
<path id="lib.include">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- all Third Party jars and tool jars this module needs to compile -->
<path id="lib.jars">
<path refid="lib.include"/>
<fileset dir="${libexclude}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- must keep junit jars separate for ease of creating classpath in manifest -->
<path id="tool.and.lib">
<path refid="lib.jars"/>
<fileset dir="${junit.location}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="classes.classpath" >
<pathelement location="${build}" />
</path>
<path id="testall.classpath">
<fileset dir="${codecov.jar}" includes="**/*.jar"/>
<!--pathelement location="${codecov.temp}"/-->
<path refid="tool.and.lib"/>
<path refid="classes.classpath"/>
</path>
<!--
***********************************************************************
INIT TASKS
***********************************************************************
-->
<target name="taskdefs">
<tstamp>
<format property="manifest.date"
pattern ="EE MMMM d yyyy, HH:mm:ss"
locale ="en"/>
</tstamp>
<!-- Override this property to build official release -->
<property name="version" value="Developer-Build"/>
<echo message="***************************USING THIS ANT************************"/>
<echo message="ant.home=${ant.home}"/>
<echo message="*****************************************************************"/>
<!--Just a convenient pathconvert to debug paths above by converting to string and printing -->
<pathconvert dirsep="/" pathsep=" " property="temp.somepath" refid="junit.lib" setonempty="true"/>
<echo message="junit.lib=${temp.somepath}"/>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpathref="junit.lib"/>
<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="antcontrib.lib"/>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
<!-- for some reason, I can't use resource="checkstyletask.properties" as it fails here-->
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath>
<fileset dir="${checkstyle.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<taskdef name="bundleinfo" classname="org.knopflerfish.ant.taskdefs.bundle.BundleInfoTask" classpathref="osgi.lib"/>
<taskdef name="bundlemanifest" classname="org.knopflerfish.ant.taskdefs.bundle.BundleManifestTask" classpathref="osgi.lib"/>
<taskdef name="bundlehtml" classname="org.knopflerfish.ant.taskdefs.bundle.BundleHTMLExtractorTask" classpathref="osgi.lib"/>
<taskdef name="bundleobr" classname="org.knopflerfish.ant.taskdefs.bundle.OBRExtractorTask" classpathref="osgi.lib"/>
</target>
<!--
***********************************************************************
BEGIN TARGETS
***********************************************************************
-->
<!-- Just creates the input directories this build file uses if they are not
already created -->
<target name="create-src" depends="taskdefs" description="Create src directories for a new project">
<mkdir dir="${javacode}"/>
<mkdir dir="${lib}"/>
<mkdir dir="${staging.in}"/>
<mkdir dir="${properties}"/>
<mkdir dir="${scripts}"/>
<mkdir dir="${test.input}"/>
<mkdir dir="${native}"/>
<mkdir dir="${schemas}"/>
<mkdir dir="${jardist}"/>
<!-- classpath for the jars needed to run application
Used in testall, test, and run targets-->
<path id="classpath.application">
<fileset dir="${jardist}">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${jardist}"/>
</path>
</target>
<!--
***********************************************************************
COMPILE TARGET
***********************************************************************
-->
<target name="compile" depends="create-src" description="Compile code">
<mkdir dir="${build}"/>
<pathconvert property="compile.classpath" pathsep=":">
<path refid="tool.and.lib"/>
</pathconvert>
<echo message="Compiling files in ${javacode}"/>
<echo message="Putting the class files in ${build}"/>
<echo message="classpath=${compile.classpath}"/>
<!-- Compile the java code from ${javacode} into ${build} -->
<javac srcdir="${javacode}" destdir="${build}" deprecation="yes" debug="on">
<classpath>
<path refid="tool.and.lib"/>
</classpath>
</javac>
<!-- copy all misc. files over(config.jaas, etc.) from the ${javacode} directory-->
<!-- Will not copy over *.jpg, *.gif, *.html for here(those are for javadoc)-->
<copy todir="${build}">
<fileset dir="${javacode}">
<exclude name="**/*.java"/>
<exclude name="**/*.htm"/>
<exclude name="**/*.html"/>
<exclude name="**/*.jpg"/>
<exclude name="**/*.gif"/>
<exclude name="**/*.bak"/>
<exclude name="**/*~"/>
<exclude name="**/vssver*.*"/>
<exclude name="**/.nbattrs"/>
</fileset>
<!-- copy all *.property files or other misc. files over(*.gif, *.jpg, etc.)
from the ${properties} directory -->
<fileset dir="${properties}">
<exclude name="**/*.java"/>
<exclude name="**/*.bak"/>
<exclude name="**/*~"/>
</fileset>
</copy>
<!-- convert any asian languages from UTF-8 to ascii so they can be used-->
<native2ascii encoding="UTF-8" src="${properties}" dest="${build}"
includes="**/*.utf8-properties" ext=".properties"/>
<!--check for rmi stubs so if there are we will do the next target-->
<fileset dir="${build}" id="rmi.fileset">
<include name="**/RMI*.class"/>
</fileset>
<pathconvert pathsep="\r\n" property="have.rmi.files" refid="rmi.fileset" setonempty="false"/>
</target>
<!--
***********************************************************************
RMI TARGET - This target is automatically skipped if there are no RMI files
***********************************************************************
-->
<target name="rmi-stubs" depends="compile" if="have.rmi.files" description="Create rmi stubs">
<echo message="******************RMI FILES TO COMPILE********************"/>
<echo message="rmifiles=${have.rmi.files}"/>
<echo message="**********************************************************"/>
<mkdir dir="${rmi.stubs}"/>
<rmic base="${build}" includes="**\RMI*.class" debug="yes">
<classpath>
<pathelement path="${build}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</rmic>
<copy todir="${rmi.stubs}">
<fileset dir="${build}" includes="**\Remote*.class"/>
<fileset dir="${build}" includes="**\*_Stub.class"/>
<fileset dir="${build}" includes="**\*_Skel.class"/>
</copy>
</target>
<!--
***********************************************************************
OSGI specific stuff
***********************************************************************
-->
<target name="key1" if="exports" depends="compile">
<property name="export" value="Export-Package"/>
</target>
<target name="key2" unless="exports" depends="key1">
<property name="export" value="No-Export-Package"/>
</target>
<target name="manifest" depends="key2">
<mkdir dir="${manifest}"/>
<property name="bundle.uuid" value="biz.xsoftware:${name}:${version}:all"/>
<property name="ee.check.foundation" value="false"/>
<property name="bundle.emptystring" value="[bundle.emptystring]"/>
<!--generate classpath to add to manifest using all jars in lib and main jar-->
<pathconvert dirsep="/" pathsep="," property="osgi.classpath" refid="lib.include" setonempty="true">
<!--The map takes away the beginning of the path just leaving the jar file name -->
<map from="${full.lib.path}${file.separator}" to=""/>
</pathconvert>
<property name="bundle.classpath" value=".,${osgi.classpath}"/>
<echo message="bundle.classpath=${bundle.classpath}"/>
<bundleinfo exports = "export.package"
checkFoundationEE = "${ee.check.foundation}">
<fileset dir="${build}" includes="${api.pattern}"/>
</bundleinfo>
<property name="bundle.activator" value="osgi.Activator"/>
<bundleinfo activator = "bundle.activator"
imports = "import.package"
stdimports = "${ignore.imports}"
checkFoundationEE = "${ee.check.foundation}">
<fileset dir="${build}" includes="${impl.pattern}"/>
</bundleinfo>
<echo message="export=${export}"/>
<bundlemanifest file = "${manifest}/MANIFEST.MF">
<attribute name="Bundle-Name" value="${name}"/>
<attribute name="Bundle-SymbolicName" value="${name}"/>
<attribute name="Bundle-Version" value="${version}"/>
<attribute name="Bundle-Description" value="${manifest.description}"/>
<attribute name="Bundle-Vendor" value="${manifest.vendor}"/>
<attribute name="Bundle-DocURL" value="${manifest.vendor}"/>
<attribute name="Bundle-ContactAddress" value="${manifest.vendor}"/>
<attribute name="Bundle-Activator" value="${bundle.activator}"/>
<attribute name="Bundle-Category" value="${bundle.emptystring}"/>
<attribute name="Bundle-Config" value="${bundle.emptystring}"/>
<attribute name="Bundle-Classpath" value="${bundle.classpath}"/>
<attribute name="Export-Service" value="${bundle.emptystring}"/>
<attribute name="Import-Service" value="${bundle.emptystring}"/>
<attribute name="${export}" value="${exports}"/>
<attribute name="Import-Package" value="${imports}"/>
<attribute name="Bundle-UUID" value="${bundle.uuid}"/>
<attribute name="Built-From" value="${manifest.builder}"/>
<attribute name="Build-Date" value="${manifest.date}"/>
<attribute name="Application-Icon" value="${manifest.icon}"/>
<attribute name="Bundle-SubversionURL" value="${manifest.vendor}"/>
<attribute name="Bundle-APIVendor" value="${manifest.vendor}"/>
<attribute name="Built-By" value="${manifest.builder}"/>
<attribute name="Main-Class" value="biz.xsoftware.manifest.ManifestInfo"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
<!--
<attribute name="Specification-Title" value="${spec.title}"/>
<attribute name="Specification-Version" value="${spec.version}"/>
<attribute name="Specification-Vendor" value="${spec.vendor}"/>
-->
<attribute name="Implementation-Title" value="${manifest.title}"/>
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
<attribute name="Implementation-Vendor" value="${manifest.vendor}"/>
<!-- non-standard manifest attributes -->
<attribute name="SubMain-Class" value="${manifest.mainclass}"/>
<attribute name="JarVersion" value="${version} ${TODAY}"/>
<!--
<section name="common/class1.class">
<attribute name="Sealed" value="false"/>
</section>
-->
</bundlemanifest>
</target>
<!--
***********************************************************************
JAR TARGET
***********************************************************************
-->
<target name="jar" depends="manifest, make" description="Create distribution">
<!-- Create the distribution directory -->
<mkdir dir="${jardist}"/>
<!-- copy all jars that need to be in this osgi bundle jar into the directory that will be jarred up-->
<copy todir="${build}">
<fileset dir="${lib}" includes="**"/>
</copy>
<!-- Put all implementation classes from ${build} into the jar file -->
<jar jarfile="${jardist}/${jar.name}" basedir="${build}" manifest="${manifest}/MANIFEST.MF"/>
<verifydesign jar="${jardist}/${jar.name}" design="bldfiles/design.xml"/>
</target>
<!--
================================================================================
Creates the distribution
================================================================================
-->
<target name="createdist" depends="jar" description="Creates the distribution">
<mkdir dir="${dist}"/>
<mkdir dir="${staging}"/>
<copy todir="${staging}">
<fileset dir="${staging.in}" includes="**/*"/>
</copy>
</target>
<!--
***********************************************************************
START APPLICATION TARGET
***********************************************************************
-->
<target name="run" depends="jar" description="Run Java application after compiling code">
<pathconvert property="application.classpath" pathsep=":">
<path refid="classpath.application"/>
</pathconvert>
<echo message="Forking of the program...${client.to.run}"/>
<echo message="classpath=${application.classpath}"/>
<echo message="codebase=${basedir}\${rmi.stubs}"/>
<echo message="jvmargs=${client.jvm.args}"/>
<echo message="program args=${client.args}"/>
<java classname="${client.to.run}" fork="yes" dir=".">
<jvmarg line="${client.jvm.args}"/>
<arg line="${client.args}"/>
<classpath>
<path refid="classpath.application"/>
</classpath>
</java>
</target>
<!--
***********************************************************************
INSTRUMENTATION TARGET
***********************************************************************
-->
<target name="instrumentation" depends="jar">
<property name="emma.enabled" value="true"/>
<mkdir dir="${codecov.temp}"/>
<mkdir dir="${codecov.classes}"/>
<mkdir dir="${codecov.jar}"/>
<mkdir dir="${codecov.report}"/>
<pathconvert property="instr.classpath" pathsep=":">
<path refid="classes.classpath"/>
</pathconvert>
<echo message="instr.classpath=${instr.classpath}"/>
<emma enabled="${emma.enabled}" >
<instr instrpathref="classes.classpath"
destdir="${codecov.classes}"
metadatafile="${codecov.temp}/metadata.emma"
merge="true"
/>
</emma>
<jar destfile="${codecov.jar}/${name}-instrumented.jar" duplicate="preserve"
manifest="${manifest}/MANIFEST.MF">
<fileset dir="${codecov.classes}" includes="**"/>
<fileset dir="${build}" includes="**"/>
</jar>
</target>
<!--
***********************************************************************
OSGI TARGET
***********************************************************************
-->
<target name="osgi">
<unzip src="${input}/osgi/osgiminimum.zip" dest="${generated}/osgigen"/>
</target>
<!--
***********************************************************************
TEST TARGET
***********************************************************************
-->
<target name="test" depends="osgi, createdist" description="Run ONE Junit test">
<input message="Input test class name. (ie. org.awt.TestEdgeLayout):"
addproperty="test"/>
<echo message="looking for file named ${test}"/>
<available classname="${test}" property="test.exists">
<classpath>
<path refid="classpath.application"/>
</classpath>
</available>
<echo message="value=${test.exists}"/>
<pathconvert property="search.classpath" pathsep=":">
<path refid="classpath.application"/>
</pathconvert>
<fail unless="test.exists">
The test case '${test}.class' cannot be found in the classpath.
Check all files in the classpath and make sure the appropriate
class file exists. The classpath is=${search.classpath}
</fail>
<mkdir dir="${junit.results}"/>
<pathconvert property="junit.classpath" pathsep=":">
<path refid="classpath.application"/>
</pathconvert>
<echo message="About to run JUnit test(${test})..."/>
<echo message="current directory=${basedir}"/>
<echo message="classpath=${junit.classpath}"/>
<junit fork="yes" haltonfailure="yes" dir="${basedir}">
<classpath>
<path refid="classpath.application"/>
</classpath>
<jvmarg value="-Djar.name=${jardist}/${jar.name}"/>
<jvmarg value="-Dversion=${version}"/>
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<test name="${test}" todir="${junit.results}"/>
</junit>
</target>
<!--
***********************************************************************
TEST ALL TARGET
***********************************************************************
-->
<target name="testall" depends="osgi, instrumentation" description="Run ALL junit and abbot tests after compiling code">
<mkdir dir="${junit.results}"/>
<pathconvert property="junit.classpath" pathsep=":">
<path refid="classpath.application"/>
</pathconvert>
<echo message="About to run JUnit tests..."/>
<echo message="pattern1=${junit.pattern1}"/>
<echo message="pattern2=${junit.pattern2}"/>
<echo message="current directory=${basedir}"/>
<echo message="classpath=${junit.classpath}"/>
<!-- must be forked for instrumentation to work!!! -->
<junit fork="yes" haltonfailure="yes" failureproperty="is.test.fail" dir="${basedir}" printsummary="withOutAndErr">
<classpath>
<path refid="testall.classpath"/>
<path refid="emma.lib" />
</classpath>
<jvmarg value="-Demma.coverage.out.file=${codecov.temp}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
<jvmarg value="-Djar.name=${jardist}/${jar.name}"/>
<jvmarg value="-Dversion=${version}"/>
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="${junit.results}">
<fileset dir="${build}">
<patternset>
<include name="biz/xsoftware/manifest/Test*.class"/>
<include name="${junit.pattern1}"/>
<include name="${junit.pattern2}"/>
<exclude name="**/*$$*.class"/>
</patternset>
</fileset>
</batchtest>
</junit>
<!-- not used because this is good for automated build but bad for developer.
Developer doesn't want to look through 100 test cases to see which one
is failing. To use this gain haltonfailure above needs to be off-->
<!-- after all tests are run, this makes the build fail-->
<fail if="is.test.fail"/>
<!--autobuilds will not work without this while normal build will
because for some reason basedir was not being used property-->
<property name="report.tmp" location="${codecov.report}"/>
<echo message="report=${report.tmp}"/>
<emma enabled="${emma.enabled}" >
<report sourcepath="${javacode}:${versioning.src}" >
<fileset dir="${codecov.temp}" >
<include name="*.emma" />
</fileset>
<txt outfile="${report.tmp}/coverage.txt" />
<html outfile="${report.tmp}/index.html" />
</report>
</emma>
<!--delete dir="${codecov.temp}"/-->
</target>
<!--
***********************************************************************
FINDBUGS TARGET
***********************************************************************
-->
<target name="findbugs" depends="jar">
<mkdir dir="${findbugs.report}"/>
<findbugs home="${findbugs.dir}"
output="html"
outputFile="${findbugs.report}/index.html">
<class location="${jardist}/${jar.name}"/>
</findbugs>
</target>
<!--
***********************************************************************
CHECKSTYLE TARGET
***********************************************************************
-->
<target name="checkstyle" depends="create-src" description="Runs checkstyle against the code">
<mkdir dir="${checkstyle.report}"/>
<checkstyle config="${checkstyle.dir}/config.xml">
<classpath>
<path refid="lib.jars"/>
</classpath>
<fileset dir="${javacode}" includes="**/*.java"/>
<formatter type="plain" toFile="${checkstyle.report}/index.html"/>
</checkstyle>
</target>
<!--
***********************************************************************
ALL TARGET
***********************************************************************
-->
<target name="all" depends="testall,checkstyle,findbugs,javadoc">
</target>
<!--
***********************************************************************
RELEASE TARGET
***********************************************************************
-->
<target name="release" depends="testall" description="Builds official release">
<ant antfile="${config}/release.xml" inheritRefs="true"/>
</target>
<!--
***********************************************************************
JAVADOC TARGET
***********************************************************************
-->
<target name="javadoc" description="Generate JavaDoc">
<mkdir dir="${javadoc}"/>
<!-- copy all package.html files, img's etc for javadoc -->
<copy todir="${javadoc}">
<fileset dir="${javacode}" excludes="**/*.java"/>
</copy>
<echo message="package lists in=${package.list}"/>
<javadoc
sourcepath="${javacode}"
destdir="${javadoc}"
author="true"
version="true"
use="true"
public="yes"
overview="${javacode}/overview.html"
windowtitle="${javadoc.title} ${version}"
doctitle="${javadoc.title} ${version}"
Verbose="true">
<!-- classpath needed to link up to third_party libs without 100's of warnings -->
<classpath>
<path refid="tool.and.lib"/>
</classpath>
<fileset dir="${javacode}">
<include name="${javadoc.pattern}"/>
</fileset>
<doctitle><![CDATA[<h1>${javadoc.title} ${version}</h1>]]></doctitle>
<bottom><![CDATA[<i>${copyright}</i><br>
${javadoc.bottom}]]>
</bottom>
<link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api" packagelistLoc="${package.list}/jdk"/>
<link offline="true" href="http://www.junit.org/junit/javadoc/3.8.1" packagelistLoc="${package.list}/junit"/>
</javadoc>
</target>
<!--
***********************************************************************
JAVAH TARGET - Creates JNI C header files if needed
***********************************************************************
-->
<target name="javah" depends="compile" if="javah.classes" description="Creates C header files">
<javah class="${javah.classes}" destdir="${native}">
<classpath refid="build.classpath"/>
</javah>
</target>
<!--
***********************************************************************
Runs make on the C++/C code if a Makefile exists in the proper directory
***********************************************************************
-->
<target name="make" depends="javah" if="makeExists" description="runs make">
<echo message="make in ${native}"/>
<exec executable="make" dir="${native}"/>
</target>
<!--
***********************************************************************
GENERATE CASTOR OBJECTS TARGET
***********************************************************************
-->
<!--target name="castor" depends="create-src" description="Generates class files from xsd">
<echo message="build=${build}"/>
<echo message="generating source from ${schemas}/${xsd.start}"/>
<echo message="putting generated source in ${basedir}/${src.gen}"/>
<castor bindingfile="${basedir}/bldfiles/binding.file" dest="${basedir}/${src.gen}">
<i dir="${basedir}/${schemas}">
<include name="${xsd.start}"/>
</i>
</castor>
</target-->
<!--
***********************************************************************
AUTOBUILD TARGET
***********************************************************************
-->
<target name="autobuild" depends="clean, all">
<cvs command="tag -R ${version}" failonerror="true"/>
<!-- need to deliver new delivery to other modules -->
</target>
<!--
***********************************************************************
CLEAN TARGET
***********************************************************************
-->
<target name="clean" depends="create-src" description="Clean all generated files">
<!-- Delete everything in the ${generated} directory tree -->
<delete dir="${generated}"/>
</target>
</project>
--- NEW FILE: directory.properties ---
#----------------------------------------------------------------------
#DO NOT MAKE CHANGES TO THIS FILE, this file is overwriten
#every time build is run. To personalize make changes to
#ant.properties, dependencies.xml, and
#release.xml. All which are in the [basedir]/bldfiles directory
#----------------------------------------------------------------------
#-----------------------------------------------------------------------
# OUTPUT DIRECTORIES
#-----------------------------------------------------------------------
generated =output
manifest =${generated}/manifest
#will contain a generated manifest
build =${generated}/classes
#will contain all the *.class files after compile
#will contain all the *.jpg files from ${properties}
#will contain all the *.properties files from ${properties}
#will contain all the *.gif files from ${properties}
#will contain all the *.html files from ${properties}
#will contain all the *.* files from ${properties}
#will NOT contain *.html, *.htm, *.jpg, *.gif from ${javacode}
jardist =${generated}/jardist
#will contain a *.jar containing everything in ${build}
dist =${generated}/dist
#contains the release that gets released to the world
reports =${generated}/reports
codecov.report =${reports}/codecoverage
#contains the code coverage reports of what the unit tests
#covered
findbugs.report =${reports}/findbugs
checkstyle.report=${reports}/checkstyle
javadoc =${reports}/javadoc
#contains the javadoc of biz.xsoftware.api
allcodecov =${generated}/codecoverage
codecov.temp =${allcodecov}/misc
codecov.classes =${allcodecov}/instrumented-classes
#intermediate directory that contains instrumented classes to
#run testall against so a code coverage report can be spit out.
codecov.jar =${allcodecov}/instrumented-jar
junit.results =${generated}/test_results
#contains junit test results
staging =${generated}/staging
projstaging =${generated}/staging/${name}
#will contain all *.html generated by javadoc
#will contain all *.html from ${javacode} directory(such as package.html)
#will contain all *.jpg from ${javacode} directory
#will contain all *.gif from ${javacode} directory
rmi.stubs =${generated}/rmistubs
#contains all Remote*.class files copied from ${build}
#contains all *_stub.class files copied from ${build}
#contains all *_skel.class files copied from ${build}
#this directory is only created if RMI*.class exists
test.area =${generated}/tests
#This is sometimes created by JUnit tests to do temporary
#testing. It usually gets deleted afterwards.
src.gen =${generated}/src
#generated source code
#-----------------------------------------------------------------------
# INPUT DIRECTORIES - don't change these after the project is started.
#-----------------------------------------------------------------------
input =input
#contains all stuff that is an input into the build
config =bldfiles
#contains build.xml for the module, and any other build scripts
#plus build property files
javacode =${input}/javasrc
#Contains all *.java source files
#Contains all *.html files needed by javadoc
#Contains all *.jpg files needed by javadoc
#Contains all *.gif files needed by javadoc
#Contains all *.* files needed by javadoc
#Will NOT contain any *.jpg, *.gif, *.html, *.htm needed by application
#Use ${properties} for *.jpg, *.gif, *.html, *.htm needed by application
properties =${input}/properties
#contains *.property files for i18n
#contains *.gif needed for application
#contains *.* any other resource files needed for application
lib =${input}/libinclude
#contains all *.jar needed to run the app and that need to be deployed with the app
#does not contain *.jars needed to compile the app(such as junit.jar)
libexclude =${input}/libexclude
#contains all the *.jar that are not needed to run the app. They are for testing or
#would already be deployed as services in the framework as in the case of an osgi logging
#service for example
staging.in =${input}/staging
#build copies everything from here to ${staging} so staging area can just be
#zipped up or rpm'd up or whatever during the dist target.
#typically, there will be another directory in here called <project>
#or something. Some projects won't but most will.
scripts =${input}/tests/scripts
#DO NOT MODIFY. This is hardcoded in TestSuiteAllScripts.java.
#contains all *.xml abbot scripts to do GUI testing.
test.input =${input}/tests/input
#for miscellaneous input to junit tests.
native =${input}/native
#contains JNI C header file
schemas =${javacode}/schemas
#contains xsd schemas
#-----------------------------------------------------------------------
# MISCELLANEOUS
#-----------------------------------------------------------------------
junit.pattern1=biz/xsoftware/test/**/Test*.class
junit.pattern2=**/test/Test*.class
javadoc.pattern=**/*.java
tool.dir=tools
package.list=${tool.dir}/package-list
build.sysclasspath=ignore
# Change this value and I call you a complete idiot(cp = classpath)
# ignore - trust build file to get the cp right
# first - concatenate build file cp AFTER build runners cp
# last - concatenate build runners cp AFTER build file cp
#output = build.log
#uncomment this to activate the logging
|