Android-Sample/data/build.gradle.kts
Adrian Kuta 5c0a31d648 Refactor: Migrate from Retrofit to Ktor
This commit migrates the network layer from Retrofit to Ktor.

Specific changes include:

- Replaced Retrofit
 with Ktor for network requests.
- Updated dependencies to include Ktor libraries.
- Refactored network service and data classes to use Ktor's API.
- Removed Retrofit-specific code and dependencies.
- Adjusted network module to provide Ktor client and services.
- Updated PixabayImageRepository
 to use the new Ktor-based PixabayService.
2024-08-10 19:05:20 +02:00

44 lines
1.2 KiB
Plaintext

import java.util.Properties
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.convention.android.library)
alias(libs.plugins.kotlin.serialization)
}
android {
namespace = "dev.adriankuta.pixabay.data"
buildFeatures {
buildConfig = true
}
defaultConfig {
val localPropertiesFile = project.rootProject.file("local.properties")
val properties = Properties()
properties.load(localPropertiesFile.inputStream())
val apiKey = properties.getProperty("PIXABAY_API_KEY") ?: ""
buildConfigField("String", "PIXABAY_API_KEY", "\"$apiKey\"")
}
}
dependencies {
implementation(libs.androidx.paging.compose)
implementation(libs.kotlinx.serialization.json)
//Ktor
implementation(libs.ktor.client.android)
implementation(libs.ktor.client.resources)
implementation(libs.ktor.client.content.negotiation)
implementation(libs.ktor.client.logging)
implementation(libs.ktor.serialization.kotlinx.json)
//Logging
implementation(libs.slf4j.android)
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.paging)
}