Skip to content

Commit

Permalink
chore: updated Kotlin to 2.0.0 and migration Catalogue (#256)
Browse files Browse the repository at this point in the history
* chore: updated Kotlin to 2.0.0 and migration Catalogue

* chore: moved dependencies into the Catalogue

* chore: moved plugins into Catalogue

* chore: fixed file
  • Loading branch information
kikoso committed May 28, 2024
1 parent 7ad9b2d commit 61e13a6
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 51 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 2023 Google Inc.
* Copyright 2024 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 34
compileSdk libs.versions.androidCompileSdk.get().toInteger()

defaultConfig {
applicationId "com.google.maps.android.ktx.demo"
minSdk 21
targetSdk 34
minSdk libs.versions.androidMinSdk.get().toInteger()
targetSdk libs.versions.androidTargetSdk.get().toInteger()
versionCode 1
versionName "1.0"
multiDexEnabled true
Expand Down Expand Up @@ -58,18 +58,18 @@ android {
}

dependencies {
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.core:core-ktx:1.12.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.24"
implementation 'androidx.multidex:multidex:2.0.1'
implementation "com.google.android.gms:play-services-maps:18.2.0"
implementation "androidx.fragment:fragment-ktx:1.6.2"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
implementation 'com.google.android.material:material:1.11.0'
implementation 'com.android.volley:volley:1.2.1'
implementation libs.appcompat
implementation libs.core.ktx
implementation libs.kotlin.stdlib
implementation libs.multidex
implementation libs.play.services.maps
implementation libs.fragment.ktx
implementation libs.lifecycle.runtime.ktx
implementation libs.material
implementation libs.volley

// Hilt
implementation "com.google.dagger:hilt-android:2.51"
implementation libs.hilt.android
kapt "com.google.dagger:hilt-android-compiler:2.51.1"

implementation project(':places-ktx')
Expand Down
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2023 Google Inc.
* Copyright 2024 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 @@ -21,12 +21,12 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.4.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.9.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.51"
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
classpath 'com.mxalbert.gradle:jacoco-android:0.2.1'
classpath libs.gradle
classpath libs.dokka.gradle.plugin
classpath libs.kotlin.gradle.plugin
classpath libs.hilt.android.gradle.plugin
classpath libs.secrets.gradle.plugin
classpath libs.jacoco.android
}
}

Expand Down Expand Up @@ -66,11 +66,11 @@ allprojects {
subprojects { project ->
if (project.ext.artifactId == null) return

apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.mxalbert.gradle.jacoco-android'
apply plugin: 'signing'
plugins.apply(libs.plugins.androidLibrary.get().pluginId)
plugins.apply(libs.plugins.mavenPublish.get().pluginId)
plugins.apply(libs.plugins.dokka.get().pluginId)
plugins.apply(libs.plugins.jacocoAndroid.get().pluginId)
plugins.apply(libs.plugins.signing.get().pluginId)

// Code coverage
jacoco {
Expand Down Expand Up @@ -167,5 +167,5 @@ subprojects { project ->
}

tasks.register('clean', Delete) {
delete rootProject.buildDir
delete rootProject.layout.buildDirectory
}
64 changes: 64 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[versions]
androidCompileSdk = "34"
androidMinSdk = "21"
androidTargetSdk = "34"

appcompat = "1.6.1"
coreKtx = "1.13.1"
dokkaGradlePlugin = "1.9.20"
fragmentKtx = "1.7.1"
gradle = "8.4.1"
hiltAndroid = "2.51.1"
jacocoAndroid = "0.2.1"
kotlin = "2.0.0"
kotlinGradlePlugin = "1.9.24"
kotlinx-coroutines-core = "1.8.1"
lifecycle-viewmodel-ktx = "2.8.0"
material = "1.12.0"
playServicesMaps = "18.2.0"
secretsGradlePlugin = "2.0.1"
truth = "1.4.2"
volley = "1.2.1"
multidex = "2.0.1"
kotlinx-coroutines-play-services = "1.8.1"
places = "3.4.0"
junit-ext = "1.1.5"
test-core = "1.5.0"
mockito-kotlin = "2.2.0"
junit = "4.13.2"
mockito-core = "5.9.0"

[libraries]
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokkaGradlePlugin" }
fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtx" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hiltAndroid" }
hilt-android-gradle-plugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hiltAndroid" }
jacoco-android = { module = "com.mxalbert.gradle:jacoco-android", version.ref = "jacocoAndroid" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" }
lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel-ktx" }
lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle-viewmodel-ktx" }
material = { module = "com.google.android.material:material", version.ref = "material" }
play-services-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "playServicesMaps" }
secrets-gradle-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
multidex = { group = "androidx.multidex", name = "multidex", version.ref = "multidex" }
kotlinx-coroutines-play-services = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-play-services", version.ref = "kotlinx-coroutines-play-services" }
places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" }
junit-ext = { group = "androidx.test.ext", name = "junit", version.ref = "junit-ext" }
test-core = { group = "androidx.test", name = "core", version.ref = "test-core" }
mockito-kotlin = { group = "com.nhaarman.mockitokotlin2", name = "mockito-kotlin", version.ref = "mockito-kotlin" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito-core" }

[plugins]
androidLibrary = { id = "com.android.library" }
mavenPublish = { id = "maven-publish" }
dokka = { id = "org.jetbrains.dokka" }
jacocoAndroid = { id = "com.mxalbert.gradle.jacoco-android" }
signing = { id = "signing" }
41 changes: 17 additions & 24 deletions places-ktx/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Google Inc.
* Copyright 2024 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 @@ -19,11 +19,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdk 34
compileSdk libs.versions.androidCompileSdk.get().toInteger()

defaultConfig {
minSdk 21
targetSdk 34
minSdk libs.versions.androidMinSdk.get().toInteger()
targetSdk libs.versions.androidTargetSdk.get().toInteger()
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
multiDexEnabled true
Expand All @@ -42,30 +42,23 @@ android {
testOptions {
unitTests.returnDefaultValues = true
}

buildTypes {
debug {
testCoverageEnabled = true
}
}

namespace "com.google.android.libraries.places.ktx"
}

dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.24'
implementation('org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1')
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.0"
implementation "com.android.volley:volley:1.2.1"
implementation 'androidx.multidex:multidex:2.0.1'
api "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.8.1"
api 'com.google.android.libraries.places:places:3.4.0'
implementation libs.kotlin.stdlib
implementation libs.kotlinx.coroutines.core
implementation libs.lifecycle.viewmodel.ktx
implementation libs.volley
implementation libs.multidex
api libs.kotlinx.coroutines.play.services
api libs.places

// Tests
testImplementation "androidx.test.ext:junit:1.1.5"
testImplementation "androidx.test:core:1.5.0"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:5.11.0"
testImplementation "com.google.truth:truth:1.4.2"
testImplementation libs.junit.ext
testImplementation libs.test.core
testImplementation libs.mockito.kotlin
testImplementation libs.junit
testImplementation libs.mockito.core
testImplementation libs.truth
}

0 comments on commit 61e13a6

Please sign in to comment.