Package org.apache.tools.ant.taskdefs.Manifest

Examples of org.apache.tools.ant.taskdefs.Manifest.Attribute


    }

    private void addAttributesToAnt(Manifest antManifest) {
        for (Map.Entry<String, Object> entry : attributes.entrySet()) {
            try {
                antManifest.addConfiguredAttribute(new Attribute(entry.getKey().toString(), entry.getValue().toString()));
            } catch (ManifestException e) {
                throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
            }
        }
    }
View Full Code Here


            Section section = new Section();
            section.setName(entry.getKey());
            try {
                antManifest.addConfiguredSection(section);
                for (Map.Entry<String, Object> attributeEntry : entry.getValue().entrySet()) {
                    section.addConfiguredAttribute(new Attribute(attributeEntry.getKey().toString(), attributeEntry.getValue().toString()));
                }
            } catch (ManifestException e) {
                throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
            }
        }
View Full Code Here

     */
    public void addConfiguredSection(Manifest.Section section)
         throws ManifestException {
        Enumeration<String> attributeKeys = section.getAttributeKeys();
        while (attributeKeys.hasMoreElements()) {
            Attribute attribute = section.getAttribute(
                attributeKeys.nextElement());
            checkAttribute(attribute);
        }
        nestedManifest.addConfiguredSection(section);
    }
View Full Code Here

            Manifest manifest = new Manifest();
            java.util.jar.Manifest jmanifest = jis.getManifest();
            java.util.jar.Attributes jattributes = jmanifest.getMainAttributes();
            try {
                // Specify our Created-By and Main-Class attributes as overrides.
                manifest.addConfiguredAttribute(new Attribute("Created-By", "One-Jar 0.98 Ant taskdef"));
                manifest.addConfiguredAttribute(new Attribute(MAIN_CLASS, jattributes.getValue(MAIN_CLASS)));
                if (oneJarMainClass != null) {
                    manifest.addConfiguredAttribute(new Attribute(Boot.ONE_JAR_MAIN_CLASS, oneJarMainClass));
                }
                super.addConfiguredManifest(manifest);
            } catch (ManifestException mx) {
                throw new BuildException(mx);
            }
View Full Code Here

     */
    public void addConfiguredSection(Manifest.Section section)
         throws ManifestException {
        Enumeration attributeKeys = section.getAttributeKeys();
        while (attributeKeys.hasMoreElements()) {
            Attribute attribute = section.getAttribute(
                (String) attributeKeys.nextElement());
            checkAttribute(attribute);
        }
        nestedManifest.addConfiguredSection(section);
    }
View Full Code Here

     */
    public void addConfiguredSection(Manifest.Section section)
         throws ManifestException {
        Enumeration attributeKeys = section.getAttributeKeys();
        while (attributeKeys.hasMoreElements()) {
            Attribute attribute = section.getAttribute(
                (String) attributeKeys.nextElement());
            checkAttribute(attribute);
        }
        nestedManifest.addConfiguredSection(section);
    }
View Full Code Here

            Manifest manifest = new Manifest();
            java.util.jar.Manifest jmanifest = jis.getManifest();
            java.util.jar.Attributes jattributes = jmanifest.getMainAttributes();
            try {
                // Specify our Created-By and Main-Class attributes as overrides.
                manifest.addConfiguredAttribute(new Attribute("Created-By", "One-Jar 0.96 Ant taskdef"));
                manifest.addConfiguredAttribute(new Attribute(MAIN_CLASS, jattributes.getValue(MAIN_CLASS)));
                if (oneJarMainClass != null) {
                    manifest.addConfiguredAttribute(new Attribute(Boot.ONE_JAR_MAIN_CLASS, oneJarMainClass));
                }
                super.addConfiguredManifest(manifest);
            } catch (ManifestException mx) {
                throw new BuildException(mx);
            }
View Full Code Here

    }

    private void addAttributesToAnt(Manifest antManifest) {
        for (Map.Entry<String, Object> entry : attributes.entrySet()) {
            try {
                antManifest.addConfiguredAttribute(new Attribute(entry.getKey(), entry.getValue().toString()));
            } catch (ManifestException e) {
                throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
            }
        }
    }
View Full Code Here

            Section section = new Section();
            section.setName(entry.getKey());
            try {
                antManifest.addConfiguredSection(section);
                for (Map.Entry<String, Object> attributeEntry : entry.getValue().entrySet()) {
                    section.addConfiguredAttribute(new Attribute(attributeEntry.getKey(), attributeEntry.getValue().toString()));
                }
            } catch (ManifestException e) {
                throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
            }
        }
View Full Code Here

  }

  void setManifest(Manifest man, String key, String value) {
    if (!StringUtils.isEmpty(value)) {
      try {
        man.addConfiguredAttribute(new Attribute(key, value));
      } catch (ManifestException e) {
        console.error(e, "Failed to set manifest attribute \"{0}\"!", key);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Manifest.Attribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.