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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract List<String>
    The implementation of this method must contain an assembly of command line arguments for the task
    abstract void
    The method that is used as a Task Action
    abstract org.gradle.api.file.DirectoryProperty
    Required output property for each task
    abstract org.gradle.api.provider.Property<String>
    Required input property for each task
    protected final CMakeExtension
    Method to get DSL extension from project build
    protected final void
    logProviders(Consumer<? super String> function)
    Logs all the Provider of this task.
    protected final void
    A method that parses all properties from the task and automatically sets them values from the DSL extension
    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

    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
  • 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:
      DirectoryProperty The directory where CMake is being built
    • getCMakeExecutable

      @InputFile public abstract org.gradle.api.provider.Property<String> getCMakeExecutable()
      Required input property for each task
      Returns:
      Property with the path to the CMake executable file
    • buildCommandLine

      protected abstract List<String> 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

      @Internal protected final CMakeExtension 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 of Class from type param
      Parameters:
      cMakeExtension - DSL extension with data in the fields
      type - Type of fields that will be handled by this method
      setterMethod - Method for set value of the parsed fields
    • setProperties

      protected final void setProperties(CMakeExtension extension)
      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

      protected final void logProviders(Consumer<? super String> function)
      Logs all the Provider of this task. The logging function is passed in arguments.
      Parameters:
      function - The logging function