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, LinkMachOBundle, LinkSharedLibrary

@Incubating public abstract class AbstractLinkTask extends DefaultTask implements ObjectFilesToBinary
Base task for linking a native binary from object files and libraries.
  • Constructor Details

    • AbstractLinkTask

      public AbstractLinkTask()
  • Method Details

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

      @OutputFile public RegularFileProperty getBinaryFile()
      The file where the linked binary will be located.
      Since:
      4.1
    • getOutputFile

      @Internal public File getOutputFile()
    • setOutputFile

      public void setOutputFile(File outputFile)
    • setOutputFile

      public void setOutputFile(Provider<? extends RegularFile> outputFile)
      Sets the output file generated by the linking process via a Provider.
      Parameters:
      outputFile - the output file provider to use
      Since:
      4.1
      See Also:
    • getLinkerArgs

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

      @Input public boolean isDebuggable()
      Create a debuggable binary?
      Since:
      4.3
    • setDebuggable

      public void setDebuggable(boolean debuggable)
      Create a debuggable binary?
      Since:
      4.3
    • getSource

      The source object files to be passed to the linker.
    • setSource

      public void setSource(FileCollection source)
    • 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()