Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.build by
retagged by

Sections are groups which start with Name: and have section-specific entries in them.

Capsule uses this for having platform-specific information about how to start.

Here's an example of using the API to get section information:

Main-Class: clojure.main

Name: Frank
Main-Class: frank.clojure.main


❯ clj       
Clojure 1.10.3
user=> (require '[clojure.java.io :as io])
user=> (io/input-stream "/tmp/MANIFEST.MF")
#object[java.io.BufferedInputStream 0x69ce2f62 "java.io.BufferedInputStream@69ce2f62"]
user=> (def mf (java.util.jar.Manifest. (io/input-stream "/tmp/MANIFEST.MF")))
user=> (.getAttributes mf "Frank")
{#object[java.util.jar.Attributes$Name 0x2e3a5237 "Main-Class"] "frank.clojure.main"}
user=> (.getMainAttributes mf)
{#object[java.util.jar.Attributes$Name 0x2e3a5237 "Main-Class"] "clojure.main"}
user=> (.getEntries mf)
{"Frank" {#object[java.util.jar.Attributes$Name 0x2e3a5237 "Main-Class"] "frank.clojure.main"}}

1 Answer

0 votes