Stay organized with collections
Save and categorize content based on your preferences.
CompileOptions
interface CompileOptions
Java compilation options.
Summary
Public methods
|
abstract Unit |
Language level of the java source code.
|
abstract Unit |
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"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# CompileOptions\n==============\n\n```\ninterface CompileOptions\n```\n\n|-----------------------------------------------|\n| [com.android.build.api.dsl.CompileOptions](#) |\n\nJava compilation options.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [sourceCompatibility](#sourceCompatibility(kotlin.Any))`(`sourceCompatibility:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`)` Language level of the java source code. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [targetCompatibility](#targetCompatibility(kotlin.Any))`(`targetCompatibility:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`)` Version of the generated Java bytecode. |\n\n| ### Properties ||\n|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [encoding](#encoding:kotlin.String) Java source files encoding. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isCoreLibraryDesugaringEnabled](#isCoreLibraryDesugaringEnabled:kotlin.Boolean) Whether core library desugaring is enabled. |\n| abstract [JavaVersion](https://docs.gradle.org/current/javadoc/org/gradle/api/JavaVersion.html) | [sourceCompatibility](#sourceCompatibility:org.gradle.api.JavaVersion) Language level of the java source code. |\n| abstract [JavaVersion](https://docs.gradle.org/current/javadoc/org/gradle/api/JavaVersion.html) | [targetCompatibility](#targetCompatibility:org.gradle.api.JavaVersion) Version of the generated Java bytecode. |\n\nPublic methods\n--------------\n\n### sourceCompatibility\n\n```\n@Incubating abstract fun sourceCompatibility(sourceCompatibility: Any): Unit\n```\n\nLanguage level of the java source code.\n\nSimilar to what [Gradle Java plugin](http://www.gradle.org/docs/current/userguide/java_plugin.html)\nuses. Formats supported are:\n\n- `\"1.6\"`\n- `1.6`\n- `JavaVersion.Version_1_6`\n- `\"Version_1_6\"` \n\n### targetCompatibility\n\n```\n@Incubating abstract fun targetCompatibility(targetCompatibility: Any): Unit\n```\n\nVersion of the generated Java bytecode.\n\nSimilar to what [Gradle Java plugin](http://www.gradle.org/docs/current/userguide/java_plugin.html)\nuses. Formats supported are:\n\n- `\"1.6\"`\n- `1.6`\n- `JavaVersion.Version_1_6`\n- `\"Version_1_6\"`\n\nProperties\n----------\n\n### encoding\n\n```\nabstract var encoding: String\n```\n\nJava source files encoding. \n\n### isCoreLibraryDesugaringEnabled\n\n```\nabstract var isCoreLibraryDesugaringEnabled: Boolean\n```\n\nWhether core library desugaring is enabled. \n\n### sourceCompatibility\n\n```\nabstract var sourceCompatibility: JavaVersion\n```\n\nLanguage level of the java source code.\n\nSimilar to what [Gradle Java plugin](http://www.gradle.org/docs/current/userguide/java_plugin.html)\nuses. Formats supported are:\n\n- `\"1.6\"`\n- `1.6`\n- `JavaVersion.Version_1_6`\n- `\"Version_1_6\"` \n\n### targetCompatibility\n\n```\nabstract var targetCompatibility: JavaVersion\n```\n\nVersion of the generated Java bytecode.\n\nSimilar to what [Gradle Java plugin](http://www.gradle.org/docs/current/userguide/java_plugin.html)\nuses. Formats supported are:\n\n- `\"1.6\"`\n- `1.6`\n- `JavaVersion.Version_1_6`\n- `\"Version_1_6\"`"]]