Package com.mooltiverse.oss.nyx.gradle
Class CoreTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.mooltiverse.oss.nyx.gradle.CoreTask
- All Implemented Interfaces:
Comparable<Task>
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.TaskInternal
,ExtensionAware
,Task
,Configurable<Task>
- Direct Known Subclasses:
CleanTask
,InferTask
,MakeTask
,MarkTask
,PublishTask
The abstract superclass for all Nyx core tasks.
Core tasks, as opposite to
LifecycleTask
are those performing some concrete actions.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The group the tasks belong to.static final String
The name used to store and retrieve the extra property that holds the shared backing Nyx instance that can be used by all tasks.static final String
The name used to store and retrieve the extra property that holds the state of the backing Nyx instance that can be used by all tasks and also user scripts.Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected NyxExtension
Returns the instance of the extension for the task.protected boolean
hasSharedProperty
(String name) Returnstrue
if there is a project with the given name stored for the project.protected Nyx
nyx()
Returns a shared backing Nyx instance to be used by all tasks within the project.protected Object
retrieveSharedProperty
(String name) Retrieves the shared project property with the given name.state()
Returns the state of the shared backing Nyx instance.protected void
storeSharedProperty
(String name, Object value) Stores the given value as a shared project property with the given name.Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
Methods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Field Details
-
NYX_INSTANCE_PROPERTY
The name used to store and retrieve the extra property that holds the shared backing Nyx instance that can be used by all tasks. -
NYX_STATE_PROPERTY
The name used to store and retrieve the extra property that holds the state of the backing Nyx instance that can be used by all tasks and also user scripts. -
GROUP
The group the tasks belong to.- See Also:
-
-
Constructor Details
-
CoreTask
Standard constructor.- Parameters:
extension
- the extension object. Cannot benull
.
-
-
Method Details
-
getExtension
Returns the instance of the extension for the task.- Returns:
- the extension for the task
-
nyx
Returns a shared backing Nyx instance to be used by all tasks within the project. The returned instance is already configured with the values coming from theNyxExtension
. This method also stores the instance as a shared project property so that all subsequent calls can retrieve the same instance to avoid creating multiple instances and saving configuration time. Moreover, the backing instance state object reference is stores as an extra property for use by user scripts. The instance is lazily created upon the first invocation so the Nyx instance is only created when needed.- Returns:
- a shared backing Nyx instance to be used by all tasks within the project.
- Throws:
DataAccessException
- in case the configuration can't be loaded for some reason.IllegalPropertyException
- in case the configuration has some illegal options.
-
state
Returns the state of the shared backing Nyx instance.- Returns:
- the state of the shared backing Nyx instance.
- Throws:
DataAccessException
- in case the configuration can't be loaded for some reason.IllegalPropertyException
- in case the configuration has some illegal options.- See Also:
-