Class CMakeTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.github.glorrian.cmakegradleplugin.CMakeTask
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
- Direct Known Subclasses:
CMakeBuildTask,CMakeConfigurationTask
public abstract class CMakeTask
extends org.gradle.api.DefaultTask
An abstract class from which all plugin tasks are inherited
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
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 TypeMethodDescriptionThe implementation of this method must contain an assembly of command line arguments for the taskabstract voidexecute()The method that is used as a Task Actionabstract org.gradle.api.file.DirectoryPropertyRequired output property for each taskabstract org.gradle.api.provider.Property<String> Required input property for each taskprotected final CMakeExtensionMethod to get DSL extension from project buildprotected final voidlogProviders(Consumer<? super String> function) Logs all the Provider of this task.protected final voidsetProperties(CMakeExtension extension) A method that parses all properties from the task and automatically sets them values from the DSL extensionprotected final <T> voidsetTypedFields(CMakeExtension cMakeExtension, Class<T> type, Method setterMethod) A method for set value to the field of task object from DSL extensionMethods 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, usesServiceMethods 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, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Constructor Details
-
CMakeTask
public CMakeTask()
-
-
Method Details
-
execute
public abstract void execute()The method that is used as a Task Action -
getBuildDirectory
@OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getBuildDirectory()Required output property for each task- Returns:
DirectoryPropertyThe directory where CMake is being built
-
getCMakeExecutable
Required input property for each task- Returns:
- Property with the path to the CMake executable file
-
buildCommandLine
The implementation of this method must contain an assembly of command line arguments for the task- Returns:
- The list of arguments to command line
- ImplNote:
- The items in the list cannot contain spaces
-
getExtension
Method to get DSL extension from project build- Returns:
- Extension contains data for task properties
-
setTypedFields
protected final <T> void setTypedFields(CMakeExtension cMakeExtension, Class<T> type, Method setterMethod) A method for set value to the field of task object from DSL extension- Type Parameters:
T- Parametrized type ofClassfrom type param- Parameters:
cMakeExtension- DSL extension with data in the fieldstype- Type of fields that will be handled by this methodsetterMethod- Method for set value of the parsed fields
-
setProperties
A method that parses all properties from the task and automatically sets them values from the DSL extension- Parameters:
extension- DSL extension from the build configuration
-
logProviders
Logs all the Provider of this task. The logging function is passed in arguments.- Parameters:
function- The logging function
-