Class ChannelSpec

java.lang.Object
com.arc_e_tect.gradle.apionly.subscriber.ChannelSpec

public abstract class ChannelSpec extends Object
Where subscribed contracts are fetched from.

Configured once per project, inside the apiOnlySubscriber block:


 apiOnlySubscriber {
     channel {
         type = 'maven'
         groupId = 'com.example.contracts'
     }
 }
 

maven is the default because it costs this plugin almost nothing. The artifact is declared in a detached configuration and Gradle's own dependency resolution performs the fetching, caching and up-to-date checking, so the plugin carries no HTTP client, no cache and no retry policy of its own.

file reads a local directory instead. It exists for iterating on a contract before it is published anywhere, and is the only channel that touches the filesystem directly.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the specification with maven as the channel type.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<String>
    The directory the file channel reads from.
    abstract org.gradle.api.provider.Property<String>
    The artifact extension the contracts are published with.
    abstract org.gradle.api.provider.Property<String>
    The Maven group the contracts are published under.
    abstract org.gradle.api.provider.Property<String>
    Which kind of channel to resolve through.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getType

      public abstract org.gradle.api.provider.Property<String> getType()
      Which kind of channel to resolve through.

      Either "maven" or "file". Anything else fails the build with a message naming the channels that do exist.

      Returns:
      the channel type; defaults to "maven"
    • getGroupId

      public abstract org.gradle.api.provider.Property<String> getGroupId()
      The Maven group the contracts are published under.

      Required by the maven channel. A single subscription may override it through Subscription.getGroupId() when one target is published somewhere else.

      Returns:
      the group id, with no default
    • getExtension

      public abstract org.gradle.api.provider.Property<String> getExtension()
      The artifact extension the contracts are published with.

      Used by the maven channel to form the dependency notation group:name:version@extension.

      Returns:
      the extension; defaults to "tgz"
    • getDirectory

      public abstract org.gradle.api.provider.Property<String> getDirectory()
      The directory the file channel reads from.

      Archives are expected at <directory>/<target>/<version>/<target>-<version>.tgz, which is the layout api-only-publisher publish --channel file writes.

      Returns:
      the directory, with no default