Class JextractGenerateTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
de.infolektuell.gradle.jextract.tasks.JextractBaseTask
de.infolektuell.gradle.jextract.tasks.JextractGenerateTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class JextractGenerateTask extends JextractBaseTask
Task that uses Jextract to generate Java bindings for given C headers
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.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
    Used by Gradle
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final void
    Task action that uses Jextract to generate Java bindings
    abstract org.gradle.api.file.RegularFileProperty
    An optional arg file for includes filtering
    abstract org.gradle.api.file.DirectoryProperty
    The directory where to place generated compiled class files
    abstract org.gradle.api.provider.ListProperty<@NonNull String>
    All macros defined for this library, conforming to the name=value pattern or name where value will be 1
    protected abstract org.gradle.api.file.FileSystemOperations
    Inject the build service for file system operations.
    abstract org.gradle.api.provider.Property<@NonNull Boolean>
    Generate source files instead of class files (Jextract 21 and below)
    abstract org.gradle.api.provider.Property<@NonNull String>
    Name of the generated header class (derived from header file name if missing)
    abstract org.gradle.api.provider.ListProperty<@NonNull String>
    Native libraries to be loaded by generated code (either names or paths starting with colon)
    abstract org.gradle.api.file.DirectoryProperty
    The directory where to place the generated source files
    abstract org.gradle.api.provider.Property<@NonNull String>
    The package name for the generated classes (unnamed if missing).
    abstract org.gradle.api.provider.Property<@NonNull Boolean>
    Load libraries in the library symbol lookup, using either System.load or System.loadLibrary, useful for libraries in java.library.path
    abstract org.gradle.api.provider.MapProperty<@NonNull String, @NonNull Set<String>>
    All symbols to be included in the generated bindings, grouped by their category The key of each entry denotes a category, the value is a list of symbols.

    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, 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 Object

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

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • JextractGenerateTask

      public JextractGenerateTask()
      Used by Gradle
  • Method Details

    • getDefinedMacros

      @Input public abstract org.gradle.api.provider.ListProperty<@NonNull String> getDefinedMacros()
      All macros defined for this library, conforming to the name=value pattern or name where value will be 1
      Returns:
      A list property to add defined macros
    • getTargetPackage

      @Optional @Input public abstract org.gradle.api.provider.Property<@NonNull String> getTargetPackage()
      The package name for the generated classes (unnamed if missing).
      Returns:
      A property to configure the package name
    • getHeaderClassName

      @Optional @Input public abstract org.gradle.api.provider.Property<@NonNull String> getHeaderClassName()
      Name of the generated header class (derived from header file name if missing)
      Returns:
      a property to configure the header name
    • getWhitelist

      @Input public abstract org.gradle.api.provider.MapProperty<@NonNull String, @NonNull Set<String>> getWhitelist()
      All symbols to be included in the generated bindings, grouped by their category The key of each entry denotes a category, the value is a list of symbols.
      Returns:
      A map property to add pairs of category and symbols
    • getArgFile

      @Optional @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getArgFile()
      An optional arg file for includes filtering
      Returns:
      a property to configure the file
    • getLibraries

      @Input public abstract org.gradle.api.provider.ListProperty<@NonNull String> getLibraries()
      Native libraries to be loaded by generated code (either names or paths starting with colon)
      Returns:
      A property to add library names
    • getUseSystemLoadLibrary

      @Optional @Input public abstract org.gradle.api.provider.Property<@NonNull Boolean> getUseSystemLoadLibrary()
      Load libraries in the library symbol lookup, using either System.load or System.loadLibrary, useful for libraries in java.library.path
      Returns:
      A boolean property
    • getGenerateSourceFiles

      @Optional @Input public abstract org.gradle.api.provider.Property<@NonNull Boolean> getGenerateSourceFiles()
      Generate source files instead of class files (Jextract 21 and below)
      Returns:
      a boolean property
    • getSources

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getSources()
      The directory where to place the generated source files
      Returns:
      a directory property
    • getClasses

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getClasses()
      The directory where to place generated compiled class files
      Returns:
      a directory property
    • generateBindings

      protected final void generateBindings()
      Task action that uses Jextract to generate Java bindings
    • getFileSystemOperations

      @Inject protected abstract org.gradle.api.file.FileSystemOperations getFileSystemOperations()
      Inject the build service for file system operations.
      Returns:
      The injected build service