Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,28 @@
package com.intellij.java.compiler.artifact.impl;

import consulo.application.Application;
import org.jetbrains.annotations.NonNls;

import java.util.jar.Attributes;

public class ManifestBuilder {
@NonNls
private static final String NAME = "Created-By";
private static final Attributes.Name CREATED_BY = new Attributes.Name(NAME);
private static final String NAME = "Created-By";
private static final Attributes.Name CREATED_BY = new Attributes.Name(NAME);

private ManifestBuilder() {
}
private ManifestBuilder() {
}

public static void setGlobalAttributes(Attributes mainAttributes) {
setVersionAttribute(mainAttributes);
setIfNone(mainAttributes, CREATED_BY, Application.get().getName().get());
}
public static void setGlobalAttributes(Attributes mainAttributes) {
setVersionAttribute(mainAttributes);
setIfNone(mainAttributes, CREATED_BY, Application.get().getName().get());
}

public static void setVersionAttribute(Attributes mainAttributes) {
setIfNone(mainAttributes, Attributes.Name.MANIFEST_VERSION, "1.0");
}
public static void setVersionAttribute(Attributes mainAttributes) {
setIfNone(mainAttributes, Attributes.Name.MANIFEST_VERSION, "1.0");
}

private static void setIfNone(Attributes mainAttributes, Attributes.Name attrName, String value) {
if (mainAttributes.getValue(attrName) == null) {
mainAttributes.put(attrName, value);
private static void setIfNone(Attributes mainAttributes, Attributes.Name attrName, String value) {
if (mainAttributes.getValue(attrName) == null) {
mainAttributes.put(attrName, value);
}
}
}
}
Loading
Loading