Skip to content

Commit

Permalink
Merge branch 'main' into ktor2
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 authored Nov 27, 2024
2 parents 8be3fa6 + 0a658dc commit c549cdb
Show file tree
Hide file tree
Showing 65 changed files with 1,005 additions and 380 deletions.
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ updates:
- "ch.srg*"
ignore:
- dependency-name: "com.comscore:*"
- dependency-name: "com.google.guava:*" # Guava is updated together with AndroidX Media3
- dependency-name: "com.tagcommander.lib:*"
- dependency-name: "io.ktor:*"
- dependency-name: "io.ktor:*" # We don't want to update to Ktor 3 yet
5 changes: 0 additions & 5 deletions .github/gradle-ci.properties

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- 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-cast:assembleDebug :pillarbox-demo-tv:assembleDebug :pillarbox-player-testutils:assembleDebug

Expand All @@ -51,8 +49,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- 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-cast:lintDebug :pillarbox-demo-tv:lintDebug :pillarbox-player-testutils:lintDebug
- uses: github/codeql-action/upload-sarif@v3
Expand All @@ -78,8 +74,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Run Detekt
run: ./gradlew detekt
- uses: github/codeql-action/upload-sarif@v3
Expand All @@ -105,8 +99,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Run Dependency Analysis
run: ./gradlew buildHealth

Expand All @@ -129,8 +121,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Run Unit Tests
run: >
./gradlew
Expand Down Expand Up @@ -179,8 +169,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Run Android Tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Build project
run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-tv:assembleDebug
2 changes: 0 additions & 2 deletions .github/workflows/deploy_dokka_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Build Dokka documentation
run: ./gradlew :dokkaGenerate
- name: Deploy Dokka documentation
Expand Down
5 changes: 3 additions & 2 deletions build-logic/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* License information is available from the LICENSE file.
*/

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -18,8 +19,8 @@ java {
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.majorVersion
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ class PillarboxAndroidLibraryPublishingPlugin : Plugin<Project> {

extensions.configure<DokkaExtension> {
dokkaSourceSets.getByName("main") {
if (file("Module.md").exists()) {
includes.from("Module.md")
} else {
includes.from("docs/README.md")
}
includes.from("docs/README.md")

externalDocumentationLinks.register("kotlinx.coroutines") {
url.set(URI("https://kotlinlang.org/api/kotlinx.coroutines"))
Expand Down Expand Up @@ -122,11 +118,11 @@ class PillarboxAndroidLibraryPublishingPlugin : Plugin<Project> {

// Follow https://github.com/Kotlin/dokka/issues/3883 to see if it's necessary to duplicate this config
pluginsConfiguration.getByName<DokkaHtmlPluginParameters>("html") {
customStyleSheets.from(rootProject.projectDir.resolve("dokka/styles/pillarbox.css"))
customStyleSheets.from(rootProject.projectDir.resolve("config/dokka/styles/pillarbox.css"))
footerMessage.set("© SRG SSR")
// TODO Enable this once we have some content there
// homepageLink.set("https://android.pillarbox.ch/")
templatesDir.set(rootProject.projectDir.resolve("dokka/templates"))
templatesDir.set(rootProject.projectDir.resolve("config/dokka/templates"))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ internal fun Project.configureAndroidLintModule(extension: CommonExtension<*, *,
checkAllWarnings = true
checkDependencies = true
sarifReport = true
sarifOutput = file("${rootProject.rootDir}/build/reports/android-lint/$name.sarif")
sarifOutput = rootProject.projectDir.resolve("build/reports/android-lint/$name.sarif")
disable.add("LogConditional")
}
}
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ dokka {
moduleVersion = providers.environmentVariable("VERSION_NAME").orElse("dev")

dokkaPublications.html {
includes.from("dokka/Pillarbox.md")
includes.from("config/dokka/Pillarbox.md")
}

pluginsConfiguration.html {
// See the overridable images here:
// https://github.com/Kotlin/dokka/tree/master/dokka-subprojects/plugin-base/src/main/resources/dokka/images
customAssets.from("dokka/images/logo-icon.svg") // TODO Use Pillarbox logo
customStyleSheets.from("dokka/styles/pillarbox.css")
customAssets.from("config/dokka/images/logo-icon.svg") // TODO Use Pillarbox logo
customStyleSheets.from("config/dokka/styles/pillarbox.css")
footerMessage.set("© SRG SSR")
// TODO Enable this once we have some content there
// homepageLink.set("https://android.pillarbox.ch/")
templatesDir.set(file("dokka/templates"))
templatesDir.set(file("config/dokka/templates"))
}
}

Expand Down Expand Up @@ -61,8 +61,8 @@ val clean by tasks.getting(Delete::class) {
*/
val installGitHook by tasks.registering(Copy::class) {
description = "Install the Git pre-commit hook locally"
from(file("${rootProject.rootDir}/git_hooks/pre-commit"))
into { file("${rootProject.rootDir}/.git/hooks") }
from(rootProject.projectDir.resolve("config/git/pre-commit"))
into { rootProject.projectDir.resolve(".git/hooks") }
filePermissions {
unix("rwxr-xr-x")
}
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 13 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,40 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# https://docs.gradle.org/current/userguide/performance.html#increase_the_heap_size
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution
org.gradle.parallel=true

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
# https://developer.android.com/jetpack/androidx#using_androidx_libraries_in_your_project
android.useAndroidX=true

# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

# Gradle's Build Cache
# https://docs.gradle.org/current/userguide/performance.html#enable_the_build_cache
org.gradle.caching=true

# Gradle's Configuration Cache
# https://docs.gradle.org/current/userguide/performance.html#enable_configuration_cache
# Disable configuration cache until Dokka supports it: https://github.com/Kotlin/dokka/issues/1217
org.gradle.configuration-cache=false
org.gradle.configuration-cache.parallel=true

# Print dependency analysis report to the console
dependency.analysis.print.build.health=true

# Let Detekt use Gradle's Worker API (https://detekt.dev/docs/gettingstarted/gradle/#options-for-detekt-gradle-properties)
# Let Detekt use Gradle's Worker API
# https://detekt.dev/docs/gettingstarted/gradle/#options-for-detekt-gradle-properties
detekt.use.worker.api=true

# Use Dokka 2 Gradle Plugin: https://kotlinlang.org/docs/dokka-migration.html#migrate-your-project
# Use Dokka 2 Gradle Plugin
# https://kotlinlang.org/docs/dokka-migration.html#migrate-your-project
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
25 changes: 15 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
android-gradle-plugin = "8.7.2"
androidx-activity = "1.9.3"
androidx-annotation = "1.9.1"
androidx-compose = "2024.10.01"
androidx-compose = "2024.11.00"
androidx-compose-material-navigation = "1.7.0-beta01" # TODO Remove this once https://issuetracker.google.com/issues/347719428 is resolved
androidx-core = "1.15.0"
androidx-datastore = "1.1.1"
androidx-fragment = "1.8.5"
androidx-lifecycle = "2.8.7"
androidx-media3 = "1.4.1"
androidx-navigation = "2.8.3"
androidx-paging = "3.3.2"
androidx-media3 = "1.5.0"
androidx-navigation = "2.8.4"
androidx-paging = "3.3.4"
androidx-test-core = "1.6.1"
androidx-test-ext-junit = "1.2.1"
androidx-test-monitor = "1.7.2"
androidx-test-runner = "1.6.2"
androidx-tv-material = "1.0.0"
coil = "2.7.0"
coil = "3.0.3"
comscore = "6.11.1"
dependency-analysis-gradle-plugin = "2.4.2"
dependency-analysis-gradle-plugin = "2.5.0"
detekt = "1.23.7"
dokka = "2.0.0-Beta"
guava = "33.0.0-android"
guava = "33.3.1-android"
json = "20240303"
junit = "4.13.2"
kotlin = "2.0.21"
Expand All @@ -32,7 +32,7 @@ kotlinx-serialization = "1.7.3"
ktor = "2.3.13"
mockk = "1.13.13"
okhttp = "4.12.0"
robolectric = "4.14"
robolectric = "4.14.1"
srg-data-provider = "0.10.1"
tag-commander-core = "5.4.3"
tag-commander-server-side = "5.5.2"
Expand Down Expand Up @@ -63,8 +63,12 @@ androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-te
androidx-test-monitor = { module = "androidx.test:monitor", version.ref = "androidx-test-monitor" }
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" }
androidx-tv-material = { module = "androidx.tv:tv-material", version.ref = "androidx-tv-material" }
coil = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
coil-base = { module = "io.coil-kt:coil-compose-base", version.ref = "coil" }
coil = { group = "io.coil-kt.coil3", name = "coil", version.ref = "coil" }
coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil" }
coil-core = { group = "io.coil-kt.coil3", name = "coil-core", version.ref = "coil" }
coil-network-cache-control = { group = "io.coil-kt.coil3", name = "coil-network-cache-control", version.ref = "coil" }
coil-network-core = { group = "io.coil-kt.coil3", name = "coil-network-core", version.ref = "coil" }
coil-network-okhttp = { group = "io.coil-kt.coil3", name = "coil-network-okhttp", version.ref = "coil" }
dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
json = { module = "org.json:json", version.ref = "json" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
Expand Down Expand Up @@ -102,6 +106,7 @@ androidx-media3-cast = { group = "androidx.media3", name = "media3-cast", versio
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-datasource-okhttp = { group = "androidx.media3", name = "media3-datasource-okhttp", version.ref = "androidx-media3" }
androidx-media3-decoder = { group = "androidx.media3", name = "media3-decoder", version.ref = "androidx-media3" }
androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "androidx-media3" }
androidx-media3-ui = { group = "androidx.media3", name = "media3-ui", version.ref = "androidx-media3" }
androidx-media3-dash = { group = "androidx.media3", name = "media3-exoplayer-dash", version.ref = "androidx-media3" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion pillarbox-analytics/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and custom events.

## Integration

To use this module, add the following dependency to your project's `build.gradle`/`build.gradle.kts` file:
To use this module, add the following dependency to your module's `build.gradle`/`build.gradle.kts` file:

```kotlin
implementation("ch.srgssr.pillarbox:pillarbox-analytics:<pillarbox_version>")
Expand Down
2 changes: 1 addition & 1 deletion pillarbox-cast/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides helpers to integrate Cast with Pillarbox.

## Integration

To use this module, add the following dependency to your project's `build.gradle`/`build.gradle.kts` file:
To use this module, add the following dependency to your module's `build.gradle`/`build.gradle.kts` file:

```kotlin
implementation("ch.srgssr.pillarbox:pillarbox-cast:<pillarbox_version>")
Expand Down
1 change: 1 addition & 0 deletions pillarbox-core-business/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
api(libs.androidx.media3.common)
api(libs.androidx.media3.datasource)
implementation(libs.androidx.media3.datasource.okhttp)
implementation(libs.androidx.media3.decoder)
api(libs.androidx.media3.exoplayer)
implementation(libs.guava)
runtimeOnly(libs.kotlinx.coroutines.android)
Expand Down
2 changes: 1 addition & 1 deletion pillarbox-core-business/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The supported contents are:

## Integration

To use this module, add the following dependency to your project's `build.gradle`/`build.gradle.kts` file:
To use this module, add the following dependency to your module's `build.gradle`/`build.gradle.kts` file:

```kotlin
implementation("ch.srgssr.pillarbox:pillarbox-core-business:<pillarbox_version>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import kotlinx.serialization.Serializable
* @property timeIntervalList List of time intervals relevant to the chapter.
* @property validFrom The [Instant] when the [Chapter] becomes valid.
* @property validTo The [Instant] until when the [Chapter] is valid.
* @property spriteSheet The [SpriteSheet] information if available.
*/
@Serializable
data class Chapter(
Expand All @@ -51,6 +52,7 @@ data class Chapter(
val timeIntervalList: List<TimeInterval>? = null,
val validFrom: Instant? = null,
val validTo: Instant? = null,
val spriteSheet: SpriteSheet? = null,
) : DataWithAnalytics {
/**
* Indicates whether this represents a full-length chapter.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) SRG SSR. All rights reserved.
* License information is available from the LICENSE file.
*/
package ch.srgssr.pillarbox.core.business.integrationlayer.data

import kotlinx.serialization.Serializable

/**
* Represents a sprite sheet containing multiple thumbnail images arranged in a grid.
*
* @property urn The URN of the media.
* @property rows The number of rows in the sprite sheet.
* @property columns The number of columns in the sprite sheet.
* @property thumbnailHeight The height of each thumbnail image, in pixels.
* @property thumbnailWidth The width of each thumbnail image, in pixels.
* @property interval The interval between two thumbnail images, in milliseconds.
* @property url The URL of the sprite sheet image.
*/
@Serializable
data class SpriteSheet(
val urn: String,
val rows: Int,
val columns: Int,
val thumbnailHeight: Int,
val thumbnailWidth: Int,
val interval: Long,
val url: String
)
Loading

0 comments on commit c549cdb

Please sign in to comment.