Interface NativeImageOptions
-
- All Superinterfaces:
org.gradle.api.Named
- All Known Implementing Classes:
BaseNativeImageOptions
,DeprecatedNativeImageOptions
public interface NativeImageOptions extends org.gradle.api.Named
Class that declares native image options.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
agent(org.gradle.api.Action<? super DeprecatedAgentOptions> spec)
NativeImageOptions
buildArgs(java.lang.Iterable<?> buildArgs)
Adds arguments for the native-image invocation.NativeImageOptions
buildArgs(java.lang.Object... buildArgs)
Adds arguments for the native-image invocation.NativeImageOptions
classpath(java.lang.Object... paths)
Adds elements to the classpath for the native-image building.DeprecatedAgentOptions
getAgent()
org.gradle.api.provider.ListProperty<java.lang.String>
getBuildArgs()
Returns the arguments for the native-image invocation.org.gradle.api.file.ConfigurableFileCollection
getClasspath()
Returns the classpath for the native-image building.org.gradle.api.file.ConfigurableFileCollection
getConfigurationFileDirectories()
Returns the list of configuration file directories (e.g.org.gradle.api.provider.Property<java.lang.Boolean>
getDebug()
Gets the value which toggles native-image debug symbol output.org.gradle.api.provider.MapProperty<java.lang.String,java.lang.Object>
getEnvironmentVariables()
Returns the environment variables which will be used by the native-image builder process.org.gradle.api.provider.MapProperty<java.lang.Object,java.util.List<java.lang.String>>
getExcludeConfig()
Returns the MapProperty that contains information about configuration that should be excluded during image building.org.gradle.api.provider.ListProperty<java.lang.String>
getExcludeConfigArgs()
org.gradle.api.provider.Property<java.lang.Boolean>
getFallback()
org.gradle.api.provider.Property<java.lang.String>
getImageName()
Gets the name of the native executable to be generated.org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher>
getJavaLauncher()
Returns the toolchain used to invoke native-image.org.gradle.api.provider.ListProperty<java.lang.String>
getJvmArgs()
Returns the extra arguments to use when launching the JVM for the native-image building process.org.gradle.api.provider.Property<java.lang.String>
getMainClass()
Returns the fully qualified name of the Main class to be executed.java.lang.String
getName()
org.gradle.api.provider.Property<java.lang.Boolean>
getQuickBuild()
Gets the value which determines if image is being built in quick build mode.NativeResourcesOptions
getResources()
org.gradle.api.provider.Property<java.lang.Boolean>
getRichOutput()
Gets the value which determines if image is being built with rich output.org.gradle.api.provider.ListProperty<java.lang.String>
getRuntimeArgs()
Returns the arguments to use when launching the built image.org.gradle.api.provider.Property<java.lang.Boolean>
getSharedLibrary()
Gets the value which determines if shared library is being built.org.gradle.api.provider.MapProperty<java.lang.String,java.lang.Object>
getSystemProperties()
Returns the system properties which will be used by the native-image builder process.org.gradle.api.provider.Property<java.lang.Boolean>
getUseFatJar()
If set to true, this will build a fat jar of the image classpath instead of passing each jar individually to the classpath.org.gradle.api.provider.Property<java.lang.Boolean>
getVerbose()
Gets the value which toggles native-image verbose output.NativeImageOptions
jvmArgs(java.lang.Iterable<?> arguments)
Adds some arguments to use when launching the JVM for the native-image building process.NativeImageOptions
jvmArgs(java.lang.Object... arguments)
Adds some arguments to use when launching the JVM for the native-image building process.void
resources(org.gradle.api.Action<? super NativeResourcesOptions> spec)
NativeImageOptions
runtimeArgs(java.lang.Iterable<?> arguments)
Adds some arguments to use when launching the built image.NativeImageOptions
runtimeArgs(java.lang.Object... arguments)
Adds some arguments to use when launching the built image.NativeImageOptions
systemProperties(java.util.Map<java.lang.String,?> properties)
Adds some system properties to be used by the native-image builder process.NativeImageOptions
systemProperty(java.lang.String name, java.lang.Object value)
Adds a system property to be used by the native-image builder process.
-
-
-
Method Detail
-
getName
@Internal java.lang.String getName()
- Specified by:
getName
in interfaceorg.gradle.api.Named
-
getImageName
@Input org.gradle.api.provider.Property<java.lang.String> getImageName()
Gets the name of the native executable to be generated.- Returns:
- The image name property.
-
getMainClass
@Input @Optional org.gradle.api.provider.Property<java.lang.String> getMainClass()
Returns the fully qualified name of the Main class to be executed.This does not need to be set if using an Executable Jar with a
Main-Class
attribute.- Returns:
- mainClass The main class.
-
getBuildArgs
@Input org.gradle.api.provider.ListProperty<java.lang.String> getBuildArgs()
Returns the arguments for the native-image invocation.- Returns:
- Arguments for the native-image invocation.
-
getSystemProperties
@Input org.gradle.api.provider.MapProperty<java.lang.String,java.lang.Object> getSystemProperties()
Returns the system properties which will be used by the native-image builder process.- Returns:
- The system properties. Returns an empty map when there are no system properties.
-
getEnvironmentVariables
@Input org.gradle.api.provider.MapProperty<java.lang.String,java.lang.Object> getEnvironmentVariables()
Returns the environment variables which will be used by the native-image builder process.- Returns:
- the environment variables. Returns an empty map when there are no environment variables.
- Since:
- 0.9.14
-
getClasspath
@InputFiles @Classpath org.gradle.api.file.ConfigurableFileCollection getClasspath()
Returns the classpath for the native-image building.- Returns:
- classpath The classpath for the native-image building.
-
getJvmArgs
@Input org.gradle.api.provider.ListProperty<java.lang.String> getJvmArgs()
Returns the extra arguments to use when launching the JVM for the native-image building process. Does not include system properties and the minimum/maximum heap size.- Returns:
- The arguments. Returns an empty list if there are no arguments.
-
getRuntimeArgs
@Input org.gradle.api.provider.ListProperty<java.lang.String> getRuntimeArgs()
Returns the arguments to use when launching the built image.- Returns:
- The arguments. Returns an empty list if there are no arguments.
-
getDebug
@Input org.gradle.api.provider.Property<java.lang.Boolean> getDebug()
Gets the value which toggles native-image debug symbol output.- Returns:
- Is debug enabled
-
getFallback
@Input org.gradle.api.provider.Property<java.lang.Boolean> getFallback()
- Returns:
- Whether to enable fallbacks (defaults to false).
-
getVerbose
@Input org.gradle.api.provider.Property<java.lang.Boolean> getVerbose()
Gets the value which toggles native-image verbose output.- Returns:
- Is verbose output
-
getSharedLibrary
@Input org.gradle.api.provider.Property<java.lang.Boolean> getSharedLibrary()
Gets the value which determines if shared library is being built.- Returns:
- The value which determines if shared library is being built.
-
getQuickBuild
@Input org.gradle.api.provider.Property<java.lang.Boolean> getQuickBuild()
Gets the value which determines if image is being built in quick build mode.- Returns:
- The value which determines if image is being built in quick build mode.
-
getRichOutput
@Input org.gradle.api.provider.Property<java.lang.Boolean> getRichOutput()
Gets the value which determines if image is being built with rich output.- Returns:
- The value which determines if image is being built with rich output.
-
getJavaLauncher
@Optional org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher> getJavaLauncher()
Returns the toolchain used to invoke native-image. Currently pointing to a Java launcher due to Gradle limitations.- Returns:
- the detected java launcher
-
getConfigurationFileDirectories
@InputFiles org.gradle.api.file.ConfigurableFileCollection getConfigurationFileDirectories()
Returns the list of configuration file directories (e.g. resource-config.json, ...) which need to be passed to native-image.- Returns:
- a collection of directories
-
getExcludeConfig
@Input org.gradle.api.provider.MapProperty<java.lang.Object,java.util.List<java.lang.String>> getExcludeConfig()
Returns the MapProperty that contains information about configuration that should be excluded during image building. It consists of a dependency coordinates and a list of regular expressions that match resources that should be excluded as a value.- Returns:
- a map of filters for configuration exclusion
-
getResources
NativeResourcesOptions getResources()
-
resources
void resources(org.gradle.api.Action<? super NativeResourcesOptions> spec)
-
buildArgs
NativeImageOptions buildArgs(java.lang.Object... buildArgs)
Adds arguments for the native-image invocation.- Parameters:
buildArgs
- Arguments for the native-image invocation.- Returns:
- this
-
buildArgs
NativeImageOptions buildArgs(java.lang.Iterable<?> buildArgs)
Adds arguments for the native-image invocation.- Parameters:
buildArgs
- Arguments for the native-image invocation.- Returns:
- this
-
systemProperties
NativeImageOptions systemProperties(java.util.Map<java.lang.String,?> properties)
Adds some system properties to be used by the native-image builder process.- Parameters:
properties
- The system properties. Must not be null.- Returns:
- this
-
systemProperty
NativeImageOptions systemProperty(java.lang.String name, java.lang.Object value)
Adds a system property to be used by the native-image builder process.- Parameters:
name
- The name of the propertyvalue
- The value for the property. May be null.- Returns:
- this
-
classpath
NativeImageOptions classpath(java.lang.Object... paths)
Adds elements to the classpath for the native-image building.- Parameters:
paths
- The classpath elements.- Returns:
- this
-
jvmArgs
NativeImageOptions jvmArgs(java.lang.Object... arguments)
Adds some arguments to use when launching the JVM for the native-image building process.- Parameters:
arguments
- The arguments.- Returns:
- this
-
jvmArgs
NativeImageOptions jvmArgs(java.lang.Iterable<?> arguments)
Adds some arguments to use when launching the JVM for the native-image building process.- Parameters:
arguments
- The arguments. Must not be null.- Returns:
- this
-
runtimeArgs
NativeImageOptions runtimeArgs(java.lang.Object... arguments)
Adds some arguments to use when launching the built image.- Parameters:
arguments
- The arguments.- Returns:
- this
-
runtimeArgs
NativeImageOptions runtimeArgs(java.lang.Iterable<?> arguments)
Adds some arguments to use when launching the built image.- Parameters:
arguments
- The arguments. Must not be null.- Returns:
- this
-
getUseFatJar
@Input org.gradle.api.provider.Property<java.lang.Boolean> getUseFatJar()
If set to true, this will build a fat jar of the image classpath instead of passing each jar individually to the classpath. This option can be used in case the classpath is too long and that invoking native image fails, which can happen on Windows.- Returns:
- true if a fatjar should be used. Defaults to true for Windows, and false otherwise.
-
getAgent
DeprecatedAgentOptions getAgent()
-
agent
void agent(org.gradle.api.Action<? super DeprecatedAgentOptions> spec)
-
getExcludeConfigArgs
@Input org.gradle.api.provider.ListProperty<java.lang.String> getExcludeConfigArgs()
-
-