Class Manifest
java.lang.Object
com.arc_e_tect.gradle.apionly.subscriber.Manifest
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 Summary
Modifier and TypeMethodDescriptionThe content hash of the producer's dependency closure for this target.files()Each declared document mapped to its SHA-256.static ManifestReads the manifest from a fetched archive.target()The contract this archive holds.version()The version the producer published this archive as.
-
Method Details
-
read
Reads the manifest from a fetched archive.- Parameters:
file- themanifest.jsoninside 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 understandUncheckedIOException- if it cannot be read
-
target
The contract this archive holds.- Returns:
- the target name, or
nullif the manifest omits it
-
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
nullif the manifest omits it
-
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
nullif the manifest omits it
-
files
Each declared document mapped to its SHA-256.- Returns:
- the declared filenames and digests
-