Aidl

@Incubating interface Aidl


Provides structured access to various AIDL tools such as the aidl compiler executable and aidl framework.

An instance of Aidl can be obtained via AndroidComponentsExtension.sdkComponents

As an example , let's take a Task that runs aidl compiler:

abstract class MyTask: DefaultTask() {
@get:Nested
abstract val aidlInput: Property<com.android.build.api.variant.Aidl>

@get:Inject
abstract val execOperations: ExecOperations

@TaskAction
fun execute() {
val aidlExecutable = aidlInput.get().executable.get().asFile
val aidlFramework = aidlInput.get().framework.get().asFile

// execute aidl binary with --help argument
execOperations.exec { spec ->
spec.commandLine(aidlExecutable)
spec.args("--help")
}
}
}

tasks.register<MyTask>("myTaskName") {
// get an instance of Aidl
this.aidlInput.set(androidComponents.sdkComponents.aidl)
}

Summary

Public properties

Provider<RegularFile>

Path to the AIDL executable file from the Android SDK

Provider<RegularFile>

Path to the AIDL framework file from the Android SDK

Provider<String>

Version of build tools.

Public properties

executable

val executableProvider<RegularFile>

Path to the AIDL executable file from the Android SDK

framework

val frameworkProvider<RegularFile>

Path to the AIDL framework file from the Android SDK

version

val versionProvider<String>

Version of build tools. It is used as an input to allow correct build cache behaviour across different platforms