From 018d0488e1a939fc9bb1c9a323adb06ba619fdc6 Mon Sep 17 00:00:00 2001 From: jbibik Date: Thu, 1 Aug 2024 12:12:06 -0700 Subject: [PATCH] Create a new `media3-common-ktx` module It will be used for Kotlin-specific functionality like extension functions on the classes from the `media3-common` module. To import it, add the following to your build.gradle file: `implementation("androidx.media3:media3-common-ktx:1.X.Y")` PiperOrigin-RevId: 658492256 --- core_settings.gradle | 3 ++ libraries/common_ktx/README.md | 11 ++++++ libraries/common_ktx/build.gradle | 37 +++++++++++++++++++ .../common_ktx/src/main/AndroidManifest.xml | 18 +++++++++ .../common_ktx/src/test/AndroidManifest.xml | 19 ++++++++++ 5 files changed, 88 insertions(+) create mode 100644 libraries/common_ktx/README.md create mode 100644 libraries/common_ktx/build.gradle create mode 100644 libraries/common_ktx/src/main/AndroidManifest.xml create mode 100644 libraries/common_ktx/src/test/AndroidManifest.xml diff --git a/core_settings.gradle b/core_settings.gradle index 205c86c64d..e0629d2496 100644 --- a/core_settings.gradle +++ b/core_settings.gradle @@ -24,6 +24,9 @@ if (gradle.ext.has('androidxMediaModulePrefix')) { include modulePrefix + 'lib-common' project(modulePrefix + 'lib-common').projectDir = new File(rootDir, 'libraries/common') +include modulePrefix + 'lib-common-ktx' +project(modulePrefix + 'lib-common-ktx').projectDir = new File(rootDir, 'libraries/common_ktx') + include modulePrefix + 'lib-container' project(modulePrefix + 'lib-container').projectDir = new File(rootDir, 'libraries/container') diff --git a/libraries/common_ktx/README.md b/libraries/common_ktx/README.md new file mode 100644 index 0000000000..a2a64265ed --- /dev/null +++ b/libraries/common_ktx/README.md @@ -0,0 +1,11 @@ +# Common Kotlin Extensions module + +Provides Kotlin-specific common code and utilities. Examples include extension +functions and properties, named parameters and coroutines. They help provide +idiomatic Kotlin APIs to be used by Media3 consumers. + +## Links + +* [Javadoc][] + +[Javadoc]: https://developer.android.com/reference/androidx/media3/common/package-summary diff --git a/libraries/common_ktx/build.gradle b/libraries/common_ktx/build.gradle new file mode 100644 index 0000000000..dbf92dd68e --- /dev/null +++ b/libraries/common_ktx/build.gradle @@ -0,0 +1,37 @@ +// Copyright (C) 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle" + + +android { + namespace 'androidx.media3.common.ktx' + + buildTypes { + debug { + testCoverageEnabled = true + } + } + publishing { + singleVariant('release') { + withSourcesJar() + } + } +} + +ext { + releaseArtifactId = 'media3-common-ktx' + releaseName = 'Media3 common KTX module' +} +apply from: '../../publish.gradle' diff --git a/libraries/common_ktx/src/main/AndroidManifest.xml b/libraries/common_ktx/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..98766dbd9a --- /dev/null +++ b/libraries/common_ktx/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/libraries/common_ktx/src/test/AndroidManifest.xml b/libraries/common_ktx/src/test/AndroidManifest.xml new file mode 100644 index 0000000000..e54638ac6d --- /dev/null +++ b/libraries/common_ktx/src/test/AndroidManifest.xml @@ -0,0 +1,19 @@ + + + + + +