Knopflerfish OSGi 2.1.1

org.knopflerfish.ant.taskdefs.bundle
Class BundleLocator

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.knopflerfish.ant.taskdefs.bundle.BundleLocator
All Implemented Interfaces:
java.lang.Cloneable

public class BundleLocator
extends org.apache.tools.ant.Task

A task that given a partial bundle name and a fileset with bundles, will select the bundle with the highest version number and a name that matches. Bundles names are supposed to be on the form name-Major.Minor.Micro.sub.jar, i.e., a name followed by '-' then a valid OSGi version number. This task can also iterate over a path and replace all non-exisiting file resources in it that has a name ending with -N.N.N.jar with the corresponding bundle with the highest version from the given file set.

Parameters

Attribute Description Required
bundleName The name of the bundle to look for. I.e., the full name up to the last '-'-character (excluded). Either bundleName or classPathRef must be given.
property The name of a project property to be assigned the location of the matching bundle. Yes when bundleName is specified.
No default value.
classPathRef The reference name (id) of a path-structure to transform. Either bundleName or classPathRef must be given.
newClassPathId The transformed path-structure will be added to the current project using this name (id). Yes when classPathRef is specified.
No default value.
failOnMissingBundles If a file with name bundleName-N.N.N.jar is found on the classpath to transform and there is no matching bundle in the file set then fail the build if set to true. Same applies if the given bundleName can not be transformed. No.
Defaults to true.
replacefilterfile Creates a property file suitable for use as the replacefilterfile argument in the replace-task. Keys in the property file will be the bundle name on the form @bundleName-N.N.N.jar@, values is the expanded file path relative to the root-directory of the file set that the expansion orginates from. The "@" surrounding the key are needede to avoid problem if the name of one bundle is contained within the name of another bundle. E.g., kxml-N.N.N.jar and xml-N.N.N.jar. No.
No default value.

Parameters specified as nested elements

fileset

(required)

The jar files to match against must be specified as a fileset.


Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
BundleLocator()
           
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet set)
           
 void execute()
           
 void setBundleName(java.lang.String s)
           
 void setClassPathRef(org.apache.tools.ant.types.Reference r)
           
 void setFailOnMissingBundles(boolean b)
           
 void setNewClassPathId(java.lang.String s)
           
 void setProperty(java.lang.String s)
           
 void setReplacefilterfile(java.io.File f)
           
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleLocator

public BundleLocator()
Method Detail

setProperty

public void setProperty(java.lang.String s)

setBundleName

public void setBundleName(java.lang.String s)

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet set)

setClassPathRef

public void setClassPathRef(org.apache.tools.ant.types.Reference r)

setNewClassPathId

public void setNewClassPathId(java.lang.String s)

setFailOnMissingBundles

public void setFailOnMissingBundles(boolean b)

setReplacefilterfile

public void setReplacefilterfile(java.io.File f)

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

Knopflerfish OSGi 2.1.1