Class PublisherConfig<T,S>

java.lang.Object
io.github.smootheez.PublisherConfig<T,S>
Type Parameters:
T - the dependency model type used by the platform (e.g., CurseforgeDependency)
S - the identifier type for declaring a dependency (e.g., String slug or project ID)
Direct Known Subclasses:
CurseforgeConfig, ModrinthConfig

public abstract class PublisherConfig<T,S> extends Object
Base configuration class for all publisher integrations (e.g., Modrinth, CurseForge).

Provides common fields such as authentication token, project identifier, and a container for declaring dependency relationships.

Subclasses must supply concrete dependency creation logic for their respective publishing platforms.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.gradle.api.NamedDomainObjectContainer<T>
    Container holding all declared dependency relationships for this publisher, created using Gradle's NamedDomainObjectContainer.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    PublisherConfig(org.gradle.api.model.ObjectFactory objects, Class<T> dependencyType)
    Creates a new publisher configuration and initializes the dependency container.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    dependencies(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<T>> action)
    Provides access to the dependency container for modification.
    abstract T
    embedded(S id)
    Declares an embedded dependency (e.g., libraries bundled with the mod).
    abstract T
    Declares an incompatible dependency.
    abstract T
    optional(S id)
    Declares an optional dependency.
    abstract T
    required(S id)
    Declares a required dependency.

    Methods inherited from class java.lang.Object

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

    • dependencies

      protected final org.gradle.api.NamedDomainObjectContainer<T> dependencies
      Container holding all declared dependency relationships for this publisher, created using Gradle's NamedDomainObjectContainer.
  • Constructor Details

    • PublisherConfig

      protected PublisherConfig(org.gradle.api.model.ObjectFactory objects, Class<T> dependencyType)
      Creates a new publisher configuration and initializes the dependency container.
      Parameters:
      objects - the Gradle object factory
      dependencyType - the class representing the dependency model type
  • Method Details

    • dependencies

      public abstract void dependencies(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<T>> action)
      Provides access to the dependency container for modification.
      Parameters:
      action - action that configures the dependency container
    • required

      public abstract T required(S id)
      Declares a required dependency.
      Parameters:
      id - the identifier for the dependency (slug, project ID, etc.)
      Returns:
      the configured dependency instance
    • optional

      public abstract T optional(S id)
      Declares an optional dependency.
      Parameters:
      id - the identifier for the dependency
      Returns:
      the configured dependency instance
    • incompatible

      public abstract T incompatible(S id)
      Declares an incompatible dependency.
      Parameters:
      id - the identifier for the dependency
      Returns:
      the configured dependency instance
    • embedded

      public abstract T embedded(S id)
      Declares an embedded dependency (e.g., libraries bundled with the mod).
      Parameters:
      id - the identifier for the dependency
      Returns:
      the configured dependency instance