mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-07 03:04:50 +01:00
Update wholphin-extensions with newer MpvPlayer (#1365)
## Description Uses the newer version of `wholphin-extensions` which now has the Kotlin code, so this PR removes the MPV Kotlin code from this repo. Also updates gradle to use providers. There are no user facing changes ### Dev notes `wholphin-mpv` can be provided by: 1. [Fetching pre-built binaries](https://github.com/damontecres/wholphin-extensions#pre-built-binaries) (Preferred method for devs) 2. Building `wholphin-extensions` from [source](https://github.com/damontecres/wholphin-extensions#build-from-source) 3. Using `wholphin-mpv-stub` (the new module added in this PR) which allows for compiling Wholphin, but will throw exceptions if MPV is used during runtime ### Related issues Related to #1172 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
f5ce9745ba
commit
a8ade9171e
24 changed files with 177 additions and 1652 deletions
|
|
@ -20,12 +20,21 @@ plugins {
|
|||
alias(libs.plugins.openapi.generator)
|
||||
}
|
||||
|
||||
val isCI = if (System.getenv("CI") != null) System.getenv("CI").toBoolean() else false
|
||||
val shouldSign = isCI && System.getenv("KEY_ALIAS") != null
|
||||
val ffmpegModuleExists = project.file("libs/lib-decoder-ffmpeg-release.aar").exists()
|
||||
val av1ModuleExists = project.file("libs/lib-decoder-av1-release.aar").exists()
|
||||
val mpvModuleExists = project.file("libs/wholphin-mpv-release.aar").exists()
|
||||
val extensionsRepoActive = project.hasProperty("WholphinExtensionsUsername")
|
||||
val isCI = providers.environmentVariable("CI").orElse("false").map { it.toBoolean() }
|
||||
val shouldSign =
|
||||
isCI.zip(
|
||||
providers.environmentVariable("KEY_ALIAS").orElse("").map { it.isNotBlank() },
|
||||
) { isCI, hasKey ->
|
||||
isCI && hasKey
|
||||
}
|
||||
val ffmpegModuleExists =
|
||||
providers.provider { project.file("libs/lib-decoder-ffmpeg-release.aar").exists() }
|
||||
val av1ModuleExists =
|
||||
providers.provider { project.file("libs/lib-decoder-av1-release.aar").exists() }
|
||||
val mpvModuleExists =
|
||||
providers.provider { project.file("libs/wholphin-mpv-release.aar").exists() }
|
||||
val extensionsRepoActive =
|
||||
providers.provider { project.hasProperty("WholphinExtensionsUsername") }
|
||||
|
||||
// See https://issuetracker.google.com/issues/402800800
|
||||
val isBuildingBundle =
|
||||
|
|
@ -69,7 +78,7 @@ configure<ApplicationExtension> {
|
|||
}
|
||||
|
||||
signingConfigs {
|
||||
if (shouldSign) {
|
||||
if (shouldSign.get()) {
|
||||
create("ci") {
|
||||
file("ci.keystore").writeBytes(
|
||||
Base64.getDecoder().decode(System.getenv("SIGNING_KEY")),
|
||||
|
|
@ -95,7 +104,7 @@ configure<ApplicationExtension> {
|
|||
"proguard-rules.pro",
|
||||
)
|
||||
isDebuggable = false
|
||||
if (shouldSign) {
|
||||
if (shouldSign.get()) {
|
||||
signingConfig = signingConfigs.getByName("ci")
|
||||
} else {
|
||||
val localPropertiesFile = project.rootProject.file("local.properties")
|
||||
|
|
@ -357,32 +366,33 @@ dependencies {
|
|||
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
||||
coreLibraryDesugaring(libs.desugar.jdk.libs)
|
||||
|
||||
if (ffmpegModuleExists) {
|
||||
if (ffmpegModuleExists.get()) {
|
||||
logger.info("Using local ffmpeg decoder")
|
||||
implementation(files("libs/lib-decoder-ffmpeg-release.aar"))
|
||||
} else if (extensionsRepoActive) {
|
||||
} else if (extensionsRepoActive.get()) {
|
||||
logger.info("Using prebuilt ffmpeg decoder")
|
||||
implementation(libs.wholphin.extensions.ffmpeg)
|
||||
} else {
|
||||
logger.warn("Media3 ffmpeg decoder was NOT found")
|
||||
}
|
||||
if (av1ModuleExists) {
|
||||
if (av1ModuleExists.get()) {
|
||||
logger.info("Using local av1 decoder")
|
||||
implementation(files("libs/lib-decoder-av1-release.aar"))
|
||||
} else if (extensionsRepoActive) {
|
||||
} else if (extensionsRepoActive.get()) {
|
||||
logger.info("Using prebuilt av1 decoder")
|
||||
implementation(libs.wholphin.extensions.av1)
|
||||
} else {
|
||||
logger.warn("Media3 av1 decoder was NOT found")
|
||||
}
|
||||
if (mpvModuleExists) {
|
||||
if (mpvModuleExists.get()) {
|
||||
logger.info("Using local libMPV build")
|
||||
implementation(files("libs/wholphin-mpv-release.aar"))
|
||||
} else if (extensionsRepoActive) {
|
||||
} else if (extensionsRepoActive.get()) {
|
||||
logger.info("Using prebuilt libMPV")
|
||||
implementation(libs.wholphin.extensions.mpv)
|
||||
} else {
|
||||
logger.warn("libMPV was NOT found")
|
||||
logger.warn("libMPV was NOT found, using stub library")
|
||||
implementation(project(":wholphin-mpv-stub"))
|
||||
}
|
||||
|
||||
testImplementation(libs.mockk.android)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue