Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ jobs:
run: ./gradlew test --configuration-cache
- name: Assemble
run: ./gradlew assembleRelease --configuration-cache
- name: Assemble with lowest supported player version
run: ./gradlew assembleRelease --configuration-cache -PinstallLowestSupportedPlayerVersion=true
48 changes: 24 additions & 24 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ android {
matchingFallbacks += listOf("debug")
}
}

flavorDimensions += "player"
productFlavors {
create("latestPlayer") {
// Use the latest supported THEOplayer version
dimension = "player"
}
create("minPlayer") {
// Use the minimum supported THEOplayer version
dimension = "player"
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -59,6 +72,10 @@ android {
}

dependencies {
val mavenImplementation = configurations.getByName("mavenImplementation")
val latestPlayerImplementation = configurations.getByName("latestPlayerImplementation")
val minPlayerImplementation = configurations.getByName("minPlayerImplementation")

implementation(platform(libs.androidx.compose.bom))

implementation(libs.androidx.ktx)
Expand All @@ -80,30 +97,13 @@ dependencies {

debugImplementation(project(":ui"))
releaseImplementation(project(":ui"))
"mavenImplementation"("com.theoplayer.android-ui:android-ui:1.+")
mavenImplementation("com.theoplayer.android-ui:android-ui:1.+")

implementation(libs.theoplayer) {
useLowestSupportedPlayerVersion()
}
implementation(libs.theoplayer.ads.ima) {
useLowestSupportedPlayerVersion()
}
implementation(libs.theoplayer.cast) {
useLowestSupportedPlayerVersion()
}
}
latestPlayerImplementation(libs.theoplayer)
latestPlayerImplementation(libs.theoplayer.ads.ima)
latestPlayerImplementation(libs.theoplayer.cast)

val installLowestSupportedPlayerVersion: String by project.ext

fun ExternalDependency.useLowestSupportedPlayerVersion() {
if (installLowestSupportedPlayerVersion.toBooleanStrict()) {
val lowestVersion = versionConstraint.strictVersion
.removePrefix("[")
.split(",", limit = 2)
.first()
version {
prefer(lowestVersion)
strictly(lowestVersion)
}
}
minPlayerImplementation(libs.theoplayer.min)
minPlayerImplementation(libs.theoplayer.min.ads.ima)
minPlayerImplementation(libs.theoplayer.min.cast)
}
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ androidx-espresso = "3.7.0"
androidx-mediarouter = "1.8.1"
dokka = "2.0.0"
theoplayer = { prefer="10.11.0", strictly = "[7.6.0, 11.0)" }
theoplayer-min = { strictly = "7.6.0" }

[libraries]
androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
Expand Down Expand Up @@ -44,6 +45,9 @@ junit4 = { group = "junit", name = "junit", version.ref = "junit4" }
theoplayer = { group = "com.theoplayer.theoplayer-sdk-android", name = "core", version.ref = "theoplayer" }
theoplayer-ads-ima = { group = "com.theoplayer.theoplayer-sdk-android", name = "integration-ads-ima", version.ref = "theoplayer" }
theoplayer-cast = { group = "com.theoplayer.theoplayer-sdk-android", name = "integration-cast", version.ref = "theoplayer" }
theoplayer-min = { group = "com.theoplayer.theoplayer-sdk-android", name = "core", version.ref = "theoplayer-min" }
theoplayer-min-ads-ima = { group = "com.theoplayer.theoplayer-sdk-android", name = "integration-ads-ima", version.ref = "theoplayer-min" }
theoplayer-min-cast = { group = "com.theoplayer.theoplayer-sdk-android", name = "integration-cast", version.ref = "theoplayer-min" }

[plugins]
android-application = { id = "com.android.application", version.ref = "gradle" }
Expand Down