Aidl

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

abstract @NonNull Provider<@NonNull RegularFile>

Path to the AIDL executable file from the Android SDK

abstract @NonNull Provider<@NonNull RegularFile>
@PathSensitive(value = PathSensitivity.NAME_ONLY)
@InputFile
getFramework()

Path to the AIDL framework file from the Android SDK

abstract @NonNull Provider<@NonNull String>

Version of build tools.

Public methods

getExecutable

@Internal
abstract @NonNull Provider<@NonNull RegularFilegetExecutable()

Path to the AIDL executable file from the Android SDK

getFramework

@PathSensitive(value = PathSensitivity.NAME_ONLY)
@InputFile
abstract @NonNull Provider<@NonNull RegularFilegetFramework()

Path to the AIDL framework file from the Android SDK

getVersion

@Input
abstract @NonNull Provider<@NonNull StringgetVersion()

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