Package net.kyori.indra.internal
Class JavaToolchainVersionsImpl
java.lang.Object
net.kyori.indra.internal.JavaToolchainVersionsImpl
- All Implemented Interfaces:
JavaToolchainVersions
-
Constructor Summary
ConstructorsConstructorDescriptionJavaToolchainVersionsImpl(org.gradle.api.model.ObjectFactory objects, org.gradle.api.provider.ProviderFactory providers) -
Method Summary
Modifier and TypeMethodDescription@NotNull org.gradle.api.provider.Provider<Integer>The version that should be used to run compile tasks, taking into account strict version and current JVM.@NotNull org.gradle.api.provider.Property<Integer>The minimum toolchain version to use when building.voidminimumToolchain(int minimumToolchain) Sets the minimum toolchain version.@NotNull org.gradle.api.provider.Property<Boolean>Whether to enable Java preview features on compile, test, and execution tasks.voidpreviewFeaturesEnabled(boolean previewFeaturesEnabled) Set whether Java preview features are enabled on compile, test, and execution tasks.@NotNull org.gradle.api.provider.Property<Boolean>Whether to strictly apply toolchain versions.voidstrictVersions(boolean strictVersions) @NotNull org.gradle.api.provider.Property<Integer>target()The target Java version to compile for.voidtarget(int target) Set the target to compile Java for.@NotNull 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.
-
Constructor Details
-
JavaToolchainVersionsImpl
@Inject public JavaToolchainVersionsImpl(org.gradle.api.model.ObjectFactory objects, org.gradle.api.provider.ProviderFactory providers)
-
-
Method Details
-
target
Description copied from interface:JavaToolchainVersionsThe target Java version to compile for.Default: 8
- Specified by:
targetin interfaceJavaToolchainVersions- Returns:
- a property providing the target version
-
target
public void target(int target) Description copied from interface:JavaToolchainVersionsSet the target to compile Java for.- Specified by:
targetin interfaceJavaToolchainVersions- Parameters:
target- the java compile target
-
minimumToolchain
Description copied from interface:JavaToolchainVersionsThe minimum toolchain version to use when building.Default: 11
- Specified by:
minimumToolchainin interfaceJavaToolchainVersions- Returns:
- a property providing the minimum toolchain version
-
minimumToolchain
public void minimumToolchain(int minimumToolchain) Description copied from interface:JavaToolchainVersionsSets the minimum toolchain version.- Specified by:
minimumToolchainin interfaceJavaToolchainVersions- Parameters:
minimumToolchain- the minimum toolchain version
-
strictVersions
Description copied from interface:JavaToolchainVersionsWhether 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.- Specified by:
strictVersionsin interfaceJavaToolchainVersions- Returns:
- whether strict versions are enabled
-
strictVersions
public void strictVersions(boolean strictVersions) - Specified by:
strictVersionsin interfaceJavaToolchainVersions
-
testWith
Description copied from interface:JavaToolchainVersionsToolchains that should be used to execute tests when strict versions are enabled.- Specified by:
testWithin interfaceJavaToolchainVersions- Returns:
- a property containing the versions to test with
-
testWith
public void testWith(int... testVersions) Description copied from interface:JavaToolchainVersionsAdd alternate versions that should be tested with, when strict versions are enabled.- Specified by:
testWithin interfaceJavaToolchainVersions- Parameters:
testVersions- versions to test with
-
previewFeaturesEnabled
Description copied from interface:JavaToolchainVersionsWhether to enable Java preview features on compile, test, and execution tasks.- Specified by:
previewFeaturesEnabledin interfaceJavaToolchainVersions- Returns:
- a property providing preview feature enabled state
-
previewFeaturesEnabled
public void previewFeaturesEnabled(boolean previewFeaturesEnabled) Description copied from interface:JavaToolchainVersionsSet whether Java preview features are enabled on compile, test, and execution tasks.- Specified by:
previewFeaturesEnabledin interfaceJavaToolchainVersions- Parameters:
previewFeaturesEnabled- whether to enable preview features
-
actualVersion
Description copied from interface:JavaToolchainVersionsThe version that should be used to run compile tasks, taking into account strict version and current JVM.- Specified by:
actualVersionin interfaceJavaToolchainVersions- Returns:
- a provider resolving the actual Java toolchain version to use
-