api / org.gradle.api.java.archives / Manifest

Manifest

interface Manifest

Represents the manifest file of a JAR file.

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.

Inheritors

OsgiManifest

interface OsgiManifest : Manifest

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