From a0f4a2f24e42a772fad1ef90b315c2570dff28d2 Mon Sep 17 00:00:00 2001 From: Owen LeJeune Date: Fri, 18 Mar 2022 13:07:53 -0400 Subject: [PATCH] refactor dependencies --- app/build.gradle | 118 +++++++++++------- build.gradle | 6 +- buildSrc/build.gradle.kts | 9 -- .../com/owenlejeune/tvtime/buildsrc/Config.kt | 11 -- .../owenlejeune/tvtime/buildsrc/Versions.kt | 27 ---- 5 files changed, 76 insertions(+), 95 deletions(-) delete mode 100644 buildSrc/build.gradle.kts delete mode 100644 buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Config.kt delete mode 100644 buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Versions.kt diff --git a/app/build.gradle b/app/build.gradle index 84be6f8..32284cd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,20 +1,20 @@ -import com.owenlejeune.tvtime.buildsrc.* - plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'kotlin-android' } +def composeVersion = "1.1.0-rc03" + android { - compileSdkVersion(Config.compileSdk) + compileSdkVersion 32 defaultConfig { applicationId "com.owenlejeune.tvtime" - minSdkVersion(Config.minSdk) - targetSdkVersion(Config.targetSdk) - versionCode = Config.versionCode - versionName = Config.versionName + minSdkVersion 23 + targetSdkVersion 32 + versionCode = 1 + versionName = "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -43,7 +43,7 @@ android { compose true } composeOptions { - kotlinCompilerExtensionVersion Versions.compose + kotlinCompilerExtensionVersion composeVersion } packagingOptions { resources { @@ -53,52 +53,78 @@ android { } dependencies { + // ktx + def ktx_core = "1.7.0" + def ktx_paging = "3.1.1" + implementation "androidx.core:core-ktx:$ktx_core" + implementation "androidx.paging:paging-common-ktx:$ktx_paging" - implementation "androidx.core:core-ktx:${Versions.core_ktx}" - implementation "androidx.paging:paging-common-ktx:${Versions.paging}" + // compose + def compose = composeVersion + def compose_material3 = "1.0.0-alpha07" + def compose_accompanist = "0.22.1-rc" + def compose_navigation = "2.4.1" + def compose_paging = "1.0.0-alpha14" + def compose_constraint_layout = "1.0.0" + def compose_activity = "1.4.0" + implementation "androidx.compose.ui:ui:$compose" + implementation "androidx.compose.material3:material3:$compose_material3" + implementation "androidx.compose.material:material:$compose" + implementation "androidx.compose.material:material-icons-extended:$compose" + implementation "androidx.compose.ui:ui-tooling-preview:$compose" + implementation "androidx.activity:activity-compose:$compose_activity" + implementation "com.google.accompanist:accompanist-systemuicontroller:$compose_accompanist" + implementation "com.google.accompanist:accompanist-pager:$compose_accompanist" + implementation "com.google.accompanist:accompanist-pager-indicators:$compose_accompanist" + implementation "com.google.accompanist:accompanist-flowlayout:$compose_accompanist" +// implementation "com.google.accompanist:accompanist-insets:$compose_accompanist" + implementation "androidx.navigation:navigation-compose:$compose_navigation" + implementation "androidx.paging:paging-compose:$compose_paging" + implementation "androidx.constraintlayout:constraintlayout-compose:$compose_constraint_layout" - implementation "androidx.compose.ui:ui:${Versions.compose}" - implementation "androidx.compose.material3:material3:${Versions.compose_material3}" - implementation "androidx.compose.material:material:${Versions.compose}" - implementation "androidx.compose.material:material-icons-extended:${Versions.compose}" - implementation "androidx.compose.ui:ui-tooling-preview:${Versions.compose}" - implementation "androidx.activity:activity-compose:${Versions.activity_compose}" - implementation "com.google.accompanist:accompanist-systemuicontroller:${Versions.compose_accompanist}" - implementation "com.google.accompanist:accompanist-pager:${Versions.compose_accompanist}" - implementation "com.google.accompanist:accompanist-pager-indicators:${Versions.compose_accompanist}" - implementation "com.google.accompanist:accompanist-flowlayout:${Versions.compose_accompanist}" -// implementation "com.google.accompanist:accompanist-insets:${Versions.compose_accompanist}" - implementation "androidx.navigation:navigation-compose:${Versions.compose_navigation}" - implementation "androidx.paging:paging-compose:${Versions.compose_paging}" - implementation "androidx.constraintlayout:constraintlayout-compose:${Versions.compose_constraint_layout}" + // lifecycle + def lifecycle_runtime = "2.4.1" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_runtime" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifecycle_runtime}" + // retrofit + def retrofit = "2.9.0" + def stetho = "1.6.0" + def gson = "2.8.7" + implementation "com.squareup.retrofit2:retrofit:$retrofit" + implementation "com.squareup.retrofit2:converter-gson:$retrofit" + implementation "com.google.code.gson:gson:$gson" + implementation "com.facebook.stetho:stetho:$stetho" + implementation "com.facebook.stetho:stetho-okhttp3:$stetho" - implementation "com.squareup.retrofit2:retrofit:${Versions.retrofit}" - implementation "com.squareup.retrofit2:converter-gson:${Versions.retrofit}" - implementation "com.google.code.gson:gson:${Versions.gson}" - implementation "com.facebook.stetho:stetho:${Versions.stetho}" - implementation "com.facebook.stetho:stetho-okhttp3:${Versions.stetho}" + // koin + def koin = "3.1.4" + implementation "io.insert-koin:koin-android:$koin" - implementation "io.insert-koin:koin-android:${Versions.koin}" - - implementation "io.coil-kt:coil-compose:${Versions.coil}" + // coil + def coil = "2.0.0-rc01" + implementation "io.coil-kt:coil-compose:$coil" //Coroutines - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0' + def coroutines = "1.6.0" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines" - implementation "me.onebone:toolbar-compose:2.3.1" + // youtube player + def player_core = "11.0.1" + def chromecast_sender = "0.26" + implementation "com.pierfrancescosoffritti.androidyoutubeplayer:core:$player_core" + implementation "com.pierfrancescosoffritti.androidyoutubeplayer:chromecast-sender:$chromecast_sender" -// implementation 'com.google.android.exoplayer:exoplayer:2.16.1' -// implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v2.1.0' - implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:11.0.1' - implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:chromecast-sender:0.26' + // markdown + def markdown = "0.2.1" + implementation "org.jetbrains:markdown:$markdown" - implementation "org.jetbrains:markdown:0.2.1" - - testImplementation "junit:junit:${Versions.junit}" - androidTestImplementation "androidx.test.ext:junit:${Versions.androidx_junit}" - androidTestImplementation "androidx.test.espresso:espresso-core:${Versions.espresso_core}" - androidTestImplementation "androidx.compose.ui:ui-test-junit4:${Versions.compose}" - debugImplementation "androidx.compose.ui:ui-tooling:${Versions.compose}" + // testing + def junit = "4.13.2" + def androidx_junit = "1.1.3" + def espresso_core = "3.4.0" + testImplementation "junit:junit:$junit" + androidTestImplementation "androidx.test.ext:junit:$androidx_junit" + androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_core" + androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose" + debugImplementation "androidx.compose.ui:ui-tooling:$compose" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3f63413..fd9e7b6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,14 @@ buildscript { + def gradle = "7.1.2" + def kotlin = "1.6.10" repositories { google() mavenCentral() maven { url "https://jitpack.io" } dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" - classpath "com.android.tools.build:gradle:7.1.1" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin" + classpath "com.android.tools.build:gradle:$gradle" } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index 8e88a95..0000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -import org.gradle.kotlin.dsl.`kotlin-dsl` - -plugins { - `kotlin-dsl` -} - -repositories { - mavenCentral() -} \ No newline at end of file diff --git a/buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Config.kt b/buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Config.kt deleted file mode 100644 index e2b9d73..0000000 --- a/buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Config.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.owenlejeune.tvtime.buildsrc - -object Config { - - const val compileSdk = 32 - const val minSdk = 23 - const val targetSdk = 32 - const val versionCode = 1 - const val versionName = "1.0" - -} \ No newline at end of file diff --git a/buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Versions.kt b/buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Versions.kt deleted file mode 100644 index 203405c..0000000 --- a/buildSrc/src/main/java/com/owenlejeune/tvtime/buildsrc/Versions.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.owenlejeune.tvtime.buildsrc - -object Versions { - - const val compose = "1.1.0-rc03" - const val compose_material3 = "1.0.0-alpha06" - const val compose_accompanist = "0.22.1-rc" - const val compose_navigation = "2.4.0" - const val compose_paging = "1.0.0-alpha14" - const val compose_constraint_layout = "1.0.0" - const val gradle = "7.1.0" - const val junit = "4.13.2" - const val androidx_junit = "1.1.3" - const val espresso_core = "3.4.0" - const val kotlin = "1.6.10" - const val androidx = "1.4.1" - const val core_ktx = "1.7.0" - const val activity_compose = "1.4.0" - const val lifecycle_runtime = "2.4.0" - const val retrofit = "2.9.0" - const val stetho = "1.6.0" - const val gson = "2.8.7" - const val koin = "3.1.4" - const val paging = "3.1.0" - const val coil = "2.0.0-rc01" - -} \ No newline at end of file