Stay organized with collections
Save and categorize content based on your preferences.
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
version
val version: Provider<String>
Version of build tools. It is used as an input to allow correct build cache behaviour across different platforms
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Aidl\n====\n\n\n```\n@Incubating interface Aidl\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nProvides structured access to various AIDL tools such as the aidl compiler executable and aidl framework.\n\nAn instance of [Aidl](/reference/tools/gradle-api/8.1/com/android/build/api/variant/Aidl) can be obtained via [AndroidComponentsExtension.sdkComponents](/reference/tools/gradle-api/8.1/com/android/build/api/variant/AndroidComponentsExtension#sdkComponents())\n\nAs an example , let's take a Task that runs aidl compiler: \n\n```scalate-server-page\nabstract class MyTask: DefaultTask() {\n @get:Nested\n abstract val aidlInput: Property\u003ccom.android.build.api.variant.Aidl\u003e\n\n @get:Inject\n abstract val execOperations: ExecOperations\n\n @TaskAction\n fun execute() {\n val aidlExecutable = aidlInput.get().executable.get().asFile\n val aidlFramework = aidlInput.get().framework.get().asFile\n\n // execute aidl binary with --help argument\n execOperations.exec { spec -\u003e\n spec.commandLine(aidlExecutable)\n spec.args(\"--help\")\n }\n }\n}\n\ntasks.register\u003cMyTask\u003e(\"myTaskName\") {\n // get an instance of Aidl\n this.aidlInput.set(androidComponents.sdkComponents.aidl)\n}\n```\n\nSummary\n-------\n\n| ### Public properties ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)`\u003c`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`\u003e` | [executable](/reference/tools/gradle-api/8.1/com/android/build/api/variant/Aidl#executable()) Path to the [AIDL](https://developer.android.com/guide/components/aidl) executable file from the Android SDK |\n| [Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)`\u003c`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`\u003e` | [framework](/reference/tools/gradle-api/8.1/com/android/build/api/variant/Aidl#framework()) Path to the [AIDL](https://developer.android.com/guide/components/aidl) framework file from the Android SDK |\n| [Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [version](/reference/tools/gradle-api/8.1/com/android/build/api/variant/Aidl#version()) Version of build tools. |\n\nPublic properties\n-----------------\n\n### executable\n\n```\nval executable: Provider\u003cRegularFile\u003e\n```\n\nPath to the [AIDL](https://developer.android.com/guide/components/aidl) executable file from the Android SDK \n\n### framework\n\n```\nval framework: Provider\u003cRegularFile\u003e\n```\n\nPath to the [AIDL](https://developer.android.com/guide/components/aidl) framework file from the Android SDK \n\n### version\n\n```\nval version: Provider\u003cString\u003e\n```\n\nVersion of build tools. It is used as an input to allow correct build cache behaviour across different platforms"]]