Skip to content

Commit 14ed32c

Browse files
andrewlewismarcbaechinger
authored andcommitted
Create withMediaPipe variant only if AAR is present
This should fix running `./gradlew clean test` if MediaPipe hasn't been built, for example. PiperOrigin-RevId: 452033698
1 parent b6b2826 commit 14ed32c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

demos/transformer/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ manual steps.
5757
${TRANSFORMER_DEMO_ROOT}/src/withMediaPipe/assets
5858
```
5959
60-
1. Select the `withMediaPipe` build variant in Android Studio, then build and
61-
run the demo app and select a MediaPipe-based effect.
60+
1. In Android Studio, gradle sync and select the `withMediaPipe` build variant
61+
(this will only appear if the AAR is present), then build and run the demo
62+
app and select a MediaPipe-based effect.
6263
6364
[Transformer]: https://exoplayer.dev/transforming-media.html
6465
[MediaPipe]: https://google.github.io/mediapipe/

demos/transformer/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ android {
5656
dimension "mediaPipe"
5757
}
5858
}
59+
60+
// Ignore the withMediaPipe variant if the MediaPipe AAR is not present.
61+
if (!project.file("libs/edge_detector_mediapipe_aar.aar").exists()) {
62+
variantFilter { variant ->
63+
def names = variant.flavors*.name
64+
if (names.contains("withMediaPipe")) {
65+
setIgnore(true)
66+
}
67+
}
68+
}
5969
}
6070

6171
dependencies {

0 commit comments

Comments
 (0)