29package com.jogamp.common.util;
31import java.util.Iterator;
33import java.util.jar.Attributes;
34import java.util.jar.Manifest;
36import jogamp.common.os.AndroidUtils;
38import com.jogamp.common.os.Platform;
60 private static final String packageNameFAT =
"com.jogamp";
62 private final String packageName;
63 private final Manifest mf;
64 private final int hash;
65 private final Attributes mainAttributes;
66 private final Set<?> mainAttributeNames;
68 private final String androidPackageVersionName;
74 this.packageName = packageName;
81 this.packageName = packageNameFAT;
84 this.mf =
new Manifest();
85 this.packageName = packageName;
88 this.hash = this.mf.hashCode();
89 mainAttributes = this.mf.getMainAttributes();
90 mainAttributeNames = mainAttributes.keySet();
91 androidPackageVersionName = AndroidUtils.getPackageInfoVersionName(this.packageName);
100 public final boolean equals(
final Object o) {
115 public final String
getAttribute(
final Attributes.Name attributeName) {
116 return (
null != attributeName) ? (String) mainAttributes.get(attributeName) :
null;
124 for (
final Iterator<?> iter = mainAttributeNames.iterator(); iter.hasNext();) {
125 final Attributes.Name an = (Attributes.Name) iter.next();
126 if (an.toString().equals(attributeName)) {
137 return mainAttributeNames;
141 if(
null != androidPackageVersionName) {
144 return this.
getAttribute(Attributes.Name.EXTENSION_NAME);
204 return this.
getAttribute(Attributes.Name.IMPLEMENTATION_TITLE);
208 return this.
getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR);
212 return this.
getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR_ID);
216 return this.
getAttribute(Attributes.Name.IMPLEMENTATION_URL);
227 return this.
getAttribute(Attributes.Name.IMPLEMENTATION_VERSION);
231 return androidPackageVersionName;
235 return this.
getAttribute(Attributes.Name.SPECIFICATION_TITLE);
239 return this.
getAttribute(Attributes.Name.SPECIFICATION_VENDOR);
243 return this.
getAttribute(Attributes.Name.SPECIFICATION_VERSION);
252 sb =
new StringBuilder();
281 sb =
new StringBuilder();
final String getImplementationSHANatives()
Returns the SHA of all concatenated native library files of all build libs.
final StringBuilder getFullManifestInfo(final StringBuilder sb)
final String getImplementationVendorID()
final boolean equals(final Object o)
final String getImplementationBuild()
Returns the implementation build number, e.g.
final String getImplementationSHAClasses()
Returns the SHA of all concatenated class files of all build classes.
final String getAttribute(final String attributeName)
JogampVersion(final String packageName, final Manifest mf)
static final Attributes.Name IMPLEMENTATION_BUILD
See getImplementationBuild().
final String getAndroidPackageVersionName()
final Manifest getManifest()
final String getImplementationVersion()
Returns the IMPLEMENTATION_VERSION.
final String getImplementationURL()
static final Attributes.Name IMPLEMENTATION_BRANCH
See getImplementationBranch().
final String getImplementationVendor()
final Set<?> getAttributeNames()
final String getAttribute(final Attributes.Name attributeName)
final String getSpecificationVendor()
final String getImplementationSHASources()
Returns the SHA of all concatenated source files of the whole project.
StringBuilder getManifestInfo(StringBuilder sb)
static final Attributes.Name IMPLEMENTATION_SHA_SOURCES
See getImplementationSHASources().
final String getExtensionName()
static final Attributes.Name IMPLEMENTATION_SHA_CLASSES
See getImplementationSHAClasses().
final String getImplementationCommit()
Returns the SCM version of the last commit, e.g.
final String getImplementationSHANativesThis()
Returns the SHA of all concatenated native library files of the local (jar) package subset.
final String getImplementationSHAClassesThis()
Returns the SHA of all concatenated class files of the local (jar) package subset.
StringBuilder toString(StringBuilder sb)
final String getPackageName()
static final Attributes.Name IMPLEMENTATION_SHA_NATIVES
See getImplementationSHANatives().
static final Attributes.Name IMPLEMENTATION_SHA_CLASSES_THIS
See getImplementationSHAClassesThis().
final String getImplementationTitle()
static final Attributes.Name IMPLEMENTATION_SHA_NATIVES_THIS
See getImplementationSHANativesThis().
final String getImplementationBranch()
Returns the SCM branch name.
final String getSpecificationTitle()
static final Attributes.Name IMPLEMENTATION_COMMIT
See getImplementationCommit().
final String getSpecificationVersion()
final Attributes.Name getAttributeName(final String attributeName)
static final String SEPERATOR
static Manifest getManifest(final ClassLoader cl, final String extension)
Returns the manifest of the jar which contains the specified extension.
static StringBuilder getFullManifestInfo(final Manifest mf, StringBuilder sb)