contract

fun contract(dependency: Any): ModuleDependency

The contract of the api module dependency names: project(":ordering-api"), its coordinates "group:name[:version]", or an external module dependency without artifacts of its own. It is the module with its feature contract (capability <group>:<name>-contract) required: META-INF/wow/contract.json and the code generated from it, <Context>Contract and <State>View, with the api's types. A module that uses that code declares it, implementation(wow.contract(project(":ordering-api"))); a service sees every api's contract without it, and a domain's tests those of the build's api modules. A version catalog's accessor takes the other form (contract of a provider).

Throws

when dependency names no module: a classifier or an extension names an artifact, not a contract, and anything else is no module at all.


fun contract(dependency: Provider<out ExternalModuleDependency>): Provider<ModuleDependency>

The contract of the api module a version catalog names, implementation(wow.contract(libs.ordering.api)), as contract of the dependency: a provider, as implementation(...) takes one.