Interface KotlinJvmCompile

  • All Implemented Interfaces:
    kotlin.Comparable , org.gradle.api.Named , org.gradle.api.Task , org.gradle.api.plugins.ExtensionAware , org.gradle.api.tasks.util.PatternFilterable , org.jetbrains.kotlin.gradle.dsl.KotlinCompile , org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile , org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask , org.jetbrains.kotlin.gradle.tasks.KotlinCompileTool , org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain

    
    public interface KotlinJvmCompile
     implements BaseKotlinCompile, KotlinCompile<KotlinJvmOptions>, KotlinCompilationTask<KotlinJvmCompilerOptions>, UsesKotlinJavaToolchain
                        

    Represents a Kotlin task compiling given Kotlin sources into JVM class files.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Property<JvmTargetValidationMode> getJvmTargetValidationMode() Controls JVM target validation mode between this task and the Java compilation task from Gradle for the same source set.
      • Methods inherited from class org.jetbrains.kotlin.gradle.tasks.KotlinCompileTool

        getDestinationDirectory, getExcludes, getIncludes, getLibraries, getSources, setSource, source
      • Methods inherited from class org.gradle.api.tasks.util.PatternFilterable

        exclude, exclude, exclude, exclude, include, include, include, include, setExcludes, setIncludes
      • Methods inherited from class kotlin.Comparable

        compareTo
      • Methods inherited from class org.gradle.api.plugins.ExtensionAware

        getExtensions
      • Methods inherited from class org.gradle.api.Task

        configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, doNotTrackState, finalizedBy, getActions, getAnt, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, notCompatibleWithConfigurationCache, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
      • Methods inherited from class org.jetbrains.kotlin.gradle.dsl.KotlinCompile

        getKotlinOptions, kotlinOptions, kotlinOptions
      • Methods inherited from class org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

        compilerOptions, compilerOptions, getCompilerOptions
      • Methods inherited from class org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile

        getFriendPaths, getMultiPlatformEnabled, getPluginClasspath, getPluginOptions, getSourceSetName, getUseModuleDetection
      • Methods inherited from class org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain

        getKotlinJavaToolchain, getKotlinJavaToolchainProvider
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getJvmTargetValidationMode

        @Input() abstract Property<JvmTargetValidationMode> getJvmTargetValidationMode()

        Controls JVM target validation mode between this task and the Java compilation task from Gradle for the same source set.

        Using the same JVM targets ensures that the produced JAR file contains class files of the same JVM bytecode version, which is important to avoid compatibility issues for users of your code.

        The Gradle Java compilation task org.gradle.api.tasks.compile.JavaCompile.targetCompatibility controls the value of the org.gradle.jvm.version attribute which itself controls the produced artifact's minimum supported JVM version via Gradle Module Metadata. This allows Gradle to check the compatibility of dependencies at dependency resolution time.

        To avoid problems with different targets, we advise using the JVM Toolchain feature.

        The default value for builds with Gradle <8.0 is JvmTargetValidationMode.WARNING, while for builds with Gradle 8.0+ it is JvmTargetValidationMode.ERROR.

        Since:

        1.9.0