Skip to content

Commit

Permalink
Merge "Update transformMultiple recipe with details of wiredWith" int…
Browse files Browse the repository at this point in the history
…o studio-main
  • Loading branch information
micahjo7 authored and Android (Google) Code Review committed Mar 29, 2024
2 parents e0df231 + d17be7d commit 486fb69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion recipes/transformMultiple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
This sample shows how to use the `CombiningOperationRequest.toTransform()` API on an object of type
[Artifact.Multiple](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/Artifact.Multiple) and [Artifact.Transformable](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/Artifact.Transformable). This method is defined in [CombiningOperationRequest](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/CombiningOperationRequest).

This recipe also demonstrates the usage of [`TaskBasedOperation.wiredWith()`](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/TaskBasedOperation#wiredWith(kotlin.Function1)),
which is used to set up the `CombiningOperationRequest` transformation by hooking up the task inputs and output.

This recipe contains the following directories:

| Module | Content |
Expand All @@ -16,7 +19,8 @@ The [build-logic](build-logic) sub-project contains the [`CustomPlugin`](build-l
[`CustomPlugin`](build-logic/plugins/src/main/kotlin/CustomPlugin.kt) adds a file to the `MultipleArtifact.NATIVE_DEBUG_METADATA` artifact, and registers an instance
of `TransformNativeDebugMetadataTask` per variant using `CombiningOperationRequest.toTransform()`, which requires that
all task inputs be combined into a single output. This automatically creates a dependency on this task from any task
consuming the `MultipleArtifact.NATIVE_DEBUG_METADATA` artifact.
consuming the `MultipleArtifact.NATIVE_DEBUG_METADATA` artifact. Below is a sample usage of both
`TaskBasedOperation.wiredWith()` and `CombiningOperationRequest.toTransform()`:

```
variant.artifacts.use(transformDebugNativeDebugMetadata)
Expand Down

0 comments on commit 486fb69

Please sign in to comment.