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 an implementation's build 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
FieldsModifier and TypeFieldDescriptionstatic final StringThe classpath directory the documents of an API a project calls are copied under, followed by the target name: "contracts".static final StringThe project propertyapiOnlySubscriber.apiContractVersiondefaults to, and that the command line overrides it with: "apiContractVersion".static final StringThe name this plugin's extension is registered under: "apiOnlySubscriber".static final StringThe aggregate task that fetches every subscribed contract: "fetchApiSpec".static final StringThe DSL-updating task registered by this plugin.static final StringThe aggregate task that checks every fetched contract: "verifyApiSpec". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.gradle.api.Project project) Registers theapiOnlySubscriberextension and the tasks that act on it.
-
Field Details
-
EXTENSION_NAME
The name this plugin's extension is registered under: "apiOnlySubscriber".- See Also:
-
FETCH_TASK
The aggregate task that fetches every subscribed contract: "fetchApiSpec".- See Also:
-
VERIFY_TASK
The aggregate task that checks every fetched contract: "verifyApiSpec".- See Also:
-
UPDATE_DSL_TASK
The DSL-updating task registered by this plugin.- See Also:
-
CONTRACT_VERSION_PROPERTY
The project propertyapiOnlySubscriber.apiContractVersiondefaults to, and that the command line overrides it with: "apiContractVersion".- See Also:
-
CLIENT_RESOURCES
The classpath directory the documents of an API a project calls are copied under, followed by the target name: "contracts".- 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 theapiOnlySubscriberextension and the tasks that act on it.- Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>- Parameters:
project- the project the plugin is applied to
-