#
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# #################################################################################################
#                                GRADLE VERSION CATALOG
#
# This file defines the dependencies used in the project, organized into four main sections:
# - `[versions]`: Centralizes dependency versions for easy management and updates.
# - `[libraries]`: Declares the actual dependencies, referencing versions from the `[versions]` block.
# - `[bundles]`: (Not used here) Groups libraries that are commonly used together.
# - `[plugins]`: Configures Gradle plugins used for building and packaging the application.
#
# For more information, see https://docs.gradle.org/current/userguide/platforms.html
# #################################################################################################


[versions]
# -------------------------------------------------------------------------------------------------
#                                     Android SDK
#
# Specifies the core Android SDK versions for compilation, minimum supported API level, and target
# API level. These versions are fundamental to how the application is built and how it interacts
# with the Android operating system.
# -------------------------------------------------------------------------------------------------
android-compile-sdk = "36"
android-min-sdk = "24"
android-target-sdk = "36"


# -------------------------------------------------------------------------------------------------
#                                       Kotlin
#
# Defines the versions for the Kotlin programming language and related libraries, such as
# coroutines for asynchronous programming and datetime for handling dates and times.
# -------------------------------------------------------------------------------------------------
kotlin = "2.2.21"
kotlinx-coroutines-test = "1.10.2"
kotlinx-datetime = "0.7.1"


# -------------------------------------------------------------------------------------------------
#                                     AndroidX
#
# Centralizes versions for AndroidX libraries, which are part of the Android Jetpack suite.
# This includes components for UI (Compose), core functionality (KTX), lifecycle management,
# and testing.
# -------------------------------------------------------------------------------------------------
androidx-activity-compose = "1.11.0"
androidx-compose-bom = "2025.10.01"
androidx-core-ktx = "1.17.0"
androidx-espresso-core = "3.7.0"
androidx-hilt-navigation-compose = "1.3.0"
androidx-junit = "1.3.0"
androidx-lifecycle-runtime-ktx = "2.9.4"
androidx-material-icons-extended = "1.7.8"
androidx-material3 = "1.4.0"


# -------------------------------------------------------------------------------------------------
#                                 Google & Firebase
#
# Manages versions for Google-provided libraries, including Firebase for backend services,
# Hilt for dependency injection, and Google Maps Platform SDKs for mapping functionalities.
# -------------------------------------------------------------------------------------------------
dagger = "2.57.2"
firebase-bom = "34.5.0"
hilt-android = "2.57.2"
maps-compose = "6.12.1"
maps-utils-ktx = "5.2.1"
truth = "1.4.5"


# -------------------------------------------------------------------------------------------------
#                                       Testing
#
# Specifies the versions for testing frameworks and libraries used for unit and instrumentation
# tests. This includes JUnit, Mockito for mocking objects, Robolectric for running Android tests
# on the JVM, and Turbine for testing Kotlin Flows.
# -------------------------------------------------------------------------------------------------
junit = "4.13.2"
mockito = "6.1.0"
robolectric = "4.16"
turbine = "1.2.1"


# -------------------------------------------------------------------------------------------------
#                                    Gradle Plugins
#
# Defines the versions for Gradle plugins that provide core build functionalities, such as the
# Android Gradle Plugin (AGP), Kotlin plugins, and utility plugins like the Secrets Gradle Plugin
# for managing API keys.
# -------------------------------------------------------------------------------------------------
android-gradle-plugin = "8.13.0"
ksp = "2.2.20-2.0.4"
secrets-gradle-plugin = "2.0.1"


[libraries]
# -------------------------------------------------------------------------------------------------
#                                     AndroidX
#
# This section declares the AndroidX libraries used in the project. These libraries provide
# backward-compatible versions of Android framework APIs, as well as new features and utilities
# for modern Android development.
# -------------------------------------------------------------------------------------------------
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core-ktx" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "androidx-hilt-navigation-compose" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle-runtime-ktx" }
androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "androidx-material-icons-extended" }
androidx-material3 = { module = "androidx.compose.material3:material3", version.ref = "androidx-material3" }
androidx-ui = { module = "androidx.compose.ui:ui" }
androidx-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }


# -------------------------------------------------------------------------------------------------
#                                 Google & Firebase
#
# Declares dependencies for Google and Firebase services. This includes the Maps SDK for Compose,
# Firebase Realtime Database, and Hilt for dependency injection.
# -------------------------------------------------------------------------------------------------
dagger = { module = "com.google.dagger:dagger", version.ref = "dagger" }
firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebase-bom" }
firebase-database = { module = "com.google.firebase:firebase-database" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt-android" }
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt-android" }
maps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
maps-utils-ktx = { module = "com.google.maps.android:maps-utils-ktx", version.ref = "maps-utils-ktx" }


# -------------------------------------------------------------------------------------------------
#                                       Kotlin
#
# Defines Kotlin-specific libraries, such as the datetime library for handling dates and times
# in a multiplatform-friendly way.
# -------------------------------------------------------------------------------------------------
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }


# -------------------------------------------------------------------------------------------------
#                                       Testing
#
# This section lists all dependencies required for testing. It includes libraries for both local
# unit tests (JUnit, Mockito, Robolectric) and instrumented tests that run on an Android device
# or emulator (Espresso, AndroidX Test).
# -------------------------------------------------------------------------------------------------
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso-core" }
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" }
androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
androidx-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
google-truth = { module = "com.google.truth:truth", version.ref = "truth" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines-test" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }


[plugins]
# -------------------------------------------------------------------------------------------------
#                                    Gradle Plugins
#
# This section defines the Gradle plugins used in the project. Plugins extend Gradle's capabilities,
# enabling tasks like compiling Android applications, processing Kotlin code, managing secrets,
# and handling dependency injection with Hilt and KSP.
# -------------------------------------------------------------------------------------------------
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt-android" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
secrets-gradle-plugin = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets-gradle-plugin" }