ComponentSrc - Source component typeResolvedComponent - Final component typepublic abstract class AbstractDownloadableComponent<ComponentSrc,ResolvedComponent>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected org.ysb33r.grolifant5.api.core.ProjectOperations |
projectOperations
Re-usable instance of
ProjectOperations |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDownloadableComponent(org.gradle.api.Project project)
Protected c-tor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.util.concurrent.Callable<ResolvedComponent> |
convertible(ComponentSrc component)
Create a closure that will convert an instance of a
ComponentSrc into a ResolvedComponent. |
protected java.util.concurrent.Callable<ResolvedComponent> |
convertible(java.lang.String name,
org.ysb33r.grolifant5.api.core.git.AbstractCloudGit component)
Creates a closure that can convert from a GitLab/GitHub repository to a local cached file.
|
ResolvedComponent |
getByName(java.lang.String name)
Retrieve a component by name.
|
void |
github(java.lang.String name,
org.gradle.api.Action<org.asciidoctor.gradle.base.AscGitHubArchive> githubConfig)
Use a GitHub repository as a theme.
|
void |
gitlab(java.lang.String name,
org.gradle.api.Action<org.asciidoctor.gradle.base.AscGitLabArchive> gitlabConfig)
Use a GitLab repository as a theme.
|
void |
gitlab(java.lang.String name,
groovy.lang.Closure<?> gitlabConfig)
Use a GitLab repository as a theme.
|
protected abstract ComponentSrc |
instantiateComponentSource(java.lang.String name)
Instantiates a component of type
ComponentSrc. |
protected abstract ResolvedComponent |
instantiateResolvedComponent(java.lang.String name,
java.io.File path)
Instantiates a resolved component.
|
void |
local(java.lang.String name,
org.gradle.api.Action<ComponentSrc> localConfig)
Adds a component source that is available on the local filesystem.
|
protected final org.ysb33r.grolifant5.api.core.ProjectOperations projectOperations
ProjectOperationsprotected AbstractDownloadableComponent(org.gradle.api.Project project)
project - Temporary project reference.public void local(java.lang.String name,
org.gradle.api.Action<ComponentSrc> localConfig)
By default, the styleName will match that of the theme.
If the name ends with .yml, it’s assumed to be the complete name of a file.
Otherwise, -theme.yml is appended to the name to make the file name (i.e., <name>-theme.yml).
name - Name of themelocalConfig - Configures an instance of ComponentSrc.public void github(java.lang.String name,
org.gradle.api.Action<org.asciidoctor.gradle.base.AscGitHubArchive> githubConfig)
name - Name of themegithubConfig - Action to configure a AscGitHubArchive.public void gitlab(java.lang.String name,
@DelegatesTo(value=org.ysb33r.grolifant5.api.core.git.GitLabArchive.class)
groovy.lang.Closure<?> gitlabConfig)
name - Name of themegitlabConfig - Closure to configure a AscGitLabArchive.public void gitlab(java.lang.String name,
org.gradle.api.Action<org.asciidoctor.gradle.base.AscGitLabArchive> gitlabConfig)
name - Name of themegitlabConfig - Action to configure a AscGitLabArchive.public ResolvedComponent getByName(java.lang.String name)
If the component has not already been resolved, it will be resolved by this call.
name - Name of the component.org.gradle.api.UnknownDomainObjectException - is the component has not been registered.protected java.util.concurrent.Callable<ResolvedComponent> convertible(java.lang.String name, org.ysb33r.grolifant5.api.core.git.AbstractCloudGit component)
name - Name or componenetcomponent - Details of component in remote repository.protected abstract ComponentSrc instantiateComponentSource(java.lang.String name)
ComponentSrc.name - Name of componenetprotected abstract java.util.concurrent.Callable<ResolvedComponent> convertible(ComponentSrc component)
ComponentSrc into a ResolvedComponent.component - Component to be converted.protected abstract ResolvedComponent instantiateResolvedComponent(java.lang.String name, java.io.File path)
name - Name of componentpath - Path to where compoenet is located on local filesystem.