@Deprecated @Override public Manifest writeTo(Writer writer) { return delegate.writeTo(writer); }
public DefaultManifest merge(Manifest baseManifest, PathToFileResolver fileResolver) { String baseContentCharset = baseManifest instanceof ManifestInternal ? ((ManifestInternal) baseManifest).getContentCharset() : DefaultManifest.DEFAULT_CONTENT_CHARSET; DefaultManifest mergedManifest = new DefaultManifest(fileResolver, baseContentCharset); mergedManifest.getAttributes().putAll(baseManifest.getAttributes()); mergedManifest.getSections().putAll(baseManifest.getSections()); for (Object mergePath : mergePaths) { DefaultManifest manifestToMerge = createManifest(mergePath, fileResolver, contentCharset); mergedManifest = mergeManifest(mergedManifest, manifestToMerge, fileResolver); } return mergedManifest; }
public DefaultManifest merge(Manifest baseManifest, FileResolver fileResolver) { DefaultManifest mergedManifest = new DefaultManifest(fileResolver); mergedManifest.getAttributes().putAll(baseManifest.getAttributes()); mergedManifest.getSections().putAll(baseManifest.getSections()); for (Object mergePath : mergePaths) { DefaultManifest manifestToMerge = createManifest(mergePath, fileResolver); mergedManifest = mergeManifest(mergedManifest, manifestToMerge, fileResolver); } return mergedManifest; }
/** * Configures new MANIFEST.MF with some defaults. Can be overridden in build.gradle */ private void configureManifest(final Project project, final NWEarPluginConvention earPluginConvention, final NWEar earTask) { JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class); Manifest manifest = javaConvention.manifest(); //generates new DefaultManifest Attributes attributes = manifest.getAttributes(); String nowString = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date()); attributes.put("Implementation-Version", nowString); attributes.put("Implementation-Title", project.getName()); attributes.put("Implementation-Vendor-Id", project.getGroup().toString()); attributes.put("Specification-Vendor", "SAP AG"); earTask.setManifest(manifest); }
public CustomManifestInternalWrapper(Manifest delegate) { this.delegate = delegate; }
@Override public Manifest writeTo(OutputStream outputStream) { DefaultManifest.writeTo(this, outputStream, contentCharset); return this; }
@Override public Manifest getEffectiveManifest() { return delegate.getEffectiveManifest(); }
@Override public Manifest writeTo(Object path) { return delegate.writeTo(path); }
@Override public Manifest from(Object... mergePath) { return delegate.from(mergePath); }
@Override public Manifest from(Object mergePath, Closure<?> closure) { return delegate.from(mergePath, closure); }
/** * Creates a new instance of a {@link Manifest}. */ public Manifest manifest() { return manifest(null); }
/** * Returns the manifest for this JAR archive. * * @return The manifest */ @Internal public Manifest getManifest() { return manifest; }
/** * Sets the manifest for this JAR archive. * * @param manifest The manifest. May be null. */ public void setManifest(Manifest manifest) { this.manifest = manifest; }
/** * Writes the manifest into a stream. * * The manifest will be encoded using the character set defined by the {@link #getContentCharset()} property. * * @param outputStream The stream to write the manifest to * @return this */ Manifest writeTo(OutputStream outputStream);
/** * Creates and configures a new instance of a {@link Manifest}. The given closure configures * the new manifest instance before it is returned. * * @param closure The closure to use to configure the manifest. */ public Manifest manifest(Closure closure) { return ConfigureUtil.configure(closure, new DefaultManifest(project.getFileResolver())); }
/** * Returns the manifest for this JAR archive. * * @return The manifest */ public Manifest getManifest() { return manifest; }