LibraryAndroidComponentsExtension

public interface LibraryAndroidComponentsExtension extends AndroidComponentsExtension


Extension for the Android Library Gradle Plugin components.

This is the androidComponents block when the com.android.library plugin is applied.

Only the Android Gradle Plugin should create instances of interfaces in com.android.build.api.variant.

Summary

Inherited methods

From com.android.build.api.variant.AndroidComponents
abstract @NonNull AndroidPluginVersion

The version of the Android Gradle Plugin currently in use.

abstract @NonNull SdkComponents

Provides access to underlying Android SDK and build-tools components like adb.

From com.android.build.api.variant.AndroidComponentsExtension
abstract void

Action based version of beforeVariants above.

abstract void
beforeVariants(
    @NonNull VariantSelector selector,
    @NonNull Function1<@NonNull LibraryVariantBuilderUnit> callback
)

Method to register a callback to be called with VariantBuilderT instances that satisfies the selector.

abstract void

This method is deprecated. Replaced by finalizeDsl

abstract void
onVariants(
    @NonNull VariantSelector selector,
    @NonNull Action<@NonNull LibraryVariant> callback
)

Action based version of onVariants above.

abstract void
onVariants(
    @NonNull VariantSelector selector,
    @NonNull Function1<@NonNull LibraryVariantUnit> callback
)

Allow for registration of a callback to be called with variant instances of type VariantT once the list of com.android.build.api.artifact.Artifact has been determined.

abstract void

Register an Android Gradle Plugin DSL extension.

abstract void

Register a new source type to all source sets.

abstract @NonNull VariantSelector

Creates a VariantSelector instance that can be configured to reduce the set of ComponentBuilder instances participating in the beforeVariants and onVariants callback invocation.

From com.android.build.api.variant.DslLifecycle
abstract void

Action based version of finalizeDsl above.

abstract void
finalizeDsl(@NonNull Function1<@NonNull LibraryExtensionUnit> callback)

API to customize the DSL Objects programmatically after they have been evaluated from the build files and before used in the build process next steps like variant or tasks creation.