Skip to content

Commit ef8dd51

Browse files
dkhawkkikoso
andauthored
feat(deps): update dependencies and deprecated fields (#279)
* feat(deps): update dependencies and deprecated fields This commit updates several dependencies to their latest versions, including Kotlin, Gradle, and the Places SDK. It also replaces the deprecated `Place.Field.NAME` with `Place.Field.DISPLAY_NAME` throughout the test suite. * feat: Update target SDK to 36 This commit updates the `targetSdk` and `compileSdk` to version 36. It also adds the `POST_NOTIFICATIONS` permission to the demo app's `AndroidManifest.xml`, due to the Glide dependency. * fix: back to SDK version 34 * fix(build): update test workflow Updates the test workflow to use newer versions of the following actions: - actions/checkout@v4 - gradle/actions/wrapper-validation@v4 - actions/setup-java@v4.2.1 * fix(build): revert coreKtx to 1.13.1 * chore: added hilt compiler to catalog --------- Co-authored-by: Enrique López Mañas <eenriquelopez@gmail.com>
1 parent 397dfef commit ef8dd51

File tree

9 files changed

+41
-40
lines changed

9 files changed

+41
-40
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,21 @@ on:
2828
jobs:
2929
test:
3030
runs-on: ubuntu-latest
31-
31+
permissions:
32+
pull-requests: write
3233
steps:
3334
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3435
- name: Checkout Repo
35-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3637

3738
- name: Gradle Wrapper Validation
38-
uses: gradle/wrapper-validation-action@v1.0.4
39+
uses: gradle/actions/wrapper-validation@v4
3940

4041
- name: Set up JDK 17
41-
uses: actions/setup-java@v3
42+
uses: actions/setup-java@v4.2.1
4243
with:
4344
java-version: '17'
4445
distribution: 'temurin'
4546

4647
- name: Build modules
47-
run: ./gradlew build jacocoTestReport --stacktrace
48+
run: ./gradlew build jacocoTestDebugUnitTestReport --stacktrace

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ dependencies {
7474

7575
// Hilt
7676
implementation libs.hilt.android
77-
kapt "com.google.dagger:hilt-android-compiler:2.56"
77+
kapt libs.hilt.android.compiler
7878

7979
implementation project(':places-ktx')
8080
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<uses-permission
2626
android:name="android.permission.ACCESS_COARSE_LOCATION"
2727
tools:node="remove" />
28+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
2829

2930
<application
3031
android:name=".DemoApplication"
@@ -50,4 +51,4 @@
5051
android:name=".PlacesSearchDemoActivity"
5152
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" />
5253
</application>
53-
</manifest>
54+
</manifest>

build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ buildscript {
3131
}
3232

3333
plugins {
34-
id "org.jetbrains.dokka" version "1.9.10"
34+
id "org.jetbrains.dokka" version "2.0.0"
3535
id "com.vanniktech.maven.publish" version "0.34.0" apply false
3636
}
3737

38-
39-
4038
ext.projectArtifactId = { project ->
4139
if (project.name == 'places-ktx') {
4240
return project.name

gradle/libs.versions.toml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
[versions]
22
androidCompileSdk = "34"
3-
androidMinSdk = "23"
43
androidTargetSdk = "34"
4+
androidMinSdk = "23"
55

6-
appcompat = "1.7.0"
6+
appcompat = "1.7.1"
77
coreKtx = "1.13.1"
8-
dokkaGradlePlugin = "1.9.20"
9-
fragmentKtx = "1.8.3"
10-
gradle = "8.6.1"
11-
hiltAndroid = "2.51.1"
8+
dokkaGradlePlugin = "2.0.0"
9+
fragmentKtx = "1.8.9"
10+
gradle = "8.12.0"
11+
hiltAndroid = "2.57"
1212
jacocoAndroid = "0.2.1"
13-
kotlin = "2.0.0"
14-
kotlinGradlePlugin = "1.9.24"
15-
kotlinx-coroutines-core = "1.8.1"
16-
lifecycle-viewmodel-ktx = "2.8.6"
13+
kotlin = "2.2.0"
14+
kotlinGradlePlugin = "2.2.0"
15+
kotlinx-coroutines-core = "1.10.2"
16+
lifecycle-viewmodel-ktx = "2.9.2"
1717
material = "1.12.0"
18-
playServicesMaps = "19.0.0"
18+
playServicesMaps = "19.2.0"
1919
secretsGradlePlugin = "2.0.1"
20-
truth = "1.4.2"
20+
truth = "1.4.4"
2121
volley = "1.2.1"
2222
multidex = "2.0.1"
23-
kotlinx-coroutines-play-services = "1.8.1"
24-
places = "4.0.0"
25-
junit-ext = "1.2.1"
26-
test-core = "1.6.1"
23+
kotlinx-coroutines-play-services = "1.10.2"
24+
places = "4.4.1"
25+
junit-ext = "1.3.0"
26+
test-core = "1.7.0"
2727
mockito-kotlin = "2.2.0"
2828
junit = "4.13.2"
29-
mockito-core = "5.11.0"
29+
mockito-core = "5.18.0"
3030
gradleMavenPublishPlugin = "0.34.0"
3131

3232
[libraries]
@@ -36,6 +36,7 @@ dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", vers
3636
fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtx" }
3737
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
3838
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hiltAndroid" }
39+
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hiltAndroid" }
3940
hilt-android-gradle-plugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hiltAndroid" }
4041
jacoco-android = { module = "com.mxalbert.gradle:jacoco-android", version.ref = "jacocoAndroid" }
4142
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
@@ -64,4 +65,4 @@ mavenPublish = { id = "maven-publish" }
6465
dokka = { id = "org.jetbrains.dokka" }
6566
jacocoAndroid = { id = "com.mxalbert.gradle.jacoco-android" }
6667
signing = { id = "signing" }
67-
vanniktech = { id = "com.vanniktech.maven.publish" }
68+
vanniktech = { id = "com.vanniktech.maven.publish" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

places-ktx/src/test/java/com/google/android/libraries/places/ktx/api/net/FetchPlaceRequestTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ internal class FetchPlaceRequestTest {
2626
fun testBuilderNoActions() {
2727
val request = fetchPlaceRequest(
2828
"placeId",
29-
listOf(Place.Field.NAME)
29+
listOf(Place.Field.DISPLAY_NAME)
3030
)
3131
assertEquals("placeId", request.placeId)
32-
assertEquals(listOf(Place.Field.NAME), request.placeFields)
32+
assertEquals(listOf(Place.Field.DISPLAY_NAME), request.placeFields)
3333
}
3434

3535
@Test
@@ -38,13 +38,13 @@ internal class FetchPlaceRequestTest {
3838
val sessionToken = AutocompleteSessionToken.newInstance()
3939
val request = fetchPlaceRequest(
4040
"placeId",
41-
listOf(Place.Field.NAME)
41+
listOf(Place.Field.DISPLAY_NAME)
4242
) {
4343
setCancellationToken(cancellationToken)
4444
setSessionToken(sessionToken)
4545
}
4646
assertEquals("placeId", request.placeId)
47-
assertEquals(listOf(Place.Field.NAME), request.placeFields)
47+
assertEquals(listOf(Place.Field.DISPLAY_NAME), request.placeFields)
4848
assertEquals(cancellationToken, request.cancellationToken)
4949
assertEquals(sessionToken, request.sessionToken)
5050
}

places-ktx/src/test/java/com/google/android/libraries/places/ktx/api/net/FindCurrentPlaceRequestTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ internal class FindCurrentPlaceRequestTest {
2323

2424
@Test
2525
fun testBuilderNoActions() {
26-
val request = findCurrentPlaceRequest(listOf(Place.Field.NAME))
27-
assertEquals(listOf(Place.Field.NAME), request.placeFields)
26+
val request = findCurrentPlaceRequest(listOf(Place.Field.DISPLAY_NAME))
27+
assertEquals(listOf(Place.Field.DISPLAY_NAME), request.placeFields)
2828
}
2929

3030
@Test
3131
fun testBuilderWithActions() {
3232
val cancellationToken = CancellationTokenSource().token
33-
val request = findCurrentPlaceRequest(listOf(Place.Field.NAME)) {
33+
val request = findCurrentPlaceRequest(listOf(Place.Field.DISPLAY_NAME)) {
3434
setCancellationToken(cancellationToken)
3535
}
36-
assertEquals(listOf(Place.Field.NAME), request.placeFields)
36+
assertEquals(listOf(Place.Field.DISPLAY_NAME), request.placeFields)
3737
assertEquals(cancellationToken, request.cancellationToken)
3838
}
3939
}

places-ktx/src/test/java/com/google/android/libraries/places/ktx/api/net/SearchByTextRequestTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ internal class SearchByTextRequestTest {
2929
fun testBuilderNoActions() {
3030
val request = searchByTextRequest(
3131
textQuery = "test query",
32-
placeFields = listOf(Place.Field.NAME)
32+
placeFields = listOf(Place.Field.DISPLAY_NAME)
3333
)
3434

3535
assertThat(request.textQuery).isEqualTo("test query")
36-
assertThat(request.placeFields).containsExactly(Place.Field.NAME)
36+
assertThat(request.placeFields).containsExactly(Place.Field.DISPLAY_NAME)
3737
}
3838

3939
@Test
@@ -44,7 +44,7 @@ internal class SearchByTextRequestTest {
4444

4545
val request = searchByTextRequest(
4646
textQuery = "test query",
47-
placeFields = listOf(Place.Field.NAME, Place.Field.ADDRESS),
47+
placeFields = listOf(Place.Field.DISPLAY_NAME, Place.Field.ADDRESS),
4848
) {
4949
setCancellationToken(cancellationToken)
5050
includedType = "national_park"

0 commit comments

Comments
 (0)