ManifestTools

What the plugin's workers run: the plugin resolves these tools (victools, Jackson, the kernel) into a configuration of the build's project and loads them in an isolated class loader, so none of them reaches the build script's class path. The plugin calls these functions by name, through reflection, and passes only JDK types across that boundary.

Properties

Link copied to clipboard

The Gradle property that lets recordBaseline record a break within its line: for pre-releases.

Functions

Link copied to clipboard
fun assembleContract(contracts: List<File>, owners: Map<String, String>, classes: List<File>, owner: String, output: File): Boolean

Writes the contract the api module owner carries, META-INF/wow/contract.json (PeerContracts.RESOURCE) under output, which it clears first: of the contracts of the domain modules it declares (each named by owners, by its path), the contexts whose command and event classes are all in its classes directories (PeerContracts.assemble); what the Gradle plugin's assembleWowContract does. A declared module of no context (it compiles no model) fails, naming it. Returns whether the api module carries a contract: with no context of its own, it carries none.

Link copied to clipboard
fun checkCompatibility(baseline: File, current: File, report: File, owner: String): Int

The Manifest gate of the service owner (project ':x', as a failure names it): compares the service's current Manifest with its committed baseline (ManifestCompatibility, Baseline) and writes the classified changes to report. Fails when there is no baseline; when a change breaks the contract within the baseline's compatibility line (the service's major version is the line's, and no pre-release keeps it open, Baseline.allowsBreaking), listing each; and when the baseline is not the Manifest this build produces, its version aside, or not of the service's major: every change is recorded, so the baseline's diff in review shows what the clients will see. Each failure names UPDATE_BASELINE_TASK. Returns the number of additive changes.

Link copied to clipboard
fun completeFragment(fragment: File, output: File, schemaOverrides: Map<String, String>)

Completes the compiler's fragment into output (SchemaIntrospector). The classes it refers to are loaded from this object's class loader, the worker's, which holds the module's classes.

Link copied to clipboard
fun generateContract(fragments: List<File>, service: String?, module: String, unpaired: Map<String, String>, output: File)

Writes the peer contract of the domain module module's completed fragments into output (PeerContracts.contractOf), naming the service that hosts its contexts when given; what the Gradle plugin's generateWowContract does. A context whose command or event classes are in an entry of unpaired (a class path entry of a project that does not pair with the module, to that project's path) fails, naming the line that pairs them: the contract would reach no api module, and no peer would see the context.

Link copied to clipboard
fun generateContractSources(contracts: List<File>, classpath: List<File>, output: File): Int

Writes the Kotlin sources generated from the api module's contracts (none, or the one assembleWowContract wrote) under output, which it clears first (ContractSources): the <Context>Contracts and the views of the states, which reference the classes of the classpath the code compiles against; with wow-query-api on it, the query field constants of the states too. What the Gradle plugin's generateWowContractSources does. Returns the number of files written.

Link copied to clipboard
fun generateHelmValues(manifest: File, classpath: List<File>, output: File): Int

Writes the values of the wow-service Helm chart that the build knows (HelmValues) into output: the name of the service of its merged manifest, the peers whose contracts are on its classpath (the contexts it does not host, each with the service its contract names) and the route of its Manifest. What the Gradle plugin's generateWowHelmValues does. Returns the number of peers.

Link copied to clipboard
fun generateOpenApi(manifest: File, output: File)

Writes the OpenAPI 3.1 document of the service's public routes (ManifestOpenApi) from its merged manifest into output: what GET /wow/openapi serves, as far as the build knows it; what the Gradle plugin's generateWowOpenApi does.

Link copied to clipboard
fun merge(classpath: List<File>, owners: Map<String, String>, serviceName: String?, defaultServiceName: String, serviceVersion: String?, output: File): Int

Assembles the fragments found in the classpath entries into output as the node does at startup (ManifestAssembly), each named after its entry's owner in owners (a project or a module, by the entry's path), describing the service serviceOf names: the one the contracts of its contexts and its own serviceName agree on; fails on a conflict, on a schema reference no fragment resolves, on another context's event a handler takes whose aggregate the peer contracts on the classpath do not say (PeerSources), or on a command a saga derives by its class that neither a context of the service nor a peer contract on the classpath decides (undecidedCommands), or on two fragments of one name (fragmentsOf). Returns the number of fragments merged.

Link copied to clipboard
fun recordBaseline(manifest: File, baseline: File, allowBreaking: Boolean, report: File, owner: String)

Records the service's manifest as its baseline, what checkCompatibility compares with: the Manifest without its service's version, on the compatibility line of its major. Refuses to record a breaking change against the existing baseline within its line (Baseline.allowsBreaking) unless allowBreaking (-Pwow.manifest.allowBreaking), which report then records with the changes.