Update of /cvsroot/mocklib/mocklibExamples/bldfiles
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19532/bldfiles
Added Files:
design.xml directory.properties build.xml ant.properties
Log Message:
mockLibExamples first commit....this is used in article and presentations.
--- 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="junit" package="junit" subpackages="include"/>
<package name="javaxswing" package="javax.swing.event" needdeclarations="false"/>
<!-- The mocklib api which depends on nothing -->
<package name="api" package="biz.xsoftware.mock"/>
<!-- notice examples don't depend on the mocklib implementation -->
<package name="examples" package="biz.xsoftware.examples" subpackages="include">
<depends>api</depends>
<depends>junit</depends>
</package>
</design>
--- NEW FILE: ant.properties ---
#-----------------------------------------------------------------------
# MANIFEST and JAR properties - Make sure you change these to your settings.
#-----------------------------------------------------------------------
name = mocklib3
#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 =[bundle.emptystring]
exports =[bundle.emptystring]
impl.pattern =biz/**,com/**,net/**
#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 = MockLib
manifest.vendor = http://mocklib.sourceforge.net
manifest.builder = Dean Hiller
manifest.description = A Library that creates mockobjects with one line of code that simulate any interface
manifest.icon =
copyright = Copyright © 2000 Dean Hiller All Rights Reserved.
javadoc.title = Build Template
javadoc.bottom = A Library that creates mockobjects that simulate any interface<br> \
<a href=http://sourceforge.net> \
<IMG src=http://sourceforge.net/sflogo.php?group_id=113040 width=210 height=62 border=0 alt=SourceForge Logo> \
</a>
#-----------------------------------------------------------------------
# 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: build.xml ---
<?xml version="1.0"?>
<!--
Run "ant -projecthelp" to view all the possible targets and descriptions.
-->
<project name="std_buildfile" default="testall" 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"/>
<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>
<!--
***********************************************************************
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="*****************************************************************"/>
<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="antcontrib.lib"/>
<taskdef resource="emma_ant.properties" classpathref="emma.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="${libexclude}"/>
<mkdir dir="${staging.in}"/>
<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>
<!--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>
<!--
***********************************************************************
JAR TARGET
***********************************************************************
-->
<target name="jar" depends="compile" description="Create distribution">
<!-- Create the distribution directory -->
<mkdir dir="${jardist}"/>
<!-- Also, copy over all needed jars from ${lib} to ${jardist} -->
<copy todir="${jardist}">
<fileset dir="${lib}" includes="**"/>
</copy>
<!-- Put all implementation classes from ${build} into the jar file -->
<jar jarfile="${jardist}/${jar.name}" basedir="${build}"/>
<verifydesign jar="${jardist}/${jar.name}" design="bldfiles/design.xml"/>
</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">
<fileset dir="${codecov.classes}" includes="**"/>
<fileset dir="${build}" includes="**"/>
</jar>
</target>
<!--
***********************************************************************
TEST ALL TARGET
***********************************************************************
-->
<target name="testall" depends="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>
<!--
***********************************************************************
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
html.code =${reports}/htmlcode
#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}/lib
#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=**/Test*.class
junit.pattern2=biz/xsoftware/examples/**/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
|