CompileOptions

interface CompileOptions
com.android.build.api.dsl.CompileOptions

Java compilation options.

Summary

Public methods

abstract Unit
sourceCompatibility(sourceCompatibility: Any)

Language level of the java source code.

abstract Unit
targetCompatibility(targetCompatibility: Any)

Version of the generated Java bytecode.

Properties

abstract String

Java source files encoding.

abstract Boolean

Whether core library desugaring is enabled.

abstract JavaVersion

Language level of the java source code.

abstract JavaVersion

Version of the generated Java bytecode.

Public methods

sourceCompatibility

@Incubating abstract fun sourceCompatibility(sourceCompatibility: Any): Unit

Language level of the java source code.

Similar to what Gradle Java plugin uses. Formats supported are:

  • "1.6"
  • 1.6
  • JavaVersion.Version_1_6
  • "Version_1_6"

targetCompatibility

@Incubating abstract fun targetCompatibility(targetCompatibility: Any): Unit

Version of the generated Java bytecode.

Similar to what Gradle Java plugin uses. Formats supported are:

  • "1.6"
  • 1.6
  • JavaVersion.Version_1_6
  • "Version_1_6"

Properties

encoding

abstract var encoding: String

Java source files encoding.

isCoreLibraryDesugaringEnabled

abstract var isCoreLibraryDesugaringEnabled: Boolean

Whether core library desugaring is enabled.

sourceCompatibility

abstract var sourceCompatibility: JavaVersion

Language level of the java source code.

Similar to what Gradle Java plugin uses. Formats supported are:

  • "1.6"
  • 1.6
  • JavaVersion.Version_1_6
  • "Version_1_6"

targetCompatibility

abstract var targetCompatibility: JavaVersion

Version of the generated Java bytecode.

Similar to what Gradle Java plugin uses. Formats supported are:

  • "1.6"
  • 1.6
  • JavaVersion.Version_1_6
  • "Version_1_6"