Class JavaToolchainVersionsImpl

java.lang.Object
net.kyori.indra.internal.JavaToolchainVersionsImpl
All Implemented Interfaces:
JavaToolchainVersions

public class JavaToolchainVersionsImpl extends Object implements JavaToolchainVersions
  • Constructor Summary

    Constructors
    Constructor
    Description
    JavaToolchainVersionsImpl(org.gradle.api.model.ObjectFactory objects, org.gradle.api.provider.ProviderFactory providers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @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.
    void
    minimumToolchain(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.
    void
    previewFeaturesEnabled(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.
    void
    strictVersions(boolean strictVersions)
     
    @NotNull org.gradle.api.provider.Property<Integer>
    The target Java version to compile for.
    void
    target(int target)
    Set the target to compile Java for.
    @NotNull org.gradle.api.provider.SetProperty<Integer>
    Toolchains that should be used to execute tests when strict versions are enabled.
    void
    testWith(int... testVersions)
    Add alternate versions that should be tested with, when strict versions are enabled.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JavaToolchainVersionsImpl

      @Inject public JavaToolchainVersionsImpl(org.gradle.api.model.ObjectFactory objects, org.gradle.api.provider.ProviderFactory providers)
  • Method Details

    • target

      @NotNull public @NotNull org.gradle.api.provider.Property<Integer> target()
      Description copied from interface: JavaToolchainVersions
      The target Java version to compile for.

      Default: 8

      Specified by:
      target in interface JavaToolchainVersions
      Returns:
      a property providing the target version
    • target

      public void target(int target)
      Description copied from interface: JavaToolchainVersions
      Set the target to compile Java for.
      Specified by:
      target in interface JavaToolchainVersions
      Parameters:
      target - the java compile target
    • minimumToolchain

      @NotNull public @NotNull org.gradle.api.provider.Property<Integer> minimumToolchain()
      Description copied from interface: JavaToolchainVersions
      The minimum toolchain version to use when building.

      Default: 11

      Specified by:
      minimumToolchain in interface JavaToolchainVersions
      Returns:
      a property providing the minimum toolchain version
    • minimumToolchain

      public void minimumToolchain(int minimumToolchain)
      Description copied from interface: JavaToolchainVersions
      Sets the minimum toolchain version.
      Specified by:
      minimumToolchain in interface JavaToolchainVersions
      Parameters:
      minimumToolchain - the minimum toolchain version
    • strictVersions

      @NotNull public @NotNull org.gradle.api.provider.Property<Boolean> strictVersions()
      Description copied from interface: JavaToolchainVersions
      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: false unless the CI environment variable or strictMultireleaseVersions gradle property are set.

      Specified by:
      strictVersions in interface JavaToolchainVersions
      Returns:
      whether strict versions are enabled
    • strictVersions

      public void strictVersions(boolean strictVersions)
      Specified by:
      strictVersions in interface JavaToolchainVersions
    • testWith

      @NotNull public @NotNull org.gradle.api.provider.SetProperty<Integer> testWith()
      Description copied from interface: JavaToolchainVersions
      Toolchains that should be used to execute tests when strict versions are enabled.
      Specified by:
      testWith in interface JavaToolchainVersions
      Returns:
      a property containing the versions to test with
    • testWith

      public void testWith(int... testVersions)
      Description copied from interface: JavaToolchainVersions
      Add alternate versions that should be tested with, when strict versions are enabled.
      Specified by:
      testWith in interface JavaToolchainVersions
      Parameters:
      testVersions - versions to test with
    • previewFeaturesEnabled

      @NotNull public @NotNull org.gradle.api.provider.Property<Boolean> previewFeaturesEnabled()
      Description copied from interface: JavaToolchainVersions
      Whether to enable Java preview features on compile, test, and execution tasks.
      Specified by:
      previewFeaturesEnabled in interface JavaToolchainVersions
      Returns:
      a property providing preview feature enabled state
    • previewFeaturesEnabled

      public void previewFeaturesEnabled(boolean previewFeaturesEnabled)
      Description copied from interface: JavaToolchainVersions
      Set whether Java preview features are enabled on compile, test, and execution tasks.
      Specified by:
      previewFeaturesEnabled in interface JavaToolchainVersions
      Parameters:
      previewFeaturesEnabled - whether to enable preview features
    • actualVersion

      @NotNull public @NotNull org.gradle.api.provider.Provider<Integer> actualVersion()
      Description copied from interface: JavaToolchainVersions
      The version that should be used to run compile tasks, taking into account strict version and current JVM.
      Specified by:
      actualVersion in interface JavaToolchainVersions
      Returns:
      a provider resolving the actual Java toolchain version to use