Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #421

Merged
merged 9 commits into from
Feb 12, 2024
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: 1 addition & 1 deletion .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

concurrency:
group: build-${{ github.ref }}
group: build-on-windows-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle_wrapper_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

concurrency:
group: build-${{ github.ref }}
group: gradle-wrapper-validation-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
3 changes: 0 additions & 3 deletions buildSrc/src/main/java/AppConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ object AppConfig {
const val compileSdk = 34
val javaVersion = JavaVersion.VERSION_17

// https://developer.android.com/jetpack/androidx/releases/compose-kotlin
const val composeCompiler = "1.5.8"

@Suppress("SimpleDateFormat")
fun getBuildDate(): String {
val sdf = java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
Expand Down
35 changes: 10 additions & 25 deletions buildSrc/src/main/java/VersionConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,42 @@
*/
object VersionConfig {
/**
* Environement variable automatically set by Github actions.
* @see [github](https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables)
* Environment variable automatically set by GitHub actions.
* @see [GitHub](https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables)
*/
val isCI: Boolean = System.getenv("CI")?.toBooleanStrictOrNull() ?: false

/**
* Environement variable set by workflow.
* Environment variable set by workflow.
*/
private val ENV_VERSION_NAME: String? = System.getenv("VERSION_NAME")
private val versionRegex = "[0-9]+.[0-9].[0-9]-?\\S*".toRegex()
private val versionOnlyRegex = "[0-9]+.[0-9].[0-9]".toRegex()
private val versionSuffixRegex = "-\\S*".toRegex()

/**
* Maven artifact group
*/
const val GROUP = "ch.srgssr.pillarbox"

/**
* Semantic version
* @return Major.Minor.Patch string from [ENV_VERSION_NAME] or null if not set.
*/
fun semanticVersion(): String? {
return ENV_VERSION_NAME?.let { versionOnlyRegex.find(it)?.value }
}

/**
* Version name
*
* @return Local if [ENV_VERSION_NAME] no set.
* @return "Local" if [ENV_VERSION_NAME] no set.
*/
fun versionName(): String {
return ENV_VERSION_NAME ?: "Local"
}

/**
* @return -suffix from MARJOR.MINOR.PATCH-Suffix
*/
fun versionNameSuffix(): String? {
return ENV_VERSION_NAME?.let { versionSuffixRegex.find(it)?.value }
}

/**
* Version code
* It assumes that major.minor.patch each <= 99
* 0.0.0, 0.0.99, 0.1.0, 0.99.99
*/
fun versionCode(): Int {
return semanticVersion()?.let {
val versions = it.split(".").map { value -> value.toInt() }
versions[0] * 10000 + versions[1] * 100 + versions[2]
} ?: 9999
return ENV_VERSION_NAME
?.let { versionOnlyRegex.find(it)?.value }
?.let {
val versions = it.split(".").map { value -> value.toInt() }
versions[0] * 10000 + versions[1] * 100 + versions[2]
} ?: 9999
}
}
16 changes: 9 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[versions]
accompanist = "0.32.0"
android-gradle-plugin = "8.2.1"
accompanist = "0.34.0"
android-gradle-plugin = "8.2.2"
androidx-activity = "1.8.2"
androidx-annotation = "1.7.1"
androidx-compose = "2023.10.01"
androidx-compose = "2024.02.00"
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
androidx-compose-compiler = "1.5.9"
androidx-core = "1.12.0"
androidx-fragment = "1.6.2"
androidx-leanback = "1.0.0"
androidx-lifecycle = "2.7.0"
androidx-media = "1.7.0"
androidx-media3 = "1.2.1"
androidx-navigation = "2.7.6"
androidx-navigation = "2.7.7"
androidx-paging = "3.2.1"
androidx-test-core = "1.5.0"
androidx-test-ext-junit = "1.1.5"
Expand All @@ -20,7 +22,7 @@ androidx-tv = "1.0.0-alpha10"
coil = "2.5.0"
comscore = "6.10.0"
dependency-analysis-gradle-plugin = "1.29.0"
detekt = "1.23.4"
detekt = "1.23.5"
guava = "31.1-android"
jacoco = "0.8.11"
json = "20231013"
Expand All @@ -29,12 +31,12 @@ kotlin = "1.9.22"
kotlinx-coroutines = "1.7.3"
kotlinx-kover = "0.7.5"
kotlinx-serialization = "1.6.2"
ktor = "2.3.7"
ktor = "2.3.8"
mockk = "1.13.9"
okhttp = "4.12.0"
robolectric = "4.11.1"
srg-data-provider = "0.8.0"
tag-commander-core = "5.4.2"
tag-commander-core = "5.4.3"
tag-commander-server-side = "5.5.2"
turbine = "1.0.0"

Expand Down
1 change: 1 addition & 0 deletions pillarbox-analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ android {
}
buildFeatures {
buildConfig = true
resValues = false
}
publishing {
singleVariant("release") {
Expand Down
4 changes: 1 addition & 3 deletions pillarbox-analytics/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
~ Copyright (c) SRG SSR. All rights reserved.
~ License information is available from the LICENSE file.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
<manifest />
1 change: 1 addition & 0 deletions pillarbox-core-business/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ android {
}
buildFeatures {
buildConfig = true
resValues = false
}
publishing {
singleVariant("release") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import kotlin.time.Duration.Companion.seconds
class CommandersActTrackerTest {
private lateinit var commandersActDelegate: CommandersActDelegate


@Before
fun setup() {
CommandersActStreaming.HEART_BEAT_DELAY = HEART_BEAT_DELAY
Expand Down Expand Up @@ -259,7 +258,6 @@ class CommandersActTrackerTest {
val eventNames = ArrayList<String>()
val events = ArrayList<Event>()


override fun sendTcMediaEvent(event: TCMediaEvent) {
if (event.isPeriodicEvent() && ignorePeriodicEvents) return
eventNames.add(event.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ class LocalMediaCompositionDataSource(context: Context) : MediaCompositionDataSo
*/
const val VodShort = "urn:rts:video:13444428"
}

}
3 changes: 3 additions & 0 deletions pillarbox-demo-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ android {
kotlinOptions {
jvmTarget = AppConfig.javaVersion.majorVersion
}
buildFeatures {
resValues = false
}
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions pillarbox-demo-shared/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
~ Copyright (c) SRG SSR. All rights reserved.
~ License information is available from the LICENSE file.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ package ch.srgssr.pillarbox.demo.shared.ui

import androidx.annotation.StringRes
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ViewList
import androidx.compose.material.icons.filled.Home
import androidx.compose.material.icons.filled.Movie
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.ViewList
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.navigation.NavController
import androidx.navigation.NavGraph.Companion.findStartDestination
Expand Down Expand Up @@ -40,7 +40,7 @@ sealed class HomeDestination(
/**
* Integration layer list home page
*/
data object Lists : HomeDestination(NavigationRoutes.homeLists, R.string.lists, Icons.Default.ViewList)
data object Lists : HomeDestination(NavigationRoutes.homeLists, R.string.lists, Icons.AutoMirrored.Filled.ViewList)

/**
* Info home page
Expand Down
3 changes: 2 additions & 1 deletion pillarbox-demo-tv/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ android {
}
buildFeatures {
compose = true
resValues = false
}
lint {
// https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/dsl/Lint
Expand All @@ -58,7 +59,7 @@ android {
sarifOutput = file("${rootProject.rootDir}/build/reports/android-lint/pillarbox-demo-tv.sarif")
}
composeOptions {
kotlinCompilerExtensionVersion = AppConfig.composeCompiler
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}
}

Expand Down
3 changes: 2 additions & 1 deletion pillarbox-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ android {
buildFeatures {
buildConfig = true
compose = true
resValues = false
}

composeOptions {
kotlinCompilerExtensionVersion = AppConfig.composeCompiler
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}
lint {
// https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/dsl/Lint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package ch.srgssr.pillarbox.demo

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.DropdownMenu
Expand Down Expand Up @@ -97,7 +97,7 @@ fun MainNavigation() {
if (!topLevelRoutes.contains(it)) {
IconButton(onClick = { navController.navigateUp() }) {
Icon(
imageVector = Icons.Default.ArrowBack,
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = stringResource(R.string.navigate_up)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import ch.srgssr.pillarbox.demo.shared.data.DemoItem
import ch.srgssr.pillarbox.demo.shared.di.PlayerModule
import ch.srgssr.pillarbox.player.extension.toRational
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import java.net.URL

/**
Expand All @@ -33,15 +32,6 @@ class SimplePlayerViewModel(application: Application, ilHost: URL) : AndroidView
*/
val player = PlayerModule.provideDefaultPlayer(application, ilHost)

private val _pauseOnBackground = MutableStateFlow(true)
private val _displayNotification = MutableStateFlow(false)

/**
* Pause on background state
* True means playback is paused when Activity goes in background
*/
val pauseOnBackground: StateFlow<Boolean> = _pauseOnBackground

/**
* Picture in picture enabled
*/
Expand Down Expand Up @@ -84,29 +74,6 @@ class SimplePlayerViewModel(application: Application, ilHost: URL) : AndroidView
player.play()
}

/**
* Enable pause on background
*
* @param enabled
*/
fun enablePauseOnBackground(enabled: Boolean) {
_pauseOnBackground.value = enabled
}

/**
* Toggle pause on background
*/
fun togglePauseOnBackground() {
_pauseOnBackground.value = !_pauseOnBackground.value
}

/**
* Toggle display notification
*/
fun toggleDisplayNotification() {
_displayNotification.value = !_displayNotification.value
}

override fun onCleared() {
super.onCleared()
Log.d(TAG, "onCleared => releasing the player")
Expand Down
Loading
Loading