org.gradle.nativeplatform.tasks

## Class AbstractLinkTask

- java.lang.Object
- - org.gradle.api.internal.AbstractTask
  - - org.gradle.api.DefaultTask
    - - org.gradle.nativeplatform.tasks.AbstractLinkTask

- All Implemented Interfaces:
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, ObjectFilesToBinary, org.gradle.util.Configurable<Task>
  Direct Known Subclasses:
    LinkExecutable, LinkSharedLibrary

      @Incubating
      public abstract class AbstractLinkTask
      extends DefaultTask
      implements ObjectFilesToBinary

  Base task for linking a native binary from object files and libraries.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Task

      `Task.Namer`

  - ### Field Summary

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractLinkTask()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract org.gradle.nativeplatform.internal.LinkerSpec` | `createLinkerSpec()`
    `File` | `getDestinationDir()` Include the destination directory as an output, to pick up auxiliary files produced alongside the main output file
    `FileCollection` | `getLibs()` The library files to be passed to the linker.
    `List<String>` | `getLinkerArgs()` Additional arguments passed to the linker.
    `org.gradle.internal.operations.logging.BuildOperationLoggerFactory` | `getOperationLoggerFactory()`
    `File` | `getOutputFile()` The file where the linked binary will be located.
    `FileCollection` | `getSource()` The source object files to be passed to the linker.
    `NativePlatform` | `getTargetPlatform()` The platform that the linked binary will run on.
    `NativeToolChain` | `getToolChain()` The tool chain used for linking.
    `void` | `lib(Object libs)` Adds a set of library files to be linked.
    `void` | `link()`
    `void` | `setLibs(FileCollection libs)`
    `void` | `setLinkerArgs(List<String> linkerArgs)`
    `void` | `setOutputFile(File outputFile)`
    `void` | `setSource(FileCollection source)`
    `void` | `setTargetPlatform(NativePlatform targetPlatform)`
    `void` | `setToolChain(NativeToolChain toolChain)`
    `void` | `source(Object source)` Adds a set of object files to be linked.

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActionClassLoaders, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.gradle.api.Task

      `configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, finalizedBy, getActions, getAnt, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getFinalizedBy, getGroup, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, hasProperty, leftShift, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

    - ### Methods inherited from interface org.gradle.api.plugins.ExtensionAware

      `getExtensions`

- - ### Constructor Detail

    - #### AbstractLinkTask

          @Inject
          public AbstractLinkTask()

  - ### Method Detail

    - #### getToolChain

          @Internal
          public NativeToolChain getToolChain()

      The tool chain used for linking.

    - #### setToolChain

          public void setToolChain(NativeToolChain toolChain)

    - #### getTargetPlatform

          public NativePlatform getTargetPlatform()

      The platform that the linked binary will run on.

    - #### setTargetPlatform

          public void setTargetPlatform(NativePlatform targetPlatform)

    - #### getDestinationDir

          @OutputDirectory
          public File getDestinationDir()

      Include the destination directory as an output, to pick up auxiliary files produced alongside the main output file

    - #### getOutputFile

          @OutputFile
          public File getOutputFile()

      The file where the linked binary will be located.

    - #### setOutputFile

          public void setOutputFile(File outputFile)

    - #### getLinkerArgs

          @Input
          public List<String> getLinkerArgs()

      Additional arguments passed to the linker.

    - #### setLinkerArgs

          public void setLinkerArgs(List<String> linkerArgs)

    - #### getSource

          @InputFiles
          public FileCollection getSource()

      The source object files to be passed to the linker.

    - #### setSource

          public void setSource(FileCollection source)

    - #### getLibs

          @InputFiles
          public FileCollection getLibs()

      The library files to be passed to the linker.

    - #### setLibs

          public void setLibs(FileCollection libs)

    - #### source

          public void source(Object source)

      Adds a set of object files to be linked. The provided source object is evaluated as per `Project.files(Object...)`.
      Specified by:
        `source` in interface `ObjectFilesToBinary`

    - #### lib

          public void lib(Object libs)

      Adds a set of library files to be linked. The provided libs object is evaluated as per `Project.files(Object...)`.

    - #### getOperationLoggerFactory

          @Inject
          public org.gradle.internal.operations.logging.BuildOperationLoggerFactory getOperationLoggerFactory()

    - #### link

          public void link()

    - #### createLinkerSpec

          protected abstract org.gradle.nativeplatform.internal.LinkerSpec createLinkerSpec()