Class ApiOnlySubscriberPlugin

java.lang.Object
com.arc_e_tect.gradle.apionly.subscriber.ApiOnlySubscriberPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public class ApiOnlySubscriberPlugin extends Object implements org.gradle.api.Plugin<org.gradle.api.Project>
The consumer half of the API-Only pair. An implementation project declares which contracts it builds against and at which versions. The plugin fetches them, verifies them, and puts them on the classpath -- without the project holding a copy of anything the specification library owns. The question the API-Only Suite answers changes as a result. It stops being "does this implementation match this file that happens to sit in src/?" and becomes "does this implementation match the organisation's published contract, at version X?"
  • Field Details

    • EXTENSION_NAME

      public static final String EXTENSION_NAME
      The name this plugin's extension is registered under: "apiOnlySubscriber".
      See Also:
    • FETCH_TASK

      public static final String FETCH_TASK
      The aggregate task that fetches every subscribed contract: "fetchApiSpec".
      See Also:
    • VERIFY_TASK

      public static final String VERIFY_TASK
      The aggregate task that checks every fetched contract: "verifyApiSpec".
      See Also:
    • UPDATE_DSL_TASK

      public static final String UPDATE_DSL_TASK
      The DSL-updating task registered by this plugin.
      See Also:
    • CONTRACT_VERSION_PROPERTY

      public static final String CONTRACT_VERSION_PROPERTY
      The project property apiOnlySubscriber.version defaults to: "apiContractVersion".
      See Also:
  • Constructor Details

    • ApiOnlySubscriberPlugin

      public ApiOnlySubscriberPlugin()
      Creates the plugin. Gradle instantiates this when the plugin is applied.
  • Method Details

    • apply

      public void apply(org.gradle.api.Project project)
      Registers the apiOnlySubscriber extension and the tasks that act on it.
      Specified by:
      apply in interface org.gradle.api.Plugin<org.gradle.api.Project>
      Parameters:
      project - the project the plugin is applied to