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;

  • assembles META-INF/wow/contract.json into its jar (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), which its classes, jar and sources jar carry;

  • offers each declared domain module a core view of itself, a jar of its own classes without that code, which the domain compiles against (attribute WowPlugin.API_VIEW, a variant named after the domain's path): the domain's contract comes from compiling the domain, so the domain cannot wait for the code generated from it.

An api module of no declared domain module carries no contract and generates nothing.

Constructors

Link copied to clipboard
constructor()

Functions

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