diff --git a/build.gradle b/build.gradle index b123cae..9c56c33 100755 --- a/build.gradle +++ b/build.gradle @@ -2,14 +2,14 @@ apply from: 'dependencies.gradle' buildscript { - ext.kotlin_version = '1.6.21' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() gradlePluginPortal() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:7.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.github.ben-manes:gradle-versions-plugin:0.42.0' classpath 'com.adarshr:gradle-test-logger-plugin:3.2.0' diff --git a/data/build.gradle b/data/build.gradle index 7ed1633..42e375c 100755 --- a/data/build.gradle +++ b/data/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'com.github.ben-manes.versions' -apply plugin: 'com.adarshr.test-logger' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'com.github.ben-manes.versions' + id 'com.adarshr.test-logger' +} android { compileSdkVersion androidCompileSdkVersion + namespace 'com.mikhaellopez.data' defaultConfig { minSdkVersion androidMinSdkVersion testInstrumentationRunner packageAndroidJUnitRunner @@ -26,7 +29,13 @@ android { } testBuildType 'debugTest' } - namespace 'com.mikhaellopez.data' + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } } dependencies { @@ -34,7 +43,7 @@ dependencies { implementation project(':domain') // KOTLIN - implementation kotlinStdlib + //implementation kotlinStdlib // SUPPORT api androidXCore // COMPONENTS diff --git a/dependencies.gradle b/dependencies.gradle index b3378a9..48d60b1 100755 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -7,11 +7,11 @@ allprojects { ext { // APP VERSION - androidVersionCode = 6 - androidVersionName = '1.1.1' + androidVersionCode = 7 + androidVersionName = '1.1.2' // ANDROID VERSION - androidCompileSdkVersion = 31 + androidCompileSdkVersion = 33 androidMinSdkVersion = 19 androidTargetSdkVersion = androidCompileSdkVersion @@ -19,76 +19,55 @@ ext { packageAndroidJUnitRunner = "androidx.test.runner.AndroidJUnitRunner" defaultFlavorDimensions = "default" - // KOTLIN - kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib:${ext.kotlin_version}" - // ANDROID LIB - androidXCoreVersion = '1.7.0' - androidXVersion = '1.4.1' - androidXPreferenceVersion = '1.2.0' - androidXRecyclerviewVersion = '1.2.1' - androidXSwipeRefreshVersion = '1.1.0' - materialVersion = '1.6.0' - constraintLayoutVersion = '2.1.4' - multidexVersion = '2.0.1' - androidXCore = "androidx.core:core:$androidXCoreVersion" - androidXAppCompat = "androidx.appcompat:appcompat:$androidXVersion" - androidXPreference = "androidx.preference:preference-ktx:$androidXPreferenceVersion" - androidXRecyclerView = "androidx.recyclerview:recyclerview:$androidXRecyclerviewVersion" - androidXSwipeRefresh = "androidx.swiperefreshlayout:swiperefreshlayout:$androidXSwipeRefreshVersion" - materialDesign = "com.google.android.material:material:$materialVersion" - constraintLayout = "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion" - multidex = "androidx.multidex:multidex:$multidexVersion" + androidXCore = "androidx.core:core:1.8.0" + androidXAppCompat = "androidx.appcompat:appcompat:1.5.0" + androidXRecyclerView = "androidx.recyclerview:recyclerview:1.2.1" + androidXSwipeRefresh = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" + materialDesign = "com.google.android.material:material:1.6.1" + constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.4" + multidex = "androidx.multidex:multidex:2.0.1" // COMPONENTS - roomVersion = '2.4.2' + roomVersion = '2.4.3' room = "androidx.room:room-runtime:$roomVersion" roomCompiler = "androidx.room:room-compiler:$roomVersion" // DAGGER - daggerVersion = '2.42' + daggerVersion = '2.43.2' dagger = "com.google.dagger:dagger:$daggerVersion" daggerCompiler = "com.google.dagger:dagger-compiler:$daggerVersion" // RX - rxAndroidVersion = '3.0.0' - rxJavaVersion = '3.1.4' - rxKotlinVersion = '3.0.1' rxBindingVersion = '4.0.0' - rxAndroid = "io.reactivex.rxjava3:rxandroid:$rxAndroidVersion" - rxJava = "io.reactivex.rxjava3:rxjava:$rxJavaVersion" - rxKotlin = "io.reactivex.rxjava3:rxkotlin:$rxKotlinVersion" + rxAndroid = "io.reactivex.rxjava3:rxandroid:3.0.0" + rxJava = "io.reactivex.rxjava3:rxjava:3.1.5" + rxKotlin = "io.reactivex.rxjava3:rxkotlin:3.0.1" rxBinding = "com.jakewharton.rxbinding4:rxbinding:$rxBindingVersion" rxBindingSwipeRefreshlayout = "com.jakewharton.rxbinding4:rxbinding-swiperefreshlayout:$rxBindingVersion" // WEBSERVICES retrofitVersion = '2.9.0' - okHttpVersion = '3.11.0' retrofitConverterGson = "com.squareup.retrofit2:converter-gson:$retrofitVersion" retrofitAdapterRxJava = "com.squareup.retrofit2:adapter-rxjava3:$retrofitVersion" // DEBUG - timberVersion = '5.0.1' chuckVersion = '1.1.0' - timber = "com.jakewharton.timber:timber:$timberVersion" + timber = "com.jakewharton.timber:timber:5.0.1" chuckDebug = "com.readystatesoftware.chuck:library:$chuckVersion" chuckRelease = "com.readystatesoftware.chuck:library-no-op:$chuckVersion" // TEST - junitVersion = '4.13.2' - mockitoVersion = '4.5.1' - mockitoKotlinVersion = '4.0.0' - junit = "junit:junit:$junitVersion" - mockitoInline = "org.mockito:mockito-inline:$mockitoVersion" - mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion" + junit = "junit:junit:4.13.2" + mockitoInline = "org.mockito:mockito-inline:4.7.0" + mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:4.0.0" // ANDROID TEST androidXTestVersion = '1.4.0' - androidXTestJunitVersion = '1.1.3' espressoVersion = '3.4.0' multidexInstVersion = '2.0.0' + androidXTestJunit = "androidx.test.ext:junit:1.1.3" androidXTestRunner = "androidx.test:runner:$androidXTestVersion" - androidXTestJunit = "androidx.test.ext:junit:$androidXTestJunitVersion" androidXTestRules = "androidx.test:rules:$androidXTestVersion" espressoCore = "androidx.test.espresso:espresso-core:$espressoVersion" espressoIntents = "androidx.test.espresso:espresso-intents:$espressoVersion" diff --git a/domain/build.gradle b/domain/build.gradle index 937f936..e11e7d3 100755 --- a/domain/build.gradle +++ b/domain/build.gradle @@ -1,11 +1,11 @@ -apply plugin: 'kotlin' -apply plugin: 'idea' -apply plugin: 'com.github.ben-manes.versions' -apply plugin: 'com.adarshr.test-logger' +plugins { + id 'kotlin' + id 'idea' + id 'com.github.ben-manes.versions' + id 'com.adarshr.test-logger' +} dependencies { - // KOTLIN - implementation kotlinStdlib // RX implementation rxJava implementation rxKotlin diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8f00ccb..503b46d 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip diff --git a/presentation/build.gradle b/presentation/build.gradle index 37b4807..87d6d37 100755 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -1,8 +1,10 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'com.github.ben-manes.versions' -apply plugin: 'com.adarshr.test-logger' +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' + id 'com.github.ben-manes.versions' + id 'com.adarshr.test-logger' +} android { compileSdkVersion androidCompileSdkVersion @@ -16,14 +18,6 @@ android { multiDexEnabled true testInstrumentationRunner packageAndroidJUnitRunner } - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } signingConfigs { release { storeFile file('keystore') @@ -53,6 +47,13 @@ android { } testBuildType 'debugTest' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } buildFeatures { viewBinding true } @@ -66,11 +67,8 @@ dependencies { implementation project(':data') implementation project(':domain') - // KOTLIN - implementation kotlinStdlib // ANDROIDX implementation androidXAppCompat - implementation androidXPreference implementation androidXRecyclerView implementation androidXSwipeRefresh implementation materialDesign @@ -100,7 +98,6 @@ dependencies { androidTestImplementation espressoCore androidTestImplementation espressoIntents androidTestImplementation espressoContrib - androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.3' // DEPENDENCY CHECK STRATEGY dependencyUpdates.resolutionStrategy dependencyUpdatesStrategy diff --git a/presentation/src/main/java/com/mikhaellopez/presentation/di/modules/ApplicationModule.kt b/presentation/src/main/java/com/mikhaellopez/presentation/di/modules/ApplicationModule.kt index cd15efa..375914f 100755 --- a/presentation/src/main/java/com/mikhaellopez/presentation/di/modules/ApplicationModule.kt +++ b/presentation/src/main/java/com/mikhaellopez/presentation/di/modules/ApplicationModule.kt @@ -2,8 +2,6 @@ package com.mikhaellopez.presentation.di.modules import android.app.Application import android.content.Context -import android.content.SharedPreferences -import androidx.preference.PreferenceManager import com.mikhaellopez.presentation.di.PerApplication import dagger.Module import dagger.Provides @@ -20,9 +18,4 @@ class ApplicationModule { @PerApplication internal fun provideContext(application: Application): Context = application.baseContext - @Provides - @PerApplication - internal fun providesSharedPreferences(context: Context): SharedPreferences = - PreferenceManager.getDefaultSharedPreferences(context) - } diff --git a/presentation/src/main/java/com/mikhaellopez/presentation/scenes/base/view/ABaseActivity.kt b/presentation/src/main/java/com/mikhaellopez/presentation/scenes/base/view/ABaseActivity.kt index ec5df02..b2d9550 100755 --- a/presentation/src/main/java/com/mikhaellopez/presentation/scenes/base/view/ABaseActivity.kt +++ b/presentation/src/main/java/com/mikhaellopez/presentation/scenes/base/view/ABaseActivity.kt @@ -32,7 +32,7 @@ abstract class ABaseActivity : AppCompatActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { // Handle toolbar back arrow click here if (item.itemId == android.R.id.home) { - onBackPressed() + finish() } return super.onOptionsItemSelected(item) } diff --git a/presentation/src/main/java/com/mikhaellopez/presentation/scenes/repo/RepoActivity.kt b/presentation/src/main/java/com/mikhaellopez/presentation/scenes/repo/RepoActivity.kt index e1df17f..77ea10d 100755 --- a/presentation/src/main/java/com/mikhaellopez/presentation/scenes/repo/RepoActivity.kt +++ b/presentation/src/main/java/com/mikhaellopez/presentation/scenes/repo/RepoActivity.kt @@ -58,7 +58,7 @@ class RepoActivity : ABaseActivity() { } } - override fun onCreateOptionsMenu(menu: Menu?): Boolean { + override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.repo_menu, menu) return super.onCreateOptionsMenu(menu) }