Skip to content

Commit

Permalink
feat: upgraded libraries and migrated Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoso committed Nov 3, 2023
1 parent 1880218 commit 429a91b
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 162 deletions.
28 changes: 14 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020 Google Inc.
* Copyright 2023 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,12 +23,12 @@ plugins {
}

android {
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.google.maps.android.ktx.demo"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
multiDexEnabled true
Expand All @@ -46,31 +46,31 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
namespace "com.google.places.android.ktx.demo"
}

dependencies {
implementation "androidx.appcompat:appcompat:1.3.0"
implementation "androidx.core:core-ktx:1.6.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.21"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.core:core-ktx:1.12.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.20"
implementation 'androidx.multidex:multidex:2.0.1'
implementation "com.google.android.gms:play-services-maps:18.2.0"
implementation "androidx.fragment:fragment-ktx:1.3.5"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation "androidx.fragment:fragment-ktx:1.6.2"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'com.google.android.material:material:1.10.0'
implementation 'com.android.volley:volley:1.2.1'

// Hilt
implementation "com.google.dagger:hilt-android:2.41"
kapt "com.google.dagger:hilt-android-compiler:2.41"
implementation "com.google.dagger:hilt-android:2.48"
kapt "com.google.dagger:hilt-android-compiler:2.48"

implementation project(':places-ktx')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@ import com.google.android.libraries.places.ktx.widget.PlaceSelectionSuccess
import com.google.android.libraries.places.ktx.widget.placeSelectionEvents
import com.google.android.libraries.places.widget.AutocompleteSupportFragment
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch

class AutocompleteDemoActivity : AppCompatActivity() {

Expand All @@ -41,7 +41,7 @@ class AutocompleteDemoActivity : AppCompatActivity() {
autocompleteFragment.setPlaceFields(listOf(Place.Field.ID, Place.Field.NAME))

// Listen to place selection events
lifecycleScope.launchWhenCreated {
lifecycleScope.launch {
autocompleteFragment.placeSelectionEvents().collect { event ->
when (event) {
is PlaceSelectionSuccess -> Toast.makeText(
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020 Google Inc.
* Copyright 2023 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,9 +24,9 @@ buildscript {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.40.1"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.48"
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
classpath 'com.hiya:jacoco-android:0.2'
classpath 'com.mxalbert.gradle:jacoco-android:0.2.1'
}
}

Expand Down Expand Up @@ -64,7 +64,7 @@ subprojects { project ->
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: 'com.mxalbert.gradle.jacoco-android'
apply plugin: 'signing'

// Code coverage
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 429a91b

Please sign in to comment.