From c6c96db7002af6e2d10342cef0586ea8df51dea5 Mon Sep 17 00:00:00 2001 From: Aleksander Nowakowski Date: Tue, 27 Aug 2024 13:26:45 +0200 Subject: [PATCH] Dependencies updated --- ble-ktx/build.gradle | 2 +- ble-livedata/build.gradle | 2 +- ble/build.gradle | 2 +- build.gradle | 10 ++++--- examples/ble-gatt-client/build.gradle | 8 +++--- examples/ble-gatt-server/build.gradle | 8 +++--- examples/trivia/build.gradle | 27 +++++++++---------- .../android/ble/trivia/client/ClientScreen.kt | 13 ++++++--- .../android/ble/trivia/server/ServerScreen.kt | 14 +++++++--- .../android/ble/trivia/view/StartScreen.kt | 4 +-- gradle/wrapper/gradle-wrapper.properties | 4 +-- test/build.gradle | 25 +++++++++-------- .../nordicsemi/andorid/ble/test/HomeScreen.kt | 6 +++-- .../ble/test/client/view/ClientScreen.kt | 7 +++-- .../ble/test/server/view/ServerScreen.kt | 7 +++-- 15 files changed, 79 insertions(+), 60 deletions(-) diff --git a/ble-ktx/build.gradle b/ble-ktx/build.gradle index 8506aaab..bda1d9f0 100644 --- a/ble-ktx/build.gradle +++ b/ble-ktx/build.gradle @@ -38,7 +38,7 @@ android { dependencies { api project(':ble') - api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' + api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1' } // === Maven Central configuration === diff --git a/ble-livedata/build.gradle b/ble-livedata/build.gradle index 5c4f258e..5ee4d4bd 100644 --- a/ble-livedata/build.gradle +++ b/ble-livedata/build.gradle @@ -35,7 +35,7 @@ dependencies { api project(':ble') // https://developer.android.com/jetpack/androidx/releases/lifecycle - api 'androidx.lifecycle:lifecycle-livedata:2.6.2' + api 'androidx.lifecycle:lifecycle-livedata:2.8.4' } // === Maven Central configuration === diff --git a/ble/build.gradle b/ble/build.gradle index b994566a..4dfea8de 100644 --- a/ble/build.gradle +++ b/ble/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - api 'androidx.annotation:annotation:1.7.0' + api 'androidx.annotation:annotation:1.8.2' testImplementation 'junit:junit:4.13.2' } diff --git a/build.gradle b/build.gradle index 1b8ba89c..882aa572 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,20 @@ buildscript { // https://kotlinlang.org/docs/releases.html#release-details - ext.kotlin_version = '1.9.10' + ext.kotlin_version = '2.0.20' // https://plugins.gradle.org/plugin/io.github.gradle-nexus.publish-plugin ext.gradle_nexus_publish_plugin = '1.3.0' repositories { google() mavenCentral() + gradlePluginPortal() maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.google.dagger:hilt-android-gradle-plugin:2.48" + classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version" + classpath "com.google.dagger:hilt-android-gradle-plugin:2.51.1" classpath "io.github.gradle-nexus:publish-plugin:$gradle_nexus_publish_plugin" classpath "com.squareup.wire:wire-gradle-plugin:4.7.0" } @@ -26,7 +28,7 @@ allprojects { } } -task clean(type: Delete) { +tasks.register('clean', Delete) { delete rootProject.buildDir } diff --git a/examples/ble-gatt-client/build.gradle b/examples/ble-gatt-client/build.gradle index 52a172c7..07d43d29 100644 --- a/examples/ble-gatt-client/build.gradle +++ b/examples/ble-gatt-client/build.gradle @@ -39,13 +39,13 @@ android { } dependencies { - implementation 'androidx.core:core-ktx:1.12.0' - implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation project(':ble-ktx') testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/examples/ble-gatt-server/build.gradle b/examples/ble-gatt-server/build.gradle index 7a0f02ec..f43cb5be 100644 --- a/examples/ble-gatt-server/build.gradle +++ b/examples/ble-gatt-server/build.gradle @@ -39,13 +39,13 @@ android { } dependencies { - implementation 'androidx.core:core-ktx:1.12.0' - implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation project(':ble-ktx') testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/examples/trivia/build.gradle b/examples/trivia/build.gradle index 9a78c0e4..bcd3aed0 100644 --- a/examples/trivia/build.gradle +++ b/examples/trivia/build.gradle @@ -5,6 +5,7 @@ plugins { id 'kotlin-kapt' id 'dagger.hilt.android.plugin' id 'com.squareup.wire' + id 'org.jetbrains.kotlin.plugin.compose' } android { @@ -37,9 +38,6 @@ android { compose true buildConfig true } - composeOptions { - kotlinCompilerExtensionVersion '1.5.3' - } packagingOptions { resources { excludes += '/META-INF/{AL2.0,LGPL2.1}' @@ -55,22 +53,23 @@ dependencies { implementation project(path: ':ble-ktx') // Dagger and Hilt - implementation 'com.google.dagger:hilt-android:2.48' - kapt 'com.google.dagger:hilt-compiler:2.48' - implementation 'androidx.hilt:hilt-navigation-compose:1.0.0' - kapt 'androidx.hilt:hilt-compiler:1.0.0' + implementation 'com.google.dagger:hilt-android:2.51.1' + kapt 'com.google.dagger:hilt-compiler:2.51.1' + implementation 'androidx.hilt:hilt-navigation-compose:1.2.0' + kapt 'androidx.hilt:hilt-compiler:1.2.0' // Nordic theme - implementation 'no.nordicsemi.android.common:theme:1.8.4' - implementation 'no.nordicsemi.android.common:permissions-ble:1.8.4' - implementation 'no.nordicsemi.android.common:navigation:1.8.4' + implementation 'no.nordicsemi.android.common:ui:2.0.0' + implementation 'no.nordicsemi.android.common:theme:2.0.0' + implementation 'no.nordicsemi.android.common:permissions-ble:2.0.0' + implementation 'no.nordicsemi.android.common:navigation:2.0.0' // Jetpack Compose bom - implementation platform('androidx.compose:compose-bom:2023.08.00') + implementation platform('androidx.compose:compose-bom:2024.08.00') // Text, color, Surface implementation "androidx.compose.material3:material3" - implementation 'androidx.activity:activity-compose:1.8.0' + implementation 'androidx.activity:activity-compose:1.9.1' implementation "androidx.compose.runtime:runtime-livedata" // To show Preview @@ -78,8 +77,8 @@ dependencies { implementation 'androidx.compose.ui:ui-tooling-preview' // Retrofit - implementation 'com.squareup.retrofit2:retrofit:2.9.0' - implementation 'com.squareup.retrofit2:converter-moshi:2.9.0' + implementation 'com.squareup.retrofit2:retrofit:2.11.0' + implementation 'com.squareup.retrofit2:converter-moshi:2.11.0' implementation 'com.squareup.okhttp3:okhttp:4.10.0' // https://square.github.io/okhttp/changelog/ implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' diff --git a/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/client/ClientScreen.kt b/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/client/ClientScreen.kt index fb3a24d8..07455f00 100644 --- a/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/client/ClientScreen.kt +++ b/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/client/ClientScreen.kt @@ -3,6 +3,7 @@ package no.nordicsemi.android.ble.trivia.client import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Text import androidx.compose.runtime.* import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Modifier @@ -18,7 +19,7 @@ import no.nordicsemi.android.ble.trivia.server.view.ResultView import no.nordicsemi.android.ble.ktx.state.ConnectionState import no.nordicsemi.android.common.permissions.ble.RequireBluetooth import no.nordicsemi.android.common.permissions.ble.RequireLocation -import no.nordicsemi.android.common.theme.view.NordicAppBar +import no.nordicsemi.android.common.ui.view.NordicAppBar @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -28,9 +29,13 @@ fun ClientScreen( Column { var playersName by rememberSaveable { mutableStateOf("") } NordicAppBar( - text = when (playersName.isNotEmpty()) { - true -> stringResource(id = R.string.good_luck_player, playersName) - else -> stringResource(id = R.string.good_luck_player, "") + title = { + Text( + text = when (playersName.isNotEmpty()) { + true -> stringResource(id = R.string.good_luck_player, playersName) + else -> stringResource(id = R.string.good_luck_player, "") + } + ) }, onNavigationButtonClick = onNavigationUp ) diff --git a/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/server/ServerScreen.kt b/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/server/ServerScreen.kt index 63222bdb..552a71eb 100644 --- a/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/server/ServerScreen.kt +++ b/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/server/ServerScreen.kt @@ -3,6 +3,7 @@ package no.nordicsemi.android.ble.trivia.server import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Text import androidx.compose.runtime.* import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Modifier @@ -22,7 +23,7 @@ import no.nordicsemi.android.ble.trivia.server.view.StartGameView import no.nordicsemi.android.ble.trivia.server.view.WaitingForClientsView import no.nordicsemi.android.ble.trivia.server.viewmodel.ServerViewModel import no.nordicsemi.android.common.permissions.ble.RequireBluetooth -import no.nordicsemi.android.common.theme.view.NordicAppBar +import no.nordicsemi.android.common.ui.view.NordicAppBar @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -32,10 +33,15 @@ fun ServerScreen( Column { var playersName by rememberSaveable { mutableStateOf("") } NordicAppBar( - text = when (playersName.isNotEmpty()) { - true -> stringResource(id = R.string.good_luck_player, playersName) - else -> stringResource(id = R.string.good_luck_player, "") + title = { + Text( + text = when (playersName.isNotEmpty()) { + true -> stringResource(id = R.string.good_luck_player, playersName) + else -> stringResource(id = R.string.good_luck_player, "") + } + ) }, + onNavigationButtonClick = onNavigationUp ) diff --git a/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/view/StartScreen.kt b/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/view/StartScreen.kt index 364ed454..48dfe270 100644 --- a/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/view/StartScreen.kt +++ b/examples/trivia/src/main/java/no/nordicsemi/android/ble/trivia/view/StartScreen.kt @@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import no.nordicsemi.android.ble.trivia.R -import no.nordicsemi.android.common.theme.view.NordicAppBar +import no.nordicsemi.android.common.ui.view.NordicAppBar @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -20,7 +20,7 @@ fun StartScreen( ) { Column { NordicAppBar( - text = stringResource(id = R.string.welcome_message) + title = { Text(text = stringResource(id = R.string.welcome_message)) }, ) Column( diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 752a82bb..45551b72 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Apr 15 11:00:45 CEST 2021 +#Tue Aug 27 10:46:52 CEST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip diff --git a/test/build.gradle b/test/build.gradle index 7ff604e0..f3ce8027 100644 --- a/test/build.gradle +++ b/test/build.gradle @@ -3,6 +3,7 @@ plugins { id 'org.jetbrains.kotlin.android' id 'kotlin-kapt' id 'dagger.hilt.android.plugin' + id 'org.jetbrains.kotlin.plugin.compose' } android { @@ -38,9 +39,6 @@ android { buildFeatures { compose true } - composeOptions { - kotlinCompilerExtensionVersion '1.5.3' - } packagingOptions { resources { excludes += '/META-INF/{AL2.0,LGPL2.1}' @@ -51,29 +49,30 @@ android { dependencies { implementation project(path: ':ble-ktx') // Nordic theme - implementation "no.nordicsemi.android.common:theme:1.8.4" - implementation 'no.nordicsemi.android.common:permissions-ble:1.8.4' - implementation 'no.nordicsemi.android.common:navigation:1.8.4' + implementation "no.nordicsemi.android.common:ui:2.0.0" + implementation "no.nordicsemi.android.common:theme:2.0.0" + implementation 'no.nordicsemi.android.common:permissions-ble:2.0.0' + implementation 'no.nordicsemi.android.common:navigation:2.0.0' implementation 'com.github.jeziellago:compose-markdown:0.3.6' // Jetpack Compose bom - implementation platform('androidx.compose:compose-bom:2023.08.00') + implementation platform('androidx.compose:compose-bom:2024.08.00') // Text, Color, Surface implementation 'androidx.compose.material3:material3' - implementation 'androidx.activity:activity-compose:1.8.0' - implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.2" + implementation 'androidx.activity:activity-compose:1.9.1' + implementation "androidx.lifecycle:lifecycle-runtime-compose:2.8.4" // Preview debugImplementation "androidx.compose.ui:ui-tooling" implementation "androidx.compose.ui:ui-tooling-preview" // Dagger and Hilt - implementation 'com.google.dagger:hilt-android:2.48' - kapt 'com.google.dagger:hilt-compiler:2.48' - implementation 'androidx.hilt:hilt-navigation-compose:1.0.0' - kapt 'androidx.hilt:hilt-compiler:1.0.0' + implementation 'com.google.dagger:hilt-android:2.51.1' + kapt 'com.google.dagger:hilt-compiler:2.51.1' + implementation 'androidx.hilt:hilt-navigation-compose:1.2.0' + kapt 'androidx.hilt:hilt-compiler:1.2.0' // Test testImplementation 'junit:junit:4.13.2' diff --git a/test/src/main/java/no/nordicsemi/andorid/ble/test/HomeScreen.kt b/test/src/main/java/no/nordicsemi/andorid/ble/test/HomeScreen.kt index c773a641..2872d60b 100644 --- a/test/src/main/java/no/nordicsemi/andorid/ble/test/HomeScreen.kt +++ b/test/src/main/java/no/nordicsemi/andorid/ble/test/HomeScreen.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import no.nordicsemi.android.common.theme.view.NordicAppBar +import no.nordicsemi.android.common.ui.view.NordicAppBar @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -18,7 +18,9 @@ fun HomeScreen( onScanNavigation: () -> Unit, ) { Column { - NordicAppBar(text = stringResource(id = R.string.welcome_message)) + NordicAppBar( + title = { Text(text = stringResource(id = R.string.welcome_message)) } + ) Column( modifier = Modifier .padding(16.dp) diff --git a/test/src/main/java/no/nordicsemi/andorid/ble/test/client/view/ClientScreen.kt b/test/src/main/java/no/nordicsemi/andorid/ble/test/client/view/ClientScreen.kt index 3f69fdd1..42258313 100644 --- a/test/src/main/java/no/nordicsemi/andorid/ble/test/client/view/ClientScreen.kt +++ b/test/src/main/java/no/nordicsemi/andorid/ble/test/client/view/ClientScreen.kt @@ -2,6 +2,7 @@ package no.nordicsemi.andorid.ble.test.client.view import androidx.compose.foundation.layout.Column import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.res.stringResource @@ -14,13 +15,15 @@ import no.nordicsemi.andorid.ble.test.server.view.ResultView import no.nordicsemi.android.ble.ktx.state.ConnectionState import no.nordicsemi.android.common.permissions.ble.RequireBluetooth import no.nordicsemi.android.common.permissions.ble.RequireLocation -import no.nordicsemi.android.common.theme.view.NordicAppBar +import no.nordicsemi.android.common.ui.view.NordicAppBar @OptIn(ExperimentalMaterial3Api::class) @Composable fun ClientScreen() { Column { - NordicAppBar(text = stringResource(id = R.string.scanner)) + NordicAppBar( + title = { Text(text = stringResource(id = R.string.scanner)) } + ) RequireBluetooth { RequireLocation { val clientViewModel: ClientViewModel = hiltViewModel() diff --git a/test/src/main/java/no/nordicsemi/andorid/ble/test/server/view/ServerScreen.kt b/test/src/main/java/no/nordicsemi/andorid/ble/test/server/view/ServerScreen.kt index 18f4700e..38afb8e9 100644 --- a/test/src/main/java/no/nordicsemi/andorid/ble/test/server/view/ServerScreen.kt +++ b/test/src/main/java/no/nordicsemi/andorid/ble/test/server/view/ServerScreen.kt @@ -2,6 +2,7 @@ package no.nordicsemi.andorid.ble.test.server.view import androidx.compose.foundation.layout.Column import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.res.stringResource @@ -11,13 +12,15 @@ import no.nordicsemi.andorid.ble.test.R import no.nordicsemi.andorid.ble.test.server.viewmodel.ServerViewModel import no.nordicsemi.andorid.ble.test.server.viewmodel.WaitingForClient import no.nordicsemi.android.common.permissions.ble.RequireBluetooth -import no.nordicsemi.android.common.theme.view.NordicAppBar +import no.nordicsemi.android.common.ui.view.NordicAppBar @OptIn(ExperimentalMaterial3Api::class) @Composable fun ServerScreen() { Column { - NordicAppBar(text = stringResource(id = R.string.advertiser)) + NordicAppBar( + title = { Text(text = stringResource(id = R.string.advertiser)) } + ) RequireBluetooth { val serverViewModel: ServerViewModel = hiltViewModel() val serverViewState by serverViewModel.serverViewState.collectAsStateWithLifecycle()