SettingsExtension

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

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.

Public functions

compileSdkAddon

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

execution

fun execution(action: @ExtensionFunctionType Execution.() -> Unit): Unit

Set execution profiles and options for tools.

Public properties

addOnName

val addOnNameString?

Value set via compileSdkAddon

addOnVendor

val addOnVendorString?

Value set via compileSdkAddon

addOnVersion

val addOnVersionInt?

Value set via compileSdkAddon

buildToolsVersion

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

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

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

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

val executionExecution

Set execution profiles and options for tools.

minSdk

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

var minSdkPreviewString?

ndkPath

var ndkPathString?

Requires the specified path to NDK be used.

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

ndkVersion

var ndkVersionString

Requires the specified NDK version to be used.

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