Skip to content

Commit

Permalink
Move exoplayer to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
qnga committed Oct 4, 2023
1 parent 3a76f70 commit 0054de6
Show file tree
Hide file tree
Showing 24 changed files with 99 additions and 44 deletions.
18 changes: 2 additions & 16 deletions readium/adapters/exoplayer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ plugins {
id("com.android.library")
kotlin("android")
kotlin("plugin.parcelize")
kotlin("plugin.serialization")
}

android {
Expand Down Expand Up @@ -38,29 +37,16 @@ android {
proguardFiles(getDefaultProguardFile("proguard-android.txt"))
}
}
buildFeatures {
viewBinding = true
}
namespace = "org.readium.adapter.exoplayer"
}

kotlin {
explicitApi()
}

rootProject.ext["publish.artifactId"] = "readium-navigator-exoplayer"
rootProject.ext["publish.artifactId"] = "readium-adapter-exoplayer"
apply(from = "$rootDir/scripts/publish-module.gradle")

dependencies {
api(project(":readium:readium-shared"))
api(project(":readium:navigators:media:readium-navigator-media-audio"))

implementation(libs.androidx.media3.common)
implementation(libs.androidx.media3.exoplayer)
implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.serialization.json)

// Tests
testImplementation(libs.junit)
api(project(":readium:adapters:exoplayer:readium-adapter-exoplayer-audio"))
}
66 changes: 66 additions & 0 deletions readium/adapters/exoplayer/exoplayer-audio/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright 2022 Readium Foundation. All rights reserved.
* Use of this source code is governed by the BSD-style license
* available in the top-level LICENSE file of the project.
*/

plugins {
id("com.android.library")
kotlin("android")
kotlin("plugin.parcelize")
kotlin("plugin.serialization")
}

android {
resourcePrefix = "readium_"

compileSdk = 34

defaultConfig {
minSdk = 21
targetSdk = 34
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=org.readium.r2.shared.InternalReadiumApi"
)
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"))
}
}
buildFeatures {
viewBinding = true
}
namespace = "org.readium.adapter.exoplayer.audio"
}

kotlin {
explicitApi()
}

rootProject.ext["publish.artifactId"] = "readium-navigator-exoplayer-audio"
apply(from = "$rootDir/scripts/publish-module.gradle")

dependencies {
api(project(":readium:readium-shared"))
api(project(":readium:navigators:media:readium-navigator-media-audio"))

implementation(libs.androidx.media3.common)
implementation(libs.androidx.media3.exoplayer)
implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.serialization.json)

// Tests
testImplementation(libs.junit)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import androidx.media3.common.ForwardingPlayer
import androidx.media3.exoplayer.ExoPlaybackException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import org.readium.navigator.media.audio.AudioNavigator
import org.readium.navigator.media.audio.AudioNavigatorFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import android.net.Uri
import androidx.media3.common.C.LENGTH_UNSET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import org.readium.r2.shared.ExperimentalReadiumApi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import android.app.Application
import androidx.media3.common.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import android.app.Application
import androidx.media3.datasource.DataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.shared.ExperimentalReadiumApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import org.readium.r2.navigator.extensions.format
import org.readium.r2.navigator.preferences.DoubleIncrement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import kotlinx.serialization.json.Json
import org.readium.r2.navigator.preferences.PreferencesSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.shared.ExperimentalReadiumApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import org.readium.r2.shared.ExperimentalReadiumApi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/

package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import kotlin.time.Duration
import kotlin.time.ExperimentalTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.readium.adapter.exoplayer
package org.readium.adapter.exoplayer.audio

import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ include(":readium:navigator-media2")
project(":readium:navigator-media2")
.name = "readium-navigator-media2"

include(":readium:adapters:exoplayer")
project(":readium:adapters:exoplayer")
.name = "readium-adapter-exoplayer"
include(":readium:adapters:exoplayer:exoplayer-audio")
project(":readium:adapters:exoplayer:exoplayer-audio")
.name = "readium-adapter-exoplayer-audio"

include(":readium:opds")
project(":readium:opds")
Expand Down
2 changes: 1 addition & 1 deletion test-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
implementation(project(":readium:navigators:media:readium-navigator-media-audio"))
implementation(project(":readium:navigators:media:readium-navigator-media-tts"))
// Only required if you want to support audiobooks using ExoPlayer.
implementation(project(":readium:adapters:readium-adapter-exoplayer"))
implementation(project(":readium:adapters:exoplayer"))
implementation(project(":readium:readium-navigator-media2"))
implementation(project(":readium:readium-opds"))
implementation(project(":readium:readium-lcp"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import kotlin.time.DurationUnit
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import org.readium.adapter.exoplayer.ExoPlayerPreferences
import org.readium.adapter.exoplayer.ExoPlayerSettings
import org.readium.adapter.exoplayer.audio.ExoPlayerPreferences
import org.readium.adapter.exoplayer.audio.ExoPlayerSettings
import org.readium.navigator.media.common.MediaNavigator
import org.readium.navigator.media.common.TimeBasedMediaNavigator
import org.readium.r2.navigator.preferences.Configurable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

package org.readium.r2.testapp.reader

import org.readium.adapter.exoplayer.ExoPlayerNavigator
import org.readium.adapter.exoplayer.ExoPlayerNavigatorFactory
import org.readium.adapter.exoplayer.ExoPlayerPreferences
import org.readium.adapter.exoplayer.audio.ExoPlayerNavigator
import org.readium.adapter.exoplayer.audio.ExoPlayerNavigatorFactory
import org.readium.adapter.exoplayer.audio.ExoPlayerPreferences
import org.readium.adapter.pdfium.navigator.PdfiumNavigatorFactory
import org.readium.adapter.pdfium.navigator.PdfiumPreferences
import org.readium.navigator.media.tts.AndroidTtsNavigatorFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.annotation.StringRes
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences as JetpackPreferences
import org.json.JSONObject
import org.readium.adapter.exoplayer.ExoPlayerEngineProvider
import org.readium.adapter.exoplayer.audio.ExoPlayerEngineProvider
import org.readium.adapter.pdfium.navigator.PdfiumEngineProvider
import org.readium.navigator.media.audio.AudioNavigatorFactory
import org.readium.navigator.media.tts.TtsNavigatorFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.map
import org.readium.adapter.exoplayer.ExoPlayerPreferences
import org.readium.adapter.exoplayer.ExoPlayerPreferencesSerializer
import org.readium.adapter.exoplayer.audio.ExoPlayerPreferences
import org.readium.adapter.exoplayer.audio.ExoPlayerPreferencesSerializer
import org.readium.adapter.pdfium.navigator.PdfiumPreferences
import org.readium.adapter.pdfium.navigator.PdfiumPreferencesSerializer
import org.readium.adapter.pdfium.navigator.PdfiumPublicationPreferencesFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import org.readium.adapter.exoplayer.ExoPlayerPreferencesEditor
import org.readium.adapter.exoplayer.audio.ExoPlayerPreferencesEditor
import org.readium.adapter.pdfium.navigator.PdfiumPreferencesEditor
import org.readium.navigator.media.tts.android.AndroidTtsEngine
import org.readium.r2.navigator.epub.EpubPreferencesEditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import org.readium.adapter.exoplayer.ExoPlayerPreferences
import org.readium.adapter.exoplayer.ExoPlayerSettings
import org.readium.adapter.exoplayer.audio.ExoPlayerPreferences
import org.readium.adapter.exoplayer.audio.ExoPlayerSettings
import org.readium.adapter.pdfium.navigator.PdfiumPreferences
import org.readium.adapter.pdfium.navigator.PdfiumSettings
import org.readium.r2.navigator.epub.EpubPreferences
Expand Down

0 comments on commit 0054de6

Please sign in to comment.