WowApiPlugin

class WowApiPlugin : Plugin<Project>

me.ahoo.wow.api: builds a context's api module (ApiRole.api), the commands, events and value classes another service depends on, with the peer contract and the code generated from it. The module declares the domain modules whose contracts it carries, dependencies { wowContract(project(":shop-domain")) }, and

  • becomes a java-library, with api(platform("me.ahoo.wow:wow-bom:<plugin version>")) and api("me.ahoo.wow:wow-api"), the latter unless it declares wow-api itself;

  • holds its types alone in its own variants and jar, which every module compiles against: its domain modules compile without waiting for their contract, and another context's domain without waiting for this one's;

  • assembles META-INF/wow/contract.json (AssembleContract): the contexts of those contracts whose command and event classes are all its own; a declared domain module of no contract fails it, naming the module;

  • with the Kotlin JVM plugin, compiles <package>.<Context>Contract per context and <State>View per published state from that contract (GenerateContractSources, source set WowPlugin.CONTRACT_SOURCE_SET);

  • offers both in its contract jar (WowPlugin.CONTRACT_JAR_TASK), its feature contract (capability <group>:<name>-contract, ContractRole): a module that uses the generated code asks for it with wow.contract(...), and a service, and the tests, see every api's contract;

  • tells the domain modules it declares, in-build, that it pairs with them (wowPairingElements).

An api module of no declared domain module is a library of types: it offers no contract and generates nothing.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun apply(project: Project)