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 ClassesModifier and TypeClassDescriptionstatic interfaceConfiguration parameters for the service -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name that is used to register the build service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.gradle.process.ExecResultExecutes Jextract installed in a custom path with a configurable action
This is intended to be used by tasks.
org.gradle.process.ExecResultexec(org.gradle.jvm.toolchain.JavaLanguageVersion version, org.gradle.api.Action<@NonNull org.gradle.process.ExecSpec> action) Executes Jextractprotected abstract org.gradle.api.file.ArchiveOperationsInject the archive operations service from Gradleprotected org.gradle.api.provider.Provider<@NonNull org.gradle.api.file.Directory> The directory to store downloaded Jextract archives within the cache directoryprotected abstract org.gradle.process.ExecOperationsInject the exec operations service from Gradleprotected abstract org.gradle.api.file.FileSystemOperationsInject the file system operations service from Gradleprotected org.gradle.api.provider.Provider<@NonNull org.gradle.api.file.Directory> The directory to install downloaded Jextract versions within the cache directoryintgetVersion(Path path) Extracts the version of a given local installation, null if this is not installedintgetVersion(org.gradle.jvm.toolchain.JavaLanguageVersion javaLanguageVersion) Finds the best Jextract major version for a given Java language versionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.services.BuildService
getParameters
-
Field Details
-
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
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 installedaction- An exec spec to set command line arguments- Returns:
- The exec result after Jextract was executed
-