SettingsExtension

Added in 7.4.1

interface SettingsExtension


Interface used for the android DSL in the settings.gradle[.kts] file, after the com.android.settings plugin is applied.

This allows settings default values that are then applied to all android projects which this build.

Summary

Public functions

Unit
compileSdkAddon(vendor: String, name: String, version: Int)
Unit
execution(action: Execution.() -> Unit)

Set execution profiles and options for tools.

Public properties

String?

Value set via compileSdkAddon

String?

Value set via compileSdkAddon

Int?

Value set via compileSdkAddon

String

Specifies the version of the SDK Build Tools to use when building your project.

Int?

Specifies the API level to compile your project against.

Int?

Specifies the SDK Extension level to compile your project against.

String?

Specify a preview API to compile your project against.

Execution

Set execution profiles and options for tools.

Int?

The minimum SDK version.

String?
String?

Requires the specified path to NDK be used.

String

Requires the specified NDK version to be used.

Int?

The target SDK version.

String?

The target SDK version.

Public functions

compileSdkAddon

Added in 7.4.1
fun compileSdkAddon(vendor: String, name: String, version: Int): Unit

execution

Added in 7.4.1
fun execution(action: Execution.() -> Unit): Unit

Set execution profiles and options for tools.

Public properties

addOnName

Added in 7.4.1
val addOnNameString?

Value set via compileSdkAddon

addOnVendor

Added in 7.4.1
val addOnVendorString?

Value set via compileSdkAddon

addOnVersion

Added in 7.4.1
val addOnVersionInt?

Value set via compileSdkAddon

buildToolsVersion

Added in 7.4.1
var buildToolsVersionString

Specifies the version of the SDK Build Tools to use when building your project.

See com.android.build.api.dsl.CommonExtension.buildToolsVersion for more information

compileSdk

Added in 7.4.1
var compileSdkInt?

Specifies the API level to compile your project against. The Android plugin requires you to configure this property.

This means your code can use only the Android APIs included in that API level and lower. You can configure the compile sdk version by adding the following to the android block: compileSdk = 26.

You should generally use the most up-to-date API level available. If you are planning to also support older API levels, it's good practice to use the Lint tool to check if you are using APIs that are not available in earlier API levels.

The value you assign to this property is parsed and stored in a normalized form, so reading it back may return a slightly different value.

compileSdkExtension

Added in 7.4.1
var compileSdkExtensionInt?

Specifies the SDK Extension level to compile your project against. This value is optional.

When not provided the base extension for the given compileSdk API level will be selected.

compileSdkPreview

Added in 7.4.1
var compileSdkPreviewString?

Specify a preview API to compile your project against.

For example, to try out the Android S preview, rather than compileSdk = 30 you can use compileSdkPreview = "S"

Once the preview APIs are finalized, they will be allocated a stable integer value.

execution

Added in 7.4.1
val executionExecution

Set execution profiles and options for tools.

minSdk

Added in 7.4.1
var minSdkInt?

The minimum SDK version. Setting this it will override previous calls of minSdk and minSdkPreview setters. Only one of minSdk and minSdkPreview should be set.

See uses-sdk element documentation.

minSdkPreview

Added in 7.4.1
var minSdkPreviewString?

ndkPath

Added in 7.4.1
var ndkPathString?

Requires the specified path to NDK be used.

See com.android.build.api.dsl.CommonExtension.ndkPath for more information

ndkVersion

Added in 7.4.1
var ndkVersionString

Requires the specified NDK version to be used.

See com.android.build.api.dsl.CommonExtension.ndkVersion for more information

targetSdk

Added in 8.9.0-alpha07
var targetSdkInt?

The target SDK version. Setting this it will override previous calls of targetSdk and targetSdkPreview setters. Only one of targetSdk and targetSdkPreview should be set.

See uses-sdk element documentation.

targetSdkPreview

Added in 8.9.0-alpha07
var targetSdkPreviewString?

The target SDK version. Setting this it will override previous calls of targetSdk and targetSdkPreview setters. Only one of targetSdk and targetSdkPreview should be set.

See uses-sdk element documentation.