Package io.github.smootheez
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
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
FieldsModifier and TypeFieldDescriptionprotected final org.gradle.api.NamedDomainObjectContainer<T> Container holding all declared dependency relationships for this publisher, created using Gradle'sNamedDomainObjectContainer. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPublisherConfig(org.gradle.api.model.ObjectFactory objects, Class<T> dependencyType) Creates a new publisher configuration and initializes the dependency container. -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddependencies(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<T>> action) Provides access to the dependency container for modification.abstract TDeclares an embedded dependency (e.g., libraries bundled with the mod).abstract Tincompatible(S id) Declares an incompatible dependency.abstract TDeclares an optional dependency.abstract TDeclares a required dependency.
-
Field Details
-
dependencies
Container holding all declared dependency relationships for this publisher, created using Gradle'sNamedDomainObjectContainer.
-
-
Constructor Details
-
PublisherConfig
Creates a new publisher configuration and initializes the dependency container.- Parameters:
objects- the Gradle object factorydependencyType- 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
Declares a required dependency.- Parameters:
id- the identifier for the dependency (slug, project ID, etc.)- Returns:
- the configured dependency instance
-
optional
Declares an optional dependency.- Parameters:
id- the identifier for the dependency- Returns:
- the configured dependency instance
-
incompatible
Declares an incompatible dependency.- Parameters:
id- the identifier for the dependency- Returns:
- the configured dependency instance
-
embedded
Declares an embedded dependency (e.g., libraries bundled with the mod).- Parameters:
id- the identifier for the dependency- Returns:
- the configured dependency instance
-