ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Gregoire <paul.grego...@hellonetwork.com>
Subject RE: What does a valid manifest look like?
Date Wed, 13 Feb 2002 23:41:46 GMT
Heres a snip of code i use to create a manifest followed by the manifest
file output that it generates

CODE
	-------- cut ---------
        // create a maifest
        Manifest man = new Manifest();
        // get the attributes
        Attributes attr = man.getMainAttributes();
        // set the version - it won't do jack without this!
        attr.put(Attributes.Name.MANIFEST_VERSION, "1.0");
        jarFile = new File(outputDirectory + File.separator + jarFilename);
        int numberOfMidlets = midletList.size();
        int numberOfOtherFiles = resourceList.size();
        attr.put(new Attributes.Name(Constants.MIDLET_NAME), suiteName);
        attr.put(new Attributes.Name(Constants.MIDLET_VENDOR), vendorName);
        attr.put(new Attributes.Name(Constants.MIDLET_VERSION), version);
        attr.put(new Attributes.Name(Constants.MICROEDITION_CONFIGURATION),
configName);
        attr.put(new Attributes.Name(Constants.MICROEDITION_PROFILE),
profileName);
        attr.put(new Attributes.Name(Constants.CREATED_BY),
Constants.VENDOR);
        // create an output stream with which to create JAR file
        JarOutputStream jos = new JarOutputStream(new
FileOutputStream(jarFile), man);
        // set the compression high
        jos.setLevel(9);
	-------- cut --------

MANIFEST

Manifest-Version: 1.0
MIDlet-1: Player,hellonetwork.png,com.hellonetwork.player.midp.Player
MIDlet-Name: test
MIDlet-Version: 1.0.0
Created-By: helloNetwork, Inc.
MIDlet-Vendor: helloNetwork, Inc.
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-1.0


works great...


-----Original Message-----
From: Mallampati, Suresh [mailto:SMallampati@erac.com]
Sent: Wednesday, February 13, 2002 3:32 PM
To: 'Ant Users List'
Subject: RE: What does a valid manifest look like?


The Name attributes should be separated by a new line from the main
attributes. 
If you want to give the same input as you are doing now, you can try
inserting a new line at the beginning of the manifest file, should work.(So
the first line is empty)
Suresh

-----Original Message-----
From: Steve Donie [mailto:SDonie@lgc.com]
Sent: Wednesday, February 13, 2002 5:10 PM
To: Ant-User (E-mail)
Subject: RE: What does a valid manifest look like?


the jar task automatically adds the Manifest-Version and Created-by
attributes - they are showing up in the manifest.mf in the jar file.

 -----Original Message-----
From: 	Eddie Bernard [mailto:ebernard@digitalthink.com] 
Sent:	Wednesday, February 13, 2002 3:41 PM
To:	'Ant Users List'
Subject:	RE: What does a valid manifest look like?

I think you may need to add the following as the first line to your
manifest:

Manifest-Version: 1.0



-----Original Message-----
From: Steve Donie [mailto:SDonie@lgc.com]
Sent: Wednesday, February 13, 2002 11:51 AM
To: 'Ant-User (ant-user@jakarta.apache.org)'
Subject: What does a valid manifest look like?


Very frustrating. I have a manifest file (called MyManifest.mf) that looks
like this:

Name: com/lgc/infra/dsp/
Specification-Title: DecisionSpace SDK, dsp project
Specification-Vendor: Landmark Graphics Corporation
Specification-Version: 2003.2.0.0
Implementation-Title: DecsisionSpace Infrastructure: dsp 
Implementation-Vendor: Landmark Graphics Corporation
Implementation-Version: 2003.2.0.0.0213.48
    
Name: com/lgc/infra/pres/appworks/
Specification-Title: DecisionSpace SDK
Specification-Vendor: Landmark Graphics Corporation
Specification-Version: 2003.2.0.0
Implementation-Title: com.lgc.infra.pres.appworks 
Implementation-Vendor: Landmark Graphics Corporation
Implementation-Version: 2003.2.0.0.0213.48

When I incorporate that into a jar file with Ant 1.4.1:

    <jar 
      jarfile="${jar}/com_lgc_dsp.jar" 
      basedir="${classes}"
      whenempty="fail"
      manifest="${manifests}/MyManifest.mf" />

I get warnings:

Building jar: E:\Work\tahoe\jar\com_lgc_dsp.jar
Manifest warning: "Name" attributes should not occur in the main section and
must be the first element in all other sections: "Name: com/lgc/infra/dsp/"
Manifest warning: "Name" attributes should not occur in the main section and
must be the first element in all other sections: "Name:
com/lgc/infra/pres/appworks/"

But when I remove the line "Name: com/lgc/infra/dsp/" from the manifest, I
get an error!

Manifest is invalid: Manifest sections should start with a "Name" attribute
and
not "Specification-Title"

What gives? I have done all sorts of looking around at various manifest
files, and the Jar specification, and the archives of ant-dev and ant-user,
and I don't know what to think at this point.

What does a valid manifest look like?

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message