java.lang.Object
com.arc_e_tect.gradle.apionly.subscriber.Manifest

public final class Manifest extends Object
The manifest.json the Publisher ships inside every archive. This is the entire coupling between the two components, which is why it is parsed defensively and why nothing here depends on a JSON library: dragging a dependency into every implementation repository to read six fields would be a poor trade. Gradle verifying that a downloaded artifact matches its coordinates is not the same guarantee. That checks the artifact; this checks that the files actually extracted into the build still match what the producer published, which is the one that catches a hand-edited document in build/.
  • Method Details

    • read

      public static Manifest read(File file)
      Reads the manifest from a fetched archive.
      Parameters:
      file - the manifest.json inside the unpacked archive
      Returns:
      the parsed manifest
      Throws:
      IllegalStateException - if the file is absent, lists no files, or declares a schema version this class does not understand
      UncheckedIOException - if it cannot be read
    • target

      public String target()
      The contract this archive holds.
      Returns:
      the target name, or null if the manifest omits it
    • version

      public String version()
      The version the producer published this archive as.

      Checked against the version that was resolved, so an archive published under the wrong coordinates is caught rather than unpacked.

      Returns:
      the version, or null if the manifest omits it
    • closureSha256

      public String closureSha256()
      The content hash of the producer's dependency closure for this target.

      Recorded by the publisher so a later commit can tell whether the fragments behind a contract actually changed. The subscriber does not act on it; it is carried so that provenance travels with the artifact.

      Returns:
      the closure digest, or null if the manifest omits it
    • files

      public Map<String,String> files()
      Each declared document mapped to its SHA-256.
      Returns:
      the declared filenames and digests