connectToAndroidComponent

abstract fun connectToAndroidComponent(component: Any, kotlin: Boolean)

Connects the generated sources to the given Android Component.

Parameters

component

the component to connect to.

  • When using AGP8, component must be an instance of com.android.build.gradle.api.BaseVariant

  • When using AGP9+, component must be an instance of com.android.build.api.variant.Component

Note component is of type Any because DirectoryConnection can be used in non-Android projects, and we don't want the class to fail during loading because of a missing symbol in that case.