From 6d977360e817dc6517c0e00dcdbbfa29bce027c0 Mon Sep 17 00:00:00 2001 From: Micah Jo Date: Mon, 18 Mar 2024 12:59:01 -0700 Subject: [PATCH] Update recipe to include toTransformMany documentation This updates workerEnabledTransformation recipe which is already using the toTransformMany API, to include information on the usage of it. Bug: n/a Test: this is a test Change-Id: I13adbae7fd9043cb7889a168a44b0f17b6b52984 --- recipes/workerEnabledTransformation/README.md | 11 ++++++---- .../app/build.gradle.kts | 2 +- .../app/src/main/AndroidManifest.xml | 2 +- .../build-logic/plugins/build.gradle.kts | 2 +- .../plugins/src/main/kotlin/CopyApksTask.kt | 2 +- .../plugins/src/main/kotlin/CustomPlugin.kt | 20 ++++++++----------- .../build-logic/settings.gradle.kts | 2 +- .../build.gradle.kts | 2 +- 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/recipes/workerEnabledTransformation/README.md b/recipes/workerEnabledTransformation/README.md index 8a1dd594..c90427cd 100644 --- a/recipes/workerEnabledTransformation/README.md +++ b/recipes/workerEnabledTransformation/README.md @@ -1,7 +1,10 @@ -# Worker Enable Transformation recipe +# Worker-enabled transformation recipe -This sample shows how to transform the artifact that has artifact directory type. -It copies the build APK to the specified directory. +This sample uses the `InAndOutDirectoryOperationRequest.toTransformMany()` API on an object of type +[Artifact.Single](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/Artifact.Single), +[Artifact.ContainsMany](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/Artifact.ContainsMany), +and [Artifact.Transformable](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/Artifact.Transformable). +This method is defined in [InAndOutDirectoryOperationRequest](https://developer.android.com/reference/tools/gradle-api/current/com/android/build/api/artifact/InAndOutDirectoryOperationRequest). Custom plugin is defined in [CustomPlugin.kt](build-logic/plugins/src/main/kotlin/CustomPlugin.kt). It registers task [CopyApksTask.kt](build-logic/plugins/src/main/kotlin/CopyApksTask.kt) that creates asynchronous @@ -16,7 +19,7 @@ and accelerating build completion. Android Gradle Plugin made it simpler to use ## To Run Just type `./gradlew copyDebugApks` -you will be able to find two APKs: before copying its +you will be able to find two APKs: before copying, it is `app/build/intermediates/apk/debug/packageDebug/app-debug.apk` and `app/build/outputs/apk/debug/app-debug.apk` after copying. diff --git a/recipes/workerEnabledTransformation/app/build.gradle.kts b/recipes/workerEnabledTransformation/app/build.gradle.kts index 086c7843..abd180c7 100644 --- a/recipes/workerEnabledTransformation/app/build.gradle.kts +++ b/recipes/workerEnabledTransformation/app/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/recipes/workerEnabledTransformation/app/src/main/AndroidManifest.xml b/recipes/workerEnabledTransformation/app/src/main/AndroidManifest.xml index 95971dfc..8b7fed3d 100644 --- a/recipes/workerEnabledTransformation/app/src/main/AndroidManifest.xml +++ b/recipes/workerEnabledTransformation/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@