Skip to content

Commit

Permalink
Update doc and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed May 8, 2024
1 parent b49b944 commit cedc7ab
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 61 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Build modules
run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-tv:assembleDebug :pillarbox-player-testutils:assembleDebug
run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-cast:assembleDebug :pillarbox-demo-tv:assembleDebug :pillarbox-player-testutils:assembleDebug

android-lint:
name: Android Lint
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Run Android Lint
run: ./gradlew :pillarbox-demo:lintProdDebug :pillarbox-demo-tv:lintDebug :pillarbox-player-testutils:lintDebug
run: ./gradlew :pillarbox-demo:lintProdDebug :pillarbox-demo-cast:lintDebug :pillarbox-demo-tv:lintDebug :pillarbox-player-testutils:lintDebug
- uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
Expand Down Expand Up @@ -138,6 +138,7 @@ jobs:
run: >
./gradlew
:pillarbox-analytics:koverXmlReportDebug
:pillarbox-cast:koverXmlReportDebug
:pillarbox-core-business:koverXmlReportDebug
:pillarbox-player:koverXmlReportDebug
:pillarbox-ui:koverXmlReportDebug
Expand Down
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ dependencyAnalysis {
}
}

project(":pillarbox-cast") {
onUnusedDependencies {
// This dependency is not used directly, but needed if we want to use the default Media3 cast receiver
exclude(libs.androidx.media3.cast)
}
}

project(":pillarbox-core-business") {
onUnusedDependencies {
// This dependency is not used directly, but required to be able to compile `CommandersActStreaming`
Expand All @@ -107,12 +114,5 @@ dependencyAnalysis {
exclude(libs.androidx.media3.dash, libs.androidx.media3.hls)
}
}

project(":pillarbox-cast") {
onUnusedDependencies {
// These dependencies are not used directly, but needed if we want to use the default Media3 cast receiver.
exclude(libs.androidx.media3.cast, libs.androidx.media3.common)
}
}
}
}
8 changes: 6 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ In your module's `build.gradle`/`build.gradle.kts` file, add the following depen
// Player specific features
implementation("ch.srgssr.pillarbox:pillarbox-player:<pillarbox_version>")

// Library to handle Cast integration
implementation("ch.srgssr.pillarbox:pillarbox-cast:<pillarbox_version>")

// Library to handle SRG SSR content through media URNs
implementation("ch.srgssr.pillarbox:pillarbox-core-business:<pillarbox_version>")

Expand Down Expand Up @@ -125,10 +128,11 @@ dependencies {
### Integrate Pillarbox

To start using Pillarbox in your project, you can check each module's documentation:
- [`pillarbox-player`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-player/docs/README.md)
- [`pillarbox-analytics`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-analytics/docs/README.md)
- [`pillarbox-cast`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-cast/docs/README.md)
- [`pillarbox-core-business`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-core-business/docs/README.md)
- [`pillarbox-player`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-player/docs/README.md)
- [`pillarbox-ui`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-ui/docs/README.md)
- [`pillarbox-analytics`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-analytics/docs/README.md)

## Contributing

Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ androidx-leanback = "1.0.0"
androidx-lifecycle = "2.7.0"
androidx-media = "1.7.0"
androidx-media3 = "1.3.1"
androidx-mediarouter = "1.3.0"

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.mediarouter:mediarouter than 1.3.0 is available: 1.7.0

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.mediarouter:mediarouter than 1.3.0 is available: 1.7.0

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.mediarouter:mediarouter than 1.3.0 is available: 1.7.0

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.mediarouter:mediarouter than 1.3.0 is available: 1.7.0

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.mediarouter:mediarouter than 1.3.0 is available: 1.7.0

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.mediarouter:mediarouter than 1.3.0 is available: 1.7.0
androidx-navigation = "2.7.7"
androidx-paging = "3.2.1"
androidx-test-core = "1.5.0"
Expand All @@ -29,7 +30,6 @@ kotlinx-coroutines = "1.8.0"
kotlinx-kover = "0.7.6"
kotlinx-serialization = "1.6.3"
ktor = "2.3.10"
mediarouter = "1.3.0"
mockk = "1.13.10"
okhttp = "4.12.0"
play-services-cast-framework = "21.3.0"
Expand All @@ -55,7 +55,7 @@ androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtim
androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
androidx-mediarouter = { module = "androidx.mediarouter:mediarouter", version.ref = "mediarouter" }
androidx-mediarouter = { module = "androidx.mediarouter:mediarouter", version.ref = "androidx-mediarouter" }
androidx-navigation-common = { module = "androidx.navigation:navigation-common", version.ref = "androidx-navigation" }
androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime", version.ref = "androidx-navigation" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
Expand Down Expand Up @@ -99,6 +99,7 @@ kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-guava = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-guava", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
androidx-media3-cast = { group = "androidx.media3", name = "media3-cast", version.ref = "androidx-media3" }
androidx-media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "androidx-media3" }
androidx-media3-datasource = { group = "androidx.media3", name = "media3-datasource", version.ref = "androidx-media3" }
androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "androidx-media3" }
Expand All @@ -107,7 +108,6 @@ androidx-media3-ui-leanback = { group = "androidx.media3", name = "media3-ui-lea
androidx-media3-dash = { group = "androidx.media3", name = "media3-exoplayer-dash", version.ref = "androidx-media3" }
androidx-media3-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "androidx-media3" }
androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "androidx-media3" }
androidx-media3-cast = { group = "androidx.media3", name = "media3-cast", version.ref = "androidx-media3" }
androidx-media3-test-utils = { module = "androidx.media3:media3-test-utils", version.ref = "androidx-media3" }
androidx-media3-test-utils-robolectric = { module = "androidx.media3:media3-test-utils-robolectric", version.ref = "androidx-media3" }
androidx-media = { group = "androidx.media", name = "media", version.ref = "androidx-media" }
Expand Down
24 changes: 3 additions & 21 deletions pillarbox-cast/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,13 @@ plugins {
alias(libs.plugins.pillarbox.android.library.tested.module)
}

android {
buildFeatures {
buildConfig = true
}

// Mockk includes some licenses information, which may conflict with other license files. This block merges all licenses together.
// Mockk excludes all licenses instead:
// https://github.com/mockk/mockk/blob/f879502a044c83c2a5fd52992f20903209eb34f3/modules/mockk-android/build.gradle.kts#L14-L19
packaging {
resources {
merges += "META-INF/LICENSE.md"
merges += "META-INF/LICENSE-notice.md"
}
}
}

dependencies {
// api(libs.androidx.media3.common)
api(libs.androidx.media3.cast)

implementation(platform(libs.androidx.compose.bom))
api(libs.play.services.cast.framework)
api(libs.androidx.compose.runtime)
api(libs.androidx.compose.ui)
api(libs.androidx.media3.cast)
implementation(libs.androidx.mediarouter)
implementation(libs.play.services.tasks)
implementation(libs.guava)
api(libs.play.services.cast.framework)
implementation(libs.play.services.tasks)
}
2 changes: 1 addition & 1 deletion pillarbox-cast/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This module provides helpers to integrate cast with Pillarbox.
implementation("ch.srgssr.pillarbox:pillarbox-cast:$LATEST_RELEASE_VERSION")
```

More information can be found on the [top level README](../docs/README.md)
More information can be found on the [top level README](../../docs/README.md)

## Documentation
- [Getting started](#getting-started)
Expand Down
4 changes: 1 addition & 3 deletions pillarbox-cast/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import com.google.android.gms.cast.framework.CastContext
import com.google.common.util.concurrent.MoreExecutors

/**
* Get the SharedInstance of [CastContext].
* Call this method inside Activity or Application.
* The more sooner, the better.
* Get the shared instance of [CastContext] if available, or initialize a new one.
* Call this method inside your [Activity][android.app.Activity] or [Application][android.app.Application].
* The sooner, the better.
*/
fun Context.getCastContext(): CastContext {
return CastContext.getSharedInstance() ?: CastContext.getSharedInstance(this, MoreExecutors.directExecutor()).result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.google.android.gms.cast.framework.CastButtonFactory
import com.google.android.gms.cast.framework.CastContext

/**
* Make sur to instantiate a [CastContext] before using it.
* Make sure to instantiate a [CastContext] before using it.
*/
@Composable
fun CastButton(
Expand Down
24 changes: 9 additions & 15 deletions pillarbox-demo-cast/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@ plugins {
alias(libs.plugins.pillarbox.android.application)
}


dependencies {
// implementation(project(":pillarbox-analytics"))
// implementation(project(":pillarbox-core-business"))
implementation(project(":pillarbox-demo-shared"))
// implementation(project(":pillarbox-player"))
// implementation(project(":pillarbox-ui"))
implementation(project(":pillarbox-cast"))
implementation(libs.kotlin.stdlib)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity)
implementation(libs.androidx.fragment)
implementation(libs.play.services.cast.framework)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.foundation.layout)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.text)
implementation(libs.androidx.compose.ui.unit)

debugImplementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.ui.unit)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.fragment)
implementation(libs.kotlin.stdlib)
implementation(libs.play.services.cast.framework)
}
3 changes: 2 additions & 1 deletion pillarbox-demo-cast/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ rootProject.name = "Pillarbox"

include(
":pillarbox-analytics",
":pillarbox-cast",
":pillarbox-core-business",
":pillarbox-demo",
":pillarbox-demo-cast",
":pillarbox-demo-shared",
":pillarbox-demo-tv",
":pillarbox-player",
":pillarbox-player-testutils",
":pillarbox-ui",
)
include(":pillarbox-cast")
include(":pillarbox-demo-cast")

0 comments on commit cedc7ab

Please sign in to comment.