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
  • 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

      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

      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