public interface Manifest
Modifier and Type | Method and Description |
---|---|
Manifest |
attributes(Map<String,?> attributes)
Adds content to the main attributes of the manifest.
|
Manifest |
attributes(Map<String,?> attributes,
String sectionName)
Adds content to the given section of the manifest.
|
Manifest |
from(Object... mergePath)
Specifies other manifests to be merged into this manifest.
|
Manifest |
from(Object mergePath,
Closure closure)
Specifies other manifests to be merged into this manifest.
|
Attributes |
getAttributes()
Returns the main attributes of the manifest.
|
Manifest |
getEffectiveManifest()
Returns a new manifest instance where all the attribute values are expanded (e.g.
|
Map<String,Attributes> |
getSections()
Returns the sections of the manifest (excluding the main section).
|
Manifest |
writeTo(Object path)
Writes the manifest into a file.
|
Manifest |
writeTo(Writer writer)
Writes the manifest into a writer.
|
Attributes getAttributes()
Map<String,Attributes> getSections()
Manifest attributes(Map<String,?> attributes) throws ManifestException
attributes
- The values to add to the main attributes. The values can be any object. For evaluating the value objects
their Object.toString()
method is used. This is done lazily either before writing or when getEffectiveManifest()
is called.ManifestException
- If a key is invalid according to the manifest spec or if a key or value is null.Manifest attributes(Map<String,?> attributes, String sectionName) throws ManifestException
attributes
- The values to add to the section. The values can be any object. For evaluating the value objects
their Object.toString()
method is used. This is done lazily either before writing or when getEffectiveManifest()
is called.sectionName
- The name of the sectionManifestException
- If a key is invalid according to the manifest spec or if a key or value is null.Manifest getEffectiveManifest()
from(Object...)
.Manifest writeTo(Writer writer)
writer
- The writer to write the manifest toManifest writeTo(Object path)
Project.files(Object...)
path
- The path of the file to write the manifest into.Manifest from(Object... mergePath)
Manifest
or a file path as interpreted by Project.files(Object...)
.
The merge is not happening instantaneously. It happens either before writing or when getEffectiveManifest()
is called.mergePath
- Manifest from(Object mergePath, Closure closure)
from(Object...)
.
The merge is not happening instantaneously. It happens either before writing or when getEffectiveManifest()
is called.
The closure configures the underlying ManifestMergeSpec
.mergePath
- closure
-