api / org.gradle.api.plugins.osgi / OsgiManifest

OsgiManifest

interface OsgiManifest : Manifest

Represents a manifest file for a JAR containing an OSGi bundle.

Functions

getClassesDir

abstract fun getClassesDir(): File

Returns the classes dir.

getClasspath

abstract fun getClasspath(): FileCollection

Returns the classpath.

getDescription

abstract fun getDescription(): String

Returns the description.

getDocURL

abstract fun getDocURL(): String

Returns the docURL value.

getInstructions

abstract fun getInstructions(): MutableMap<String, MutableList<String>>

Returns all existing instruction.

getLicense

abstract fun getLicense(): String

Returns the license.

getName

abstract fun getName(): String

Returns the name.

getSymbolicName

abstract fun getSymbolicName(): String

Returns the symbolic name.

getVendor

abstract fun getVendor(): String

Returns the vendor.

getVersion

abstract fun getVersion(): String

Returns the version.

instruction

abstract fun instruction(name: String, vararg values: String): OsgiManifest

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.

instructionFirst

abstract fun instructionFirst(name: String, vararg values: String): OsgiManifest

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.

instructionReplace

abstract fun instructionReplace(name: String, vararg values: String): OsgiManifest

Sets the values for an instruction. If the instruction does not exists, it is created. If it does exists, the values replace the existing values.

instructionValue

abstract fun instructionValue(instructionName: String): MutableList<String>

Returns the list of arguments for a particular instruction.

setClassesDir

abstract fun setClassesDir(classesDir: File): Unit

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.

setClasspath

abstract fun setClasspath(classpath: FileCollection): Unit

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.

setDescription

abstract fun setDescription(description: String): Unit

A convenient method for setting a Bundle-Description instruction.

setDocURL

abstract fun setDocURL(docURL: String): Unit

A convenient method for setting a Bundle-DocURL instruction.

setLicense

abstract fun setLicense(license: String): Unit

A convenient method for setting a Bundle-License instruction.

setName

abstract fun setName(name: String): Unit

A convenient method for setting a Bundle-Name instruction.

setSymbolicName

abstract fun setSymbolicName(symbolicName: String): Unit

A convenient method for setting a Bundle-SymbolicName instruction.

setVendor

abstract fun setVendor(vendor: String): Unit

A convenient method for setting a Bundle-Vendor instruction.

setVersion

abstract fun setVersion(version: String): Unit

A convenient method for setting a Bundle-Version instruction.

Inherited Functions

attributes

abstract fun attributes(attributes: MutableMap<String, *>): Manifest

Adds content to the main attributes of the manifest.

abstract fun attributes(attributes: MutableMap<String, *>, sectionName: String): Manifest

Adds content to the given section of the manifest.

from

abstract fun from(vararg mergePath: Any): Manifest

Specifies other manifests to be merged into this manifest. A merge path can either be another instance of org.gradle.api.java.archives.Manifest or a file path as interpreted by org.gradle.api.Project#files(Object...). The merge is not happening instantaneously. It happens either before writing or when #getEffectiveManifest() is called.

abstract fun from(mergePath: Any, closure: Closure<*>): Manifest

Specifies other manifests to be merged into this manifest. A merge path is interpreted as described in #from(Object...). The merge is not happening instantaneously. It happens either before writing or when #getEffectiveManifest() is called. The closure configures the underlying org.gradle.api.java.archives.ManifestMergeSpec.

getAttributes

abstract fun getAttributes(): Attributes

Returns the main attributes of the manifest.

getEffectiveManifest

abstract fun getEffectiveManifest(): Manifest

Returns a new manifest instance where all the attribute values are expanded (e.g. their toString method is called). The returned manifest also contains all the attributes of the to be merged manifests specified in #from(Object...).

getSections

abstract fun getSections(): MutableMap<String, Attributes>

Returns the sections of the manifest (excluding the main section).

writeTo

abstract fun writeTo(path: Any): Manifest

Writes the manifest into a file. The path's are resolved as defined by org.gradle.api.Project#files(Object...) The manifest will be encoded using the character set defined by the org.gradle.jvm.tasks.Jar#getManifestContentCharset() property.