SettingsExtension

public 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 methods

abstract void
compileSdkAddon(@NonNull String vendor, @NonNull String name, int version)
abstract void
execution(
    @ExtensionFunctionType @NonNull Function1<@NonNull ExecutionUnit> action
)

Set execution profiles and options for tools.

abstract String

Value set via compileSdkAddon

abstract String

Value set via compileSdkAddon

abstract Integer

Value set via compileSdkAddon

abstract @NonNull String

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

abstract Integer

Specifies the API level to compile your project against.

abstract Integer

Specifies the SDK Extension level to compile your project against.

abstract String

Specify a preview API to compile your project against.

abstract @NonNull Execution

Set execution profiles and options for tools.

abstract Integer

The minimum SDK version.

abstract String
abstract String

Requires the specified path to NDK be used.

abstract @NonNull String

Requires the specified NDK version to be used.

abstract void
setBuildToolsVersion(@NonNull String buildToolsVersion)

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

abstract void
setCompileSdk(Integer compileSdk)

Specifies the API level to compile your project against.

abstract void
setCompileSdkExtension(Integer compileSdkExtension)

Specifies the SDK Extension level to compile your project against.

abstract void
setCompileSdkPreview(String compileSdkPreview)

Specify a preview API to compile your project against.

abstract void

The minimum SDK version.

abstract void
setMinSdkPreview(String minSdkPreview)
abstract void
setNdkPath(String ndkPath)

Requires the specified path to NDK be used.

abstract void

Requires the specified NDK version to be used.

Public methods

compileSdkAddon

abstract void compileSdkAddon(@NonNull String vendor, @NonNull String name, int version)

execution

abstract void execution(
    @ExtensionFunctionType @NonNull Function1<@NonNull ExecutionUnit> action
)

Set execution profiles and options for tools.

getAddOnName

@Incubating
abstract String getAddOnName()

Value set via compileSdkAddon

getAddOnVendor

@Incubating
abstract String getAddOnVendor()

Value set via compileSdkAddon

getAddOnVersion

@Incubating
abstract Integer getAddOnVersion()

Value set via compileSdkAddon

getBuildToolsVersion

abstract @NonNull String getBuildToolsVersion()

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

getCompileSdk

abstract Integer getCompileSdk()

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.

getCompileSdkExtension

abstract Integer getCompileSdkExtension()

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.

getCompileSdkPreview

abstract String getCompileSdkPreview()

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.

getExecution

abstract @NonNull Execution getExecution()

Set execution profiles and options for tools.

getMinSdk

abstract Integer getMinSdk()

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.

getMinSdkPreview

abstract String getMinSdkPreview()

getNdkPath

abstract String getNdkPath()

Requires the specified path to NDK be used.

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

getNdkVersion

abstract @NonNull String getNdkVersion()

Requires the specified NDK version to be used.

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

setBuildToolsVersion

abstract void setBuildToolsVersion(@NonNull String buildToolsVersion)

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

setCompileSdk

abstract void setCompileSdk(Integer compileSdk)

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.

setCompileSdkExtension

abstract void setCompileSdkExtension(Integer compileSdkExtension)

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.

setCompileSdkPreview

abstract void setCompileSdkPreview(String compileSdkPreview)

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.

setMinSdk

abstract void setMinSdk(Integer minSdk)

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.

setMinSdkPreview

abstract void setMinSdkPreview(String minSdkPreview)

setNdkPath

abstract void setNdkPath(String ndkPath)

Requires the specified path to NDK be used.

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

setNdkVersion

abstract void setNdkVersion(@NonNull String ndkVersion)

Requires the specified NDK version to be used.

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