Class JextractStore

java.lang.Object
de.infolektuell.gradle.jextract.service.JextractStore
All Implemented Interfaces:
org.gradle.api.services.BuildService<@NonNull JextractStore.Parameters>

public abstract class JextractStore extends Object implements org.gradle.api.services.BuildService<@NonNull JextractStore.Parameters>
A build service that downloads and manages Jextract installation. It can be injected by tasks that have to run Jextract.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Configuration parameters for the service
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name that is used to register the build service
  • Constructor Summary

    Constructors
    Constructor
    Description
    Used by Gradle
  • Method Summary

    Modifier and Type
    Method
    Description
    org.gradle.process.ExecResult
    exec(Path root, org.gradle.api.Action<@NonNull org.gradle.process.ExecSpec> action)

    Executes Jextract installed in a custom path with a configurable action

    This is intended to be used by tasks.

    org.gradle.process.ExecResult
    exec(org.gradle.jvm.toolchain.JavaLanguageVersion version, org.gradle.api.Action<@NonNull org.gradle.process.ExecSpec> action)
    Executes Jextract
    protected abstract org.gradle.api.file.ArchiveOperations
    Inject the archive operations service from Gradle
    protected org.gradle.api.provider.Provider<@NonNull org.gradle.api.file.Directory>
    The directory to store downloaded Jextract archives within the cache directory
    protected abstract org.gradle.process.ExecOperations
    Inject the exec operations service from Gradle
    protected abstract org.gradle.api.file.FileSystemOperations
    Inject the file system operations service from Gradle
    protected org.gradle.api.provider.Provider<@NonNull org.gradle.api.file.Directory>
    The directory to install downloaded Jextract versions within the cache directory
    int
    Extracts the version of a given local installation, null if this is not installed
    int
    getVersion(org.gradle.jvm.toolchain.JavaLanguageVersion javaLanguageVersion)
    Finds the best Jextract major version for a given Java language version

    Methods inherited from class Object

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

    Methods inherited from interface org.gradle.api.services.BuildService

    getParameters
  • Field Details

    • SERVICE_NAME

      public static final String SERVICE_NAME
      The name that is used to register the build service
      See Also:
  • Constructor Details

    • JextractStore

      public JextractStore()
      Used by Gradle
  • Method Details

    • getFileSystem

      @Inject protected abstract org.gradle.api.file.FileSystemOperations getFileSystem()
      Inject the file system operations service from Gradle
      Returns:
      A service instance
    • getArchives

      @Inject protected abstract org.gradle.api.file.ArchiveOperations getArchives()
      Inject the archive operations service from Gradle
      Returns:
      A service instance
    • getExecOperations

      @Inject protected abstract org.gradle.process.ExecOperations getExecOperations()
      Inject the exec operations service from Gradle
      Returns:
      A service instance
    • getDownloadsDir

      protected org.gradle.api.provider.Provider<@NonNull org.gradle.api.file.Directory> getDownloadsDir()
      The directory to store downloaded Jextract archives within the cache directory
      Returns:
      A provider for the directory
    • getInstallDir

      protected org.gradle.api.provider.Provider<@NonNull org.gradle.api.file.Directory> getInstallDir()
      The directory to install downloaded Jextract versions within the cache directory
      Returns:
      A provider for the directory
    • getVersion

      public int getVersion(org.gradle.jvm.toolchain.JavaLanguageVersion javaLanguageVersion)
      Finds the best Jextract major version for a given Java language version
      Parameters:
      javaLanguageVersion - The Java language version to get a matching Jextract version for
      Returns:
      The Jextract version as an integer
    • getVersion

      public int getVersion(Path path)
      Extracts the version of a given local installation, null if this is not installed
      Parameters:
      path - A path that denotes an installation directory
      Returns:
      The Jextract version as an integer
    • exec

      public org.gradle.process.ExecResult exec(org.gradle.jvm.toolchain.JavaLanguageVersion version, org.gradle.api.Action<@NonNull org.gradle.process.ExecSpec> action)

      Executes Jextract

      This is intended to be used by tasks.

      Parameters:
      version - A Java language version that is used to select a matching Jextract installation. If a matching installation is not available, Jextract will be downloaded and installed.
      action - An exec spec to set command line arguments
      Returns:
      The exec result after Jextract was executed
    • exec

      public org.gradle.process.ExecResult exec(Path root, org.gradle.api.Action<@NonNull org.gradle.process.ExecSpec> action)

      Executes Jextract installed in a custom path with a configurable action

      This is intended to be used by tasks.

      Parameters:
      root - The installation directory where Jextract is installed
      action - An exec spec to set command line arguments
      Returns:
      The exec result after Jextract was executed