org.gradle.api.plugins.osgi
Interface OsgiManifest


public interface OsgiManifest


Method Summary
 java.util.jar.Manifest generateManifest()
           
 java.io.File getClassesDir()
          Returns the classes dir.
 java.util.List<java.io.File> getClasspath()
          Returns the classpath.
 java.util.List<java.lang.String> getClasspathTypes()
          Returns the classpath types.
 java.lang.String getDescription()
          Returns the description.
 java.lang.String getDocURL()
          Returns the docURL value.
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getInstructions()
          Returns all exisiting instruction.
 java.lang.String getLicense()
          Returns the license
 java.lang.String getName()
          Returns the name
 java.lang.String getSymbolicName()
          Returns the symbolic name.
 java.lang.String getVendor()
          Returns the vendor.
 java.lang.String getVersion()
          Returns the version
 OsgiManifest instruction(java.lang.String name, java.lang.String... values)
          Adds arguments to an instruction.
 OsgiManifest instructionFirst(java.lang.String name, java.lang.String... values)
          Adds arguments to an instruction.
 java.util.List<java.lang.String> instructionValue(java.lang.String instructionName)
          Returns the list of arguments for a particular instruction.
 OsgiManifest overwrite(org.gradle.api.tasks.bundling.GradleManifest manifest)
          Generated and writes the OSGi manifest information into a GradleManifest.
 void setClassesDir(java.io.File classesDir)
          Sets the classes dir.
 void setClasspath(java.util.List<java.io.File> classpath)
          A convenient method for setting a Bundle-Classpath instruction.
 void setClasspathTypes(java.util.List<java.lang.String> types)
          Set the dependency types to be taken into account when generating the osgi manifest.
 void setDescription(java.lang.String description)
          A convenient method for setting a Bundle-Description instruction.
 void setDocURL(java.lang.String docURL)
          A convenient method for setting a Bundle-DocURL instruction.
 void setLicense(java.lang.String license)
          A convenient method for setting a Bundle-License instruction.
 void setName(java.lang.String name)
          A convenient method for setting a Bundle-Name instruction.
 void setSymbolicName(java.lang.String symbolicName)
          A convenient method for setting a Bundle-SymbolicName instruction.
 void setVendor(java.lang.String vendor)
          A convenient method for setting a Bundle-Vendor instruction.
 void setVersion(java.lang.String version)
          A convenient method for setting a Bundle-Version instruction.
 

Method Detail

generateManifest

java.util.jar.Manifest generateManifest()

instructionValue

java.util.List<java.lang.String> instructionValue(java.lang.String instructionName)
Returns the list of arguments for a particular instruction.

Parameters:
instructionName -
Returns:
The list of arguments
See Also:
instruction(String, String[])

instruction

OsgiManifest instruction(java.lang.String name,
                         java.lang.String... values)
Adds arguments to an instruction. If the instruction does not exists, it is created. If it does exists, the arguments are appended to the existing arguments.

Parameters:
name -
values -
Returns:
this
See Also:
instructionFirst(String, String[])

instructionFirst

OsgiManifest instructionFirst(java.lang.String name,
                              java.lang.String... values)
Adds arguments to an instruction. If the instruction does not exists, it is created. If it does exists, the arguments are inserted before the existing arguments.

Parameters:
name -
values -
Returns:
this
See Also:
instructionFirst(String, String[])

getInstructions

java.util.Map<java.lang.String,java.util.List<java.lang.String>> getInstructions()
Returns all exisiting instruction.

Returns:
A map with instructions. The key of the map is the instruction name, the value a list of arguments.

getSymbolicName

java.lang.String getSymbolicName()
Returns the symbolic name.

See Also:
setSymbolicName(String)

setSymbolicName

void setSymbolicName(java.lang.String symbolicName)
A convenient method for setting a Bundle-SymbolicName instruction.

Parameters:
symbolicName - the symbolicName to set

getName

java.lang.String getName()
Returns the name

See Also:
setName(String)

setName

void setName(java.lang.String name)
A convenient method for setting a Bundle-Name instruction.

Parameters:
name - the name to set

getVersion

java.lang.String getVersion()
Returns the version

See Also:
setVersion(String)

setVersion

void setVersion(java.lang.String version)
A convenient method for setting a Bundle-Version instruction.

Parameters:
version - the version to set

getDescription

java.lang.String getDescription()
Returns the description.

See Also:
setDescription(String)

setDescription

void setDescription(java.lang.String description)
A convenient method for setting a Bundle-Description instruction.

Parameters:
description - the description to set

getLicense

java.lang.String getLicense()
Returns the license

See Also:
setLicense(String)

setLicense

void setLicense(java.lang.String license)
A convenient method for setting a Bundle-License instruction.

Parameters:
license - The license to set

getVendor

java.lang.String getVendor()
Returns the vendor.

See Also:
setVendor(String)

setVendor

void setVendor(java.lang.String vendor)
A convenient method for setting a Bundle-Vendor instruction.

Parameters:
vendor - The vendor to set

getDocURL

java.lang.String getDocURL()
Returns the docURL value.

See Also:
setDocURL(String)

setDocURL

void setDocURL(java.lang.String docURL)
A convenient method for setting a Bundle-DocURL instruction.

Parameters:
docURL - the docURL to set.

getClassesDir

java.io.File getClassesDir()
Returns the classes dir.

See Also:
setClassesDir(java.io.File)

setClassesDir

void setClassesDir(java.io.File classesDir)
Sets the classes dir. This directory is the major source of input for generation the OSGi manifest. All classes are analyzed for its packages and package dependencies. Based on this the Import-Package value is set. This auto generated value can be overwritten by explicitly setting an instruction.

Parameters:
classesDir -
See Also:
instruction(String, String[])

overwrite

OsgiManifest overwrite(org.gradle.api.tasks.bundling.GradleManifest manifest)
Generated and writes the OSGi manifest information into a GradleManifest. Existing information in the GradleManifest is removed.

Parameters:
manifest - The GradleManifest to write into.
Returns:
this

getClasspath

java.util.List<java.io.File> getClasspath()
Returns the classpath.

See Also:
setClasspath(java.util.List)

setClasspath

void setClasspath(java.util.List<java.io.File> classpath)
A convenient method for setting a Bundle-Classpath instruction. The information of the classpath elements are only used if they are OSGi bundles. In this case for example the version information provided by the bundle is used in the Import-Package of the generated OSGi bundle.

Parameters:
classpath - The classpath elements

getClasspathTypes

java.util.List<java.lang.String> getClasspathTypes()
Returns the classpath types.

See Also:
setClasspathTypes(java.util.List)

setClasspathTypes

void setClasspathTypes(java.util.List<java.lang.String> types)
Set the dependency types to be taken into account when generating the osgi manifest. Sometimes people add for some reasons archive types like tar.gz to the compile or runtime configuration. OSGi can't cope with such dependencies and throws and exception. By default classpathTypes include 'zip' and 'jar'.