Package net.kyori.indra
Class JavaToolchainVersions
- java.lang.Object
-
- net.kyori.indra.JavaToolchainVersions
-
public class JavaToolchainVersions extends Object
Options configuring Java toolchain versioning.- Since:
- 1.1.0
-
-
Constructor Summary
Constructors Constructor Description JavaToolchainVersions(org.gradle.api.model.ObjectFactory objects, org.gradle.api.provider.ProviderFactory providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull org.gradle.api.provider.Provider<Integer>actualVersion()The version that should be used to run compile tasks, taking into account strict version and current JVM.@NonNull org.gradle.api.provider.Property<Integer>minimumToolchain()The minimum toolchain version to use when building.voidminimumToolchain(int minimumToolchain)@NonNull org.gradle.api.provider.Property<Boolean>previewFeaturesEnabled()Whether to enable Java preview features on compile, test, and execution tasks.voidpreviewFeaturesEnabled(boolean previewFeaturesEnabled)@NonNull org.gradle.api.provider.Property<Boolean>strictVersions()Whether to strictly apply toolchain versions.voidstrictVersions(boolean strictVersions)@NonNull org.gradle.api.provider.Property<Integer>target()The target Java version to compile for.voidtarget(int target)Set the target to compile Java for.@NonNull org.gradle.api.provider.SetProperty<Integer>testWith()Toolchains that should be used to execute tests when strict versions are enabled.voidtestWith(int... testVersions)Add alternate versions that should be tested with, when strict versions are enabled.
-
-
-
Method Detail
-
target
public @NonNull org.gradle.api.provider.Property<Integer> target()
The target Java version to compile for.Default: 8
- Returns:
- a property providing the target version
- Since:
- 1.1.1
-
target
public void target(int target)
Set the target to compile Java for.- Parameters:
target- the java compile target
-
minimumToolchain
public @NonNull org.gradle.api.provider.Property<Integer> minimumToolchain()
The minimum toolchain version to use when building.Default: 11
- Returns:
- A property providing the minimum toolchain version
-
minimumToolchain
public void minimumToolchain(int minimumToolchain)
-
strictVersions
public @NonNull org.gradle.api.provider.Property<Boolean> strictVersions()
Whether to strictly apply toolchain versions.If this is set to
false, java toolchains will only be overridden for the Gradle JVM's version is less than the target version, and cross-version testing will not be performed.Default:
falseunless theCIenvironment variable orstrictMultireleaseVersionsgradle property are set.
-
strictVersions
public void strictVersions(boolean strictVersions)
-
testWith
public @NonNull org.gradle.api.provider.SetProperty<Integer> testWith()
Toolchains that should be used to execute tests when strict versions are enabled.
-
testWith
public void testWith(int... testVersions)
Add alternate versions that should be tested with, when strict versions are enabled.
-
previewFeaturesEnabled
public @NonNull org.gradle.api.provider.Property<Boolean> previewFeaturesEnabled()
Whether to enable Java preview features on compile, test, and execution tasks.- Returns:
- a property providing preview feature enabled state
-
previewFeaturesEnabled
public void previewFeaturesEnabled(boolean previewFeaturesEnabled)
-
actualVersion
public @NonNull org.gradle.api.provider.Provider<Integer> actualVersion()
The version that should be used to run compile tasks, taking into account strict version and current JVM.- Returns:
- a provider resolving the actual Java toolchain version to use
-
-