use of org.gradle.api.plugins.osgi.OsgiManifest in project gradle by gradle.
the class DefaultOsgiManifest method getEffectiveManifest.
@Override
public DefaultManifest getEffectiveManifest() {
ContainedVersionAnalyzer analyzer = analyzerFactory.create();
DefaultManifest effectiveManifest = new DefaultManifest(null);
try {
setAnalyzerProperties(analyzer);
Manifest osgiManifest = analyzer.calcManifest();
java.util.jar.Attributes attributes = osgiManifest.getMainAttributes();
for (Map.Entry<Object, Object> entry : attributes.entrySet()) {
effectiveManifest.attributes(WrapUtil.toMap(entry.getKey().toString(), (String) entry.getValue()));
}
effectiveManifest.attributes(this.getAttributes());
for (Map.Entry<String, Attributes> ent : getSections().entrySet()) {
effectiveManifest.attributes(ent.getValue(), ent.getKey());
}
if (classesDir != null) {
long mod = classesDir.lastModified();
if (mod > 0) {
effectiveManifest.getAttributes().put(Analyzer.BND_LASTMODIFIED, mod);
}
}
} catch (Exception e) {
throw UncheckedException.throwAsUncheckedException(e);
}
return getEffectiveManifestInternal(effectiveManifest);
}
Aggregations