diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b8a20d26..b9855790 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,22 +1,22 @@ plugins { - id("com.android.application") - id("com.google.devtools.ksp") - id("org.jetbrains.kotlin.android") + alias(libs.plugins.android.application) + alias(libs.plugins.google.ksp) + alias(libs.plugins.kotlin.android) } kotlin { - jvmToolchain(17) + jvmToolchain(libs.versions.jvmToolchain.get().toInt()) } android { namespace = "com.rtbishop.look4sat" - compileSdk = 34 + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { applicationId = "com.rtbishop.look4sat" - minSdk = 26 - targetSdk = 34 - versionCode = 313 - versionName = "3.1.3" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() resourceConfigurations.addAll(listOf("en", "ru", "si", "zh-rCN", "anydpi")) testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -30,35 +30,24 @@ android { proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } - composeOptions { kotlinCompilerExtensionVersion = "1.5.3" } + composeOptions { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } } dependencies { implementation(project(":data")) implementation(project(":domain")) - implementation("androidx.core:core-splashscreen:1.0.1") - implementation("androidx.room:room-runtime:2.5.2") - implementation("androidx.room:room-ktx:2.5.2") - ksp("androidx.room:room-compiler:2.5.2") + implementation(libs.androidx.core.splashscreen) + implementation(libs.androidx.room) + implementation(libs.androidx.room.runtime) + ksp(libs.androidx.room.compiler) - implementation("androidx.activity:activity-compose:1.8.0") - implementation("androidx.compose.animation:animation:1.5.3") - implementation("androidx.compose.compiler:compiler:1.5.3") - implementation("androidx.compose.material3:material3:1.1.2") - implementation("androidx.compose.runtime:runtime:1.5.3") - implementation("androidx.compose.ui:ui-tooling-preview:1.5.3") - implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.2") - implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2") - implementation("androidx.navigation:navigation-compose:2.7.4") + implementation(libs.bundles.composeAll) - implementation("com.squareup.okhttp3:okhttp:4.10.0") - implementation("org.osmdroid:osmdroid-android:6.1.17") - debugImplementation("androidx.compose.ui:ui-tooling:1.5.3") - debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.3") + implementation(libs.other.okhttp) + implementation(libs.other.osmdroid) - testImplementation("junit:junit:4.13.2") - testImplementation("io.mockk:mockk:1.13.8") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") - androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.3") + debugImplementation(libs.bundles.composeDebug) + testImplementation(libs.bundles.unitTest) + androidTestImplementation(libs.bundles.androidTest) } diff --git a/build.gradle.kts b/build.gradle.kts index 0107b507..fe2b37f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,9 @@ plugins { - id("com.android.application") version "8.1.2" apply false - id("com.android.library") version "8.1.2" apply false - id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false - id("org.jetbrains.kotlin.android") version "1.9.10" apply false - id("org.jetbrains.kotlin.jvm") version "1.9.10" apply false + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.google.ksp) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.kotlin.jvm) apply false } tasks.register("clean", Delete::class.java) { diff --git a/data/build.gradle.kts b/data/build.gradle.kts index 77c84de7..5ef20b39 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -1,18 +1,18 @@ plugins { - id("com.android.library") - id("com.google.devtools.ksp") - id("org.jetbrains.kotlin.android") + alias(libs.plugins.android.library) + alias(libs.plugins.google.ksp) + alias(libs.plugins.kotlin.android) } kotlin { - jvmToolchain(17) + jvmToolchain(libs.versions.jvmToolchain.get().toInt()) } android { namespace = "com.rtbishop.look4sat.data" - compileSdk = 34 + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { - minSdk = 26 + minSdk = libs.versions.minSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } } @@ -20,17 +20,14 @@ android { dependencies { implementation(project(":domain")) - implementation("androidx.core:core-ktx:1.12.0") - implementation("androidx.room:room-runtime:2.5.2") - implementation("androidx.room:room-ktx:2.5.2") - ksp("androidx.room:room-compiler:2.5.2") + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.room) + implementation(libs.androidx.room.runtime) + ksp(libs.androidx.room.compiler) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("com.squareup.okhttp3:okhttp:4.10.0") + implementation(libs.other.coroutines) + implementation(libs.other.okhttp) - testImplementation("junit:junit:4.13.2") - testImplementation("io.mockk:mockk:1.13.8") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") - androidTestImplementation("androidx.test.ext:junit:1.1.5") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + testImplementation(libs.bundles.unitTest) + androidTestImplementation(libs.bundles.androidTest) } diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index 3e3bc4d1..16941341 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -1,16 +1,14 @@ plugins { - id("org.jetbrains.kotlin.jvm") + alias(libs.plugins.kotlin.jvm) } kotlin { - jvmToolchain(17) + jvmToolchain(libs.versions.jvmToolchain.get().toInt()) } dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.json:json:20230618") + implementation(libs.other.coroutines) + implementation(libs.other.json) - testImplementation("junit:junit:4.13.2") - testImplementation("io.mockk:mockk:1.13.8") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + testImplementation(libs.bundles.unitTest) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..56574e5a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,82 @@ +[versions] +android-gradle-plugin = "8.1.2" +google-ksp = "1.9.10-1.0.13" +kotlin = "1.9.10" + +jvmToolchain = "17" + +minSdk = "26" +targetSdk = "34" +compileSdk = "34" +versionCode = "313" +versionName = "3.1.3" + +androidx-core-ktx = "1.12.0" +androidx-core-splashscreen = "1.0.1" +androidx-room = "2.5.2" + +compose = "1.5.3" +compose-activity = "1.8.0" +compose-compiler = "1.5.3" +compose-lifecycle = "2.6.2" +compose-material3 = "1.1.2" +compose-navigation = "2.7.4" + +other-coroutines = "1.7.3" +other-json = "20230618" +other-okhttp = "4.10.0" +other-osmdroid = "6.1.17" + +test-junit4 = "4.13.2" +test-mockk = "1.13.8" + +androidTest-junit = "1.1.5" +androidTest-espresso = "3.5.1" + +[libraries] +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core-ktx" } +androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-core-splashscreen" } +androidx-room = { module = "androidx.room:room-ktx", version.ref = "androidx-room" } +androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" } +androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" } + +compose-activity = { module = "androidx.activity:activity-compose", version.ref = "compose-activity" } +compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose" } +compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" } +compose-lifecycle = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "compose-lifecycle" } +compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" } +compose-navigation = { module = "androidx.navigation:navigation-compose", version.ref = "compose-navigation" } +compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" } +compose-tooling = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } +compose-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "compose-lifecycle" } + +compose-debug-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" } +compose-debug-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } + +other-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "other-coroutines" } +other-json = { module = "org.json:json", version.ref = "other-json" } +other-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "other-okhttp" } +other-osmdroid = { module = "org.osmdroid:osmdroid-android", version.ref = "other-osmdroid" } + +test-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "other-coroutines" } +test-junit4 = { module = "junit:junit", version.ref = "test-junit4" } +test-mockk = { module = "io.mockk:mockk", version.ref = "test-mockk" } + +androidTest-junit = { module = "androidx.test.ext:junit", version.ref = "androidTest-junit" } +androidTest-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "androidTest-espresso" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } +android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } +google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } + +[bundles] +composeAll = [ + "compose-activity", "compose-animation", "compose-compiler", "compose-lifecycle", "compose-material3", + "compose-navigation", "compose-runtime", "compose-tooling", "compose-viewmodel" +] +composeDebug = ["compose-debug-manifest", "compose-debug-tooling"] +unitTest = ["test-coroutines", "test-junit4", "test-mockk"] +androidTest = ["androidTest-junit", "androidTest-espresso"]