# Aidl

# Aidl

[View Source](https://cs.android.com/search?q=file:com/android/build/api/variant/Aidl.kt+class:com.android.build.api.variant.Aidl)  
Added in 8.1.0  

<br />

```
interface Aidl
```

<br />

*** ** * ** ***

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

An instance of[Aidl](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Aidl)can be obtained via[AndroidComponentsExtension.sdkComponents](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/AndroidComponentsExtension#sdkComponents())

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

```scalate-server-page
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](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)`<`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`>` | [executable](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Aidl#executable()) Path to the[AIDL](https://developer.android.com/guide/components/aidl)executable file from the Android SDK |
| [Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)`<`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`>` | [framework](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Aidl#framework()) Path to the[AIDL](https://developer.android.com/guide/components/aidl)framework file from the Android SDK    |
| [Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`            | [version](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/variant/Aidl#version()) Version of build tools.                                                                                          |

## Public properties

### executable

Added in 8.1.0  

```
val executable: Provider<RegularFile>
```

Path to the[AIDL](https://developer.android.com/guide/components/aidl)executable file from the Android SDK  

### framework

Added in 8.1.0  

```
val framework: Provider<RegularFile>
```

Path to the[AIDL](https://developer.android.com/guide/components/aidl)framework file from the Android SDK  

### version

Added in 8.1.0  

```
val version: Provider<String>
```

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