Commit 14ed32c6 by andrewlewis Committed by Marc Baechinger

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
parent b6b28267
...@@ -57,8 +57,9 @@ manual steps. ...@@ -57,8 +57,9 @@ manual steps.
${TRANSFORMER_DEMO_ROOT}/src/withMediaPipe/assets ${TRANSFORMER_DEMO_ROOT}/src/withMediaPipe/assets
``` ```
1. Select the `withMediaPipe` build variant in Android Studio, then build and 1. In Android Studio, gradle sync and select the `withMediaPipe` build variant
run the demo app and select a MediaPipe-based effect. (this will only appear if the AAR is present), then build and run the demo
app and select a MediaPipe-based effect.
[Transformer]: https://exoplayer.dev/transforming-media.html [Transformer]: https://exoplayer.dev/transforming-media.html
[MediaPipe]: https://google.github.io/mediapipe/ [MediaPipe]: https://google.github.io/mediapipe/
......
...@@ -56,6 +56,16 @@ android { ...@@ -56,6 +56,16 @@ android {
dimension "mediaPipe" dimension "mediaPipe"
} }
} }
// Ignore the withMediaPipe variant if the MediaPipe AAR is not present.
if (!project.file("libs/edge_detector_mediapipe_aar.aar").exists()) {
variantFilter { variant ->
def names = variant.flavors*.name
if (names.contains("withMediaPipe")) {
setIgnore(true)
}
}
}
} }
dependencies { dependencies {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment