ch.jm.osgi.util.bundle 1.0.0

ch.jm.osgi.util.bundle.ant
Class ConvertJarToBundleTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by ch.jm.osgi.util.bundle.ant.AbstractBundleTask
              extended by ch.jm.osgi.util.bundle.ant.ConvertJarToBundleTask
All Implemented Interfaces:
BundleConstants, java.lang.Cloneable

public class ConvertJarToBundleTask
extends AbstractBundleTask
implements BundleConstants

Ant task to convert JAR files to OSGi bundles. It can also convert WAR files which take some special processing (embedded JAR files and classes).


Field Summary
 
Fields inherited from class ch.jm.osgi.util.bundle.ant.AbstractBundleTask
attributes, descriptor
 
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
 
Fields inherited from interface ch.jm.osgi.util.bundle.BundleConstants
BUNDLE_ACTIVATOR, BUNDLE_CATEGORY, BUNDLE_CLASSPATH, BUNDLE_DESCRIPTION, BUNDLE_MANIFEST_VERSION, BUNDLE_NAME, BUNDLE_SYMBOLIC_NAME, BUNDLE_VERSION, EXPORT_PACKAGE, IMPORT_PACKAGE
 
Constructor Summary
ConvertJarToBundleTask()
           
 
Method Summary
 void addConfiguredAttribute(org.apache.tools.ant.taskdefs.Manifest.Attribute attribute)
          Add an attribute to the manifest.
 void execute()
           
 void setBackupFile(boolean value)
          Controls whether a ".bak" file is created if the source and the target JAR are the same, i.e.
 void setFile(java.io.File f)
          Sets the JAR file to convert.
 void setTargetFile(java.io.File f)
          Sets the target JAR file representing the generated bundle.
 
Methods inherited from class ch.jm.osgi.util.bundle.ant.AbstractBundleTask
addExportUses, logAnalyzerResults, setDescriptor
 
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

ConvertJarToBundleTask

public ConvertJarToBundleTask()
Method Detail

addConfiguredAttribute

public void addConfiguredAttribute(org.apache.tools.ant.taskdefs.Manifest.Attribute attribute)
                            throws org.apache.tools.ant.taskdefs.ManifestException
Description copied from class: AbstractBundleTask
Add an attribute to the manifest.

Overrides:
addConfiguredAttribute in class AbstractBundleTask
Parameters:
attribute - the attribute to be added.
Throws:
org.apache.tools.ant.taskdefs.ManifestException - if the attribute is not valid.

setFile

public void setFile(java.io.File f)
Sets the JAR file to convert.

Parameters:
f - the JAR file

setTargetFile

public void setTargetFile(java.io.File f)
Sets the target JAR file representing the generated bundle.

Parameters:
f - the target JAR file

setBackupFile

public void setBackupFile(boolean value)
Controls whether a ".bak" file is created if the source and the target JAR are the same, i.e. when there's an in-place conversion.

Parameters:
value - true to create a backup of the original JAR, false to overwrite

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

ch.jm.osgi.util.bundle 1.0.0

Copyright 2009-2010 Jeremias M?rki. All Rights Reserved.