# 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, Named, ExtensionAware, Task, ObjectFilesToBinary, Configurable<Task>`

Direct Known Subclasses:
  `LinkExecutable, LinkMachOBundle, LinkSharedLibrary`

@DisableCachingByDefault(because="Abstract super-class, not to be instantiated directly") public abstract class AbstractLinkTask extends DefaultTask implements ObjectFilesToBinary
Base task for linking a native binary from object files and libraries.

Since:
  2.2

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Named

  `Named.Namer`

- ## Field Summary

  ### Fields inherited from interface Task

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractLinkTask()`
  Creates a new `AbstractLinkTask`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract org.gradle.nativeplatform.internal.LinkerSpec`
  `createLinkerSpec()`
  Create linker spec.
  `protected CompilerVersion`
  `getCompilerVersion()`
  The linker used, including the type and the version.
  `Property<Boolean>`
  `getDebuggable()`
  Create a debuggable binary?
  `protected abstract org.gradle.internal.file.Deleter`
  `getDeleter()`
  `abstract DirectoryProperty`
  `getDestinationDirectory()`
  Include the destination directory as an output, to pick up auxiliary files produced alongside the main output file
  `ConfigurableFileCollection`
  `getLibs()`
  The library files to be passed to the linker.
  `abstract RegularFileProperty`
  `getLinkedFile()`
  The file where the linked binary will be located.
  `abstract ListProperty<String>`
  `getLinkerArgs()`
  Additional arguments passed to the linker.
  `protected abstract org.gradle.internal.operations.logging.BuildOperationLoggerFactory`
  `getOperationLoggerFactory()`
  `ConfigurableFileCollection`
  `getSource()`
  The source object files to be passed to the linker.
  `abstract Property<NativePlatform>`
  `getTargetPlatform()`
  The platform being linked for.
  `abstract Property<NativeToolChain>`
  `getToolChain()`
  The tool chain used for linking.
  `boolean`
  `isDebuggable()`
  Create a debuggable binary?
  `void`
  `lib(Object libs)`
  Adds a set of library files to be linked.
  `protected void`
  `link()`
  Link.
  `void`
  `setLibs(FileCollection libs)`
  Sets the libs.
  `void`
  `setSource(FileCollection source)`
  Sets the source.
  `void`
  `source(Object source)`
  Adds a set of object files to be linked.

  ### Methods inherited from class 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, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getLoggingManager, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, service, setImpliesSubProjects`

  ### Methods inherited from class Object

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

  ### Methods inherited from interface Comparable

  `compareTo`

  ### Methods inherited from interface ExtensionAware

  `getExtensions`

  ### Methods inherited from interface Task

  `configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, doNotTrackState, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getFinalizedBy, getGroup, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getPath, getProject, getShouldRunAfter, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, notCompatibleWithConfigurationCache, onlyIf, onlyIf, onlyIf, property, service, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService`

- ## Constructor Details

  - ### AbstractLinkTask

    public AbstractLinkTask()
    Creates a new `AbstractLinkTask`.
    Since:
      2.2

- ## Method Details

  - ### getToolChain

    @Internal public abstract Property<NativeToolChain> getToolChain()
    The tool chain used for linking.
    Since:
      4.7

  - ### getTargetPlatform

    public abstract Property<NativePlatform> getTargetPlatform()
    The platform being linked for.
    Since:
      4.7

  - ### getDestinationDirectory

    @OutputDirectory public abstract DirectoryProperty getDestinationDirectory()
    Include the destination directory as an output, to pick up auxiliary files produced alongside the main output file
    Since:
      4.7

  - ### getLinkedFile

    @OutputFile public abstract RegularFileProperty getLinkedFile()
    The file where the linked binary will be located.
    Since:
      4.7

  - ### getLinkerArgs

    @Input public abstract ListProperty<String> getLinkerArgs()
    Additional arguments passed to the linker.
    Since:
      4.3

  - ### isDebuggable

    @Internal public boolean isDebuggable()
    Create a debuggable binary?
    Since:
      4.3

  - ### getDebuggable

    @Input public Property<Boolean> getDebuggable()
    Create a debuggable binary?
    Since:
      4.7

  - ### getSource

    @InputFiles @SkipWhenEmpty @IgnoreEmptyDirectories @PathSensitive(RELATIVE) public ConfigurableFileCollection getSource()
    The source object files to be passed to the linker.
    Since:
      2.2

  - ### setSource

    public void setSource(FileCollection source)
    Sets the source.
    Since:
      2.2

  - ### getLibs

    @PathSensitive(RELATIVE) @InputFiles public ConfigurableFileCollection getLibs()
    The library files to be passed to the linker.
    Since:
      2.2

  - ### setLibs

    public void setLibs(FileCollection libs)
    Sets the libs.
    Since:
      2.2

  - ### 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...)`.
    Since:
      2.2

  - ### getCompilerVersion

    protected CompilerVersion getCompilerVersion()
    The linker used, including the type and the version.
    Since:
      4.7

  - ### getOperationLoggerFactory

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

  - ### getDeleter

    @Inject protected abstract org.gradle.internal.file.Deleter getDeleter()

  - ### link

    protected void link()
    Link.
    Since:
      2.2

  - ### createLinkerSpec

    protected abstract org.gradle.nativeplatform.internal.LinkerSpec createLinkerSpec()
    Create linker spec.
    Since:
      2.2