Class LibraryHandler

java.lang.Object
de.infolektuell.gradle.jextract.extensions.LibraryHandler
All Implemented Interfaces:
org.gradle.api.Named

public abstract class LibraryHandler extends Object implements org.gradle.api.Named
A configuration for a library to be generated by Jextract
  • Nested Class Summary

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

    org.gradle.api.Named.Namer
  • Constructor Summary

    Constructors
    Constructor
    Description
    Used by Gradle
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dependencies(org.gradle.api.Action<? super @NonNull JextractLibraryDependencies> action)
    Configurable dependencies block
    abstract org.gradle.api.provider.ListProperty<@NonNull String>
    Macros to be defined, in the format name=value
    Configurable dependencies for this library
    The name of the task that dumps the includes for this library
    The name of the task that generates the bindings for this library
    abstract org.gradle.api.provider.Property<@NonNull Boolean>
    Generate source files instead of class files (Jextract 21 and below)
    abstract org.gradle.api.file.RegularFileProperty
    The header file to generate bindings for
    abstract org.gradle.api.provider.Property<@NonNull String>
    The name for the class generated from the header file, derived from the header file if missing
    abstract org.gradle.api.provider.ListProperty<@NonNull org.gradle.api.file.Directory>
    Additional directories where Jextract and Jmod should search for header files
    abstract org.gradle.api.provider.ListProperty<@NonNull org.gradle.api.file.Directory>
    Directories containing legal notice documents, to be included in the JMOD archive
    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.provider.ListProperty<@NonNull org.gradle.api.file.Directory>
    Additional directories where Jmod should search for native runtime binaries
    abstract org.gradle.api.file.DirectoryProperty
    specify the directory to place generated files.
    abstract org.gradle.api.provider.Property<@NonNull String>
    The package name for the generated code
    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
    List of definitions to be included
    final void
    whitelist(org.gradle.api.Action<? super @NonNull WhitelistHandler> action)
    Configurable block for the included definitions

    Methods inherited from class Object

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

    Methods inherited from interface org.gradle.api.Named

    getName
  • Constructor Details

    • LibraryHandler

      public LibraryHandler()
      Used by Gradle
  • Method Details

    • getDependencies

      public abstract JextractLibraryDependencies getDependencies()
      Configurable dependencies for this library
      Returns:
      A DSL object where dependencies can be added
    • dependencies

      public void dependencies(org.gradle.api.Action<? super @NonNull JextractLibraryDependencies> action)
      Configurable dependencies block
      Parameters:
      action - The action to be applied to the dependencies object
    • getHeader

      public abstract org.gradle.api.file.RegularFileProperty getHeader()
      The header file to generate bindings for
      Returns:
      A property to configure the header file
    • getIncludes

      public abstract org.gradle.api.provider.ListProperty<@NonNull org.gradle.api.file.Directory> getIncludes()
      Additional directories where Jextract and Jmod should search for header files
      Returns:
      A property to add more include directories
    • getLibraryPath

      public abstract org.gradle.api.provider.ListProperty<@NonNull org.gradle.api.file.Directory> getLibraryPath()
      Additional directories where Jmod should search for native runtime binaries
      Returns:
      A property to add more library search directories
    • getLegalNotices

      public abstract org.gradle.api.provider.ListProperty<@NonNull org.gradle.api.file.Directory> getLegalNotices()
      Directories containing legal notice documents, to be included in the JMOD archive
      Returns:
      A property to add legal documents directories
    • getDefinedMacros

      public abstract org.gradle.api.provider.ListProperty<@NonNull String> getDefinedMacros()
      Macros to be defined, in the format name=value
      Returns:
      A property to add defined macros
    • getTargetPackage

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

      public abstract org.gradle.api.provider.Property<@NonNull String> getHeaderClassName()
      The name for the class generated from the header file, derived from the header file if missing
      Returns:
      A property to configure the header class name
    • getWhitelist

      public abstract WhitelistHandler getWhitelist()
      List of definitions to be included
      Returns:
      A list handler to configure the include definitions
    • whitelist

      public final void whitelist(org.gradle.api.Action<? super @NonNull WhitelistHandler> action)
      Configurable block for the included definitions
      Parameters:
      action - The configuration action to be applied to the white-list
    • getLibraries

      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

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

      public abstract org.gradle.api.file.DirectoryProperty getOutput()
      specify the directory to place generated files.
      Returns:
      a property to configure the output directory
    • getGenerateSourceFiles

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

      public String getGenerateBindingsTaskName()
      The name of the task that generates the bindings for this library
      Returns:
      The task name
    • getDumpIncludesTaskName

      public String getDumpIncludesTaskName()
      The name of the task that dumps the includes for this library
      Returns:
      The task name