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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name this plugin's extension is registered under: "apiOnlySubscriber".
    static final String
    The aggregate task that fetches every subscribed contract: "fetchApiSpec".
    static final String
    The aggregate task that checks every fetched contract: "verifyApiSpec".
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(org.gradle.api.Project project)
    Registers the apiOnlySubscriber extension and the tasks that act on it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
  • 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