From 4bca1ac47bda83d43bccc3abd7c38266dcd271a8 Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 8 Mar 2024 08:13:55 -0800 Subject: [PATCH] Add opt-in flag for the MIDI module for apps with a local dependency PiperOrigin-RevId: 613938538 --- README.md | 20 ++++++++++++++++++++ RELEASENOTES.md | 4 ++++ core_settings.gradle | 6 ++++-- settings.gradle | 2 ++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a57b9daa51..d80a4bbf71 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,26 @@ implementation project(':media-lib-exoplayer-dash') implementation project(':media-lib-ui') ``` +#### MIDI module + +By default the [MIDI module](libraries/decoder_midi) is disabled as a local +dependency, because it requires additional Maven repository config. If you want +to use it as a local dependency, please configure the JitPack repository as +[described in the module README](libraries/decoder_midi/README.md#getting-the-module), +and then enable building the module in your `settings.gradle.kts` file: + +```kotlin +gradle.extra.apply { + set("androidxMediaEnableMidiModule", true) +} +``` + +Or in Gradle Groovy DSL `settings.gradle`: + +```groovy +gradle.ext.androidxMediaEnableMidiModule = true +``` + ## Developing AndroidX Media #### Project branches diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a1aea6e215..10b22b366d 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -87,6 +87,10 @@ * Skip empty session information values (i-tags) in SDP parsing ([#1087](https://github.com/androidx/media/issues/1087)). * Decoder Extensions (FFmpeg, VP9, AV1, MIDI, etc.): + * Disable the MIDI extension as a local dependency by default because it + requires an additional Maven repository to be configured. Users who need + this module from a local dependency + [can re-enable it](https://github.com/androidx/media/blob/main/README.md#midi-module). * Leanback extension: * Cast Extension: * Test Utilities: diff --git a/core_settings.gradle b/core_settings.gradle index f576eb486e..15f94b0cf2 100644 --- a/core_settings.gradle +++ b/core_settings.gradle @@ -72,8 +72,10 @@ include modulePrefix + 'lib-decoder-ffmpeg' project(modulePrefix + 'lib-decoder-ffmpeg').projectDir = new File(rootDir, 'libraries/decoder_ffmpeg') include modulePrefix + 'lib-decoder-flac' project(modulePrefix + 'lib-decoder-flac').projectDir = new File(rootDir, 'libraries/decoder_flac') -include modulePrefix + 'lib-decoder-midi' -project(modulePrefix + 'lib-decoder-midi').projectDir = new File(rootDir, 'libraries/decoder_midi') +if (gradle.ext.has('androidxMediaEnableMidiModule') && gradle.ext.androidxMediaEnableMidiModule) { + include modulePrefix + 'lib-decoder-midi' + project(modulePrefix + 'lib-decoder-midi').projectDir = new File(rootDir, 'libraries/decoder_midi') +} include modulePrefix + 'lib-decoder-opus' project(modulePrefix + 'lib-decoder-opus').projectDir = new File(rootDir, 'libraries/decoder_opus') include modulePrefix + 'lib-decoder-vp9' diff --git a/settings.gradle b/settings.gradle index 37468d786e..f0e719b1f2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -21,6 +21,8 @@ if (gradle.ext.has('androidxMediaModulePrefix')) { rootProject.name = 'androidx.media3' gradle.ext.rootProjectIsAndroidXMedia3 = true +gradle.ext.androidxMediaEnableMidiModule = true + include modulePrefix + 'demo' project(modulePrefix + 'demo').projectDir = new File(rootDir, 'demos/main') include modulePrefix + 'demo-cast'