From 1bdd44085cdb80b6b1e0a1dfb6c832822be6f38e Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Wed, 23 Dec 2020 14:07:58 -0600 Subject: [PATCH] Clean up and update dependencies --- android/android-pickers/build.gradle | 2 +- android/gradle.properties | 3 +- android/uhabits-android/build.gradle | 90 ++++++++----------- .../habits/list/views/HabitCardViewTest.kt | 3 +- .../uhabits/widgets/CheckmarkWidgetTest.java | 5 +- .../uhabits/widgets/FrequencyWidgetTest.java | 5 +- .../uhabits/widgets/HistoryWidgetTest.java | 6 +- .../uhabits/widgets/ScoreWidgetTest.java | 5 +- .../uhabits/widgets/StreakWidgetTest.java | 5 +- .../views/CheckmarkWidgetViewTest.java | 4 +- android/uhabits-core/build.gradle | 35 +++----- 11 files changed, 63 insertions(+), 100 deletions(-) diff --git a/android/android-pickers/build.gradle b/android/android-pickers/build.gradle index 0627c16ca..c559f7366 100644 --- a/android/android-pickers/build.gradle +++ b/android/android-pickers/build.gradle @@ -20,5 +20,5 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' } diff --git a/android/gradle.properties b/android/gradle.properties index da1ce5163..f5b9c95aa 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -6,12 +6,13 @@ TARGET_SDK_VERSION = 29 COMPILE_SDK_VERSION = 29 DAGGER_VERSION = 2.25.4 -KOTLIN_VERSION = 1.4.0 +KOTLIN_VERSION = 1.4.10 KX_COROUTINES_VERSION = 1.4.2 SUPPORT_LIBRARY_VERSION = 28.0.0 AUTO_FACTORY_VERSION = 1.0-beta6 BUILD_TOOLS_VERSION = 4.1.0 KTOR_VERSION=1.4.2 +ESPRESSO_VERSION=3.3.0 org.gradle.parallel=false org.gradle.daemon=true diff --git a/android/uhabits-android/build.gradle b/android/uhabits-android/build.gradle index 3e686773a..2ba358d08 100644 --- a/android/uhabits-android/build.gradle +++ b/android/uhabits-android/build.gradle @@ -78,70 +78,50 @@ android { } dependencies { - implementation project(":uhabits-core") - implementation project(":android-pickers") - - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'com.google.android.material:material:1.0.0' - implementation 'androidx.legacy:legacy-preference-v14:1.0.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' + androidTestAnnotationProcessor "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" + androidTestCompileOnly "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" + androidTestImplementation "androidx.test.espresso:espresso-contrib:$ESPRESSO_VERSION" + androidTestImplementation "androidx.test.espresso:espresso-core:$ESPRESSO_VERSION" + androidTestImplementation "com.google.dagger:dagger:$DAGGER_VERSION" + androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito:2.28.0" + androidTestImplementation "com.linkedin.testbutler:test-butler-library:1.3.1" + androidTestImplementation "io.ktor:ktor-client-mock:$KTOR_VERSION" + androidTestImplementation "io.ktor:ktor-jackson:$KTOR_VERSION" + androidTestImplementation "org.mockito:mockito-core:2.28.2" + androidTestImplementation 'androidx.annotation:annotation:1.1.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' + androidTestImplementation 'androidx.test:rules:1.3.0' + androidTestImplementation project(":uhabits-core") + annotationProcessor "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" + compileOnly "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" + compileOnly "javax.annotation:jsr250-api:1.0" + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1' implementation "com.github.paolorotolo:appintro:3.4.0" - implementation "com.google.dagger:dagger:$DAGGER_VERSION" - implementation "org.apmem.tools:layouts:1.10" - implementation "com.google.code.gson:gson:2.8.5" implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "com.google.dagger:dagger:$DAGGER_VERSION" + implementation "com.google.guava:guava:30.0-android" + implementation "io.ktor:ktor-client-android:$KTOR_VERSION" + implementation "io.ktor:ktor-client-core:$KTOR_VERSION" + implementation "io.ktor:ktor-client-jackson:$KTOR_VERSION" + implementation "io.ktor:ktor-client-json:$KTOR_VERSION" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KX_COROUTINES_VERSION" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$KX_COROUTINES_VERSION" - implementation "androidx.constraintlayout:constraintlayout:2.0.0-beta4" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KX_COROUTINES_VERSION" + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.legacy:legacy-preference-v14:1.0.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.2.1' implementation 'com.google.zxing:core:3.4.1' - implementation "io.ktor:ktor-client-core:$KTOR_VERSION" - implementation "io.ktor:ktor-client-android:$KTOR_VERSION" - implementation "io.ktor:ktor-client-json:$KTOR_VERSION" - implementation "io.ktor:ktor-client-jackson:$KTOR_VERSION" - implementation "com.google.guava:guava:30.0-android" - - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1' - - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - compileOnly "javax.annotation:jsr250-api:1.0" - compileOnly "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" + implementation 'com.opencsv:opencsv:3.10' + implementation project(":uhabits-core") + implementation project(":android-pickers") kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION" - kapt "com.jakewharton:butterknife-compiler:10.2.1" - annotationProcessor "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" - - androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' - androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' - androidTestImplementation "com.google.dagger:dagger:$DAGGER_VERSION" - androidTestImplementation "com.linkedin.testbutler:test-butler-library:1.3.1" - androidTestCompileOnly "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" - androidTestAnnotationProcessor "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" - androidTestImplementation 'androidx.annotation:annotation:1.0.0' - androidTestImplementation 'androidx.test:rules:1.1.1' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation "io.ktor:ktor-client-mock:$KTOR_VERSION" - androidTestImplementation "io.ktor:ktor-jackson:$KTOR_VERSION" - androidTestImplementation project(":uhabits-core") kaptAndroidTest "com.google.dagger:dagger-compiler:$DAGGER_VERSION" - - // mockito-android 2+ includes net.bytebuddy, which causes tests to fail. - // Excluding the package net.bytebuddy on AndroidManifest.xml breaks some - // AndroidJUnitRunner functionality, such as running individual methods. - androidTestImplementation "org.mockito:mockito-core:1.10.19" - androidTestImplementation "com.google.dexmaker:dexmaker-mockito:1.2" - testImplementation "com.google.dagger:dagger:$DAGGER_VERSION" - testImplementation "org.mockito:mockito-core:2.8.9" - testImplementation "org.mockito:mockito-inline:2.8.9" testImplementation "junit:junit:4.12" - - implementation('com.opencsv:opencsv:3.10') { - exclude group: 'commons-logging', module: 'commons-logging' - } - implementation('io.socket:socket.io-client:0.8.3') { - exclude group: 'org.json', module: 'json' - } + testImplementation "org.mockito:mockito-core:2.28.2" + testImplementation "org.mockito:mockito-inline:2.8.9" } kapt { diff --git a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/HabitCardViewTest.kt b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/HabitCardViewTest.kt index 2c1d94e4f..2d8e4cc32 100644 --- a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/HabitCardViewTest.kt +++ b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/HabitCardViewTest.kt @@ -19,9 +19,8 @@ package org.isoron.uhabits.activities.habits.list.views -import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.ext.junit.runners.* import androidx.test.filters.* -import androidx.test.runner.* import org.isoron.uhabits.* import org.isoron.uhabits.core.models.* import org.junit.* diff --git a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/CheckmarkWidgetTest.java b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/CheckmarkWidgetTest.java index f697b5021..2b0bd4771 100644 --- a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/CheckmarkWidgetTest.java +++ b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/CheckmarkWidgetTest.java @@ -19,11 +19,10 @@ package org.isoron.uhabits.widgets; -import androidx.test.filters.*; - import android.widget.*; -import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.ext.junit.runners.*; +import androidx.test.filters.*; import org.isoron.uhabits.*; import org.isoron.uhabits.core.models.*; diff --git a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/FrequencyWidgetTest.java b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/FrequencyWidgetTest.java index 626e53b3b..45275e4fc 100644 --- a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/FrequencyWidgetTest.java +++ b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/FrequencyWidgetTest.java @@ -19,11 +19,10 @@ package org.isoron.uhabits.widgets; -import androidx.test.filters.*; -import androidx.test.runner.*; import android.widget.*; -import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.ext.junit.runners.*; +import androidx.test.filters.*; import org.isoron.uhabits.*; import org.isoron.uhabits.core.models.*; diff --git a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/HistoryWidgetTest.java b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/HistoryWidgetTest.java index 758e4f519..d5c59fa6c 100644 --- a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/HistoryWidgetTest.java +++ b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/HistoryWidgetTest.java @@ -19,15 +19,13 @@ package org.isoron.uhabits.widgets; -import androidx.test.filters.*; -import androidx.test.runner.*; import android.widget.*; -import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.ext.junit.runners.*; +import androidx.test.filters.*; import org.isoron.uhabits.*; import org.isoron.uhabits.core.models.*; -import org.isoron.uhabits.utils.*; import org.junit.*; import org.junit.runner.*; diff --git a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/ScoreWidgetTest.java b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/ScoreWidgetTest.java index ff977b088..596947d49 100644 --- a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/ScoreWidgetTest.java +++ b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/ScoreWidgetTest.java @@ -19,11 +19,10 @@ package org.isoron.uhabits.widgets; -import androidx.test.filters.*; -import androidx.test.runner.*; import android.widget.*; -import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.ext.junit.runners.*; +import androidx.test.filters.*; import org.isoron.uhabits.*; import org.isoron.uhabits.core.models.*; diff --git a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/StreakWidgetTest.java b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/StreakWidgetTest.java index 9bd6f99c5..9800e246d 100644 --- a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/StreakWidgetTest.java +++ b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/StreakWidgetTest.java @@ -19,11 +19,10 @@ package org.isoron.uhabits.widgets; -import androidx.test.filters.*; -import androidx.test.runner.*; import android.widget.*; -import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.ext.junit.runners.*; +import androidx.test.filters.*; import org.isoron.uhabits.*; import org.isoron.uhabits.core.models.*; diff --git a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/views/CheckmarkWidgetViewTest.java b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/views/CheckmarkWidgetViewTest.java index 38d71c5bd..c871a26aa 100644 --- a/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/views/CheckmarkWidgetViewTest.java +++ b/android/uhabits-android/src/androidTest/java/org/isoron/uhabits/widgets/views/CheckmarkWidgetViewTest.java @@ -19,10 +19,8 @@ package org.isoron.uhabits.widgets.views; +import androidx.test.ext.junit.runners.*; import androidx.test.filters.*; -import androidx.test.runner.*; - -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.isoron.uhabits.*; import org.isoron.uhabits.core.models.*; diff --git a/android/uhabits-core/build.gradle b/android/uhabits-core/build.gradle index cf004ef34..9f553108d 100644 --- a/android/uhabits-core/build.gradle +++ b/android/uhabits-core/build.gradle @@ -5,35 +5,26 @@ apply plugin: 'kotlin' dependencies { annotationProcessor "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" annotationProcessor "com.google.dagger:dagger:$DAGGER_VERSION" - - compileOnly 'javax.annotation:jsr250-api:1.0' - compileOnly 'org.jetbrains:annotations:18.0.0' compileOnly "com.google.auto.factory:auto-factory:$AUTO_FACTORY_VERSION" compileOnly "com.google.dagger:dagger:$DAGGER_VERSION" - - implementation 'androidx.annotation:annotation:1.0.0' - implementation 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'org.apache.commons:commons-lang3:3.5' - implementation 'commons-codec:commons-codec:1.15' - implementation 'com.google.code.gson:gson:2.8.5' + compileOnly 'javax.annotation:jsr250-api:1.0' + compileOnly 'org.jetbrains:annotations:18.0.0' implementation "com.google.guava:guava:30.0-jre" implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$KOTLIN_VERSION" - + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$KX_COROUTINES_VERSION" + implementation 'androidx.annotation:annotation:1.1.0' + implementation 'com.google.code.findbugs:jsr305:3.0.2' + implementation 'commons-codec:commons-codec:1.15' + implementation 'org.apache.commons:commons-lang3:3.5' + implementation 'com.opencsv:opencsv:3.10' + testImplementation "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION" + testImplementation "org.jetbrains.kotlin:kotlin-test:$KOTLIN_VERSION" testImplementation 'junit:junit:4.12' - testImplementation 'org.hamcrest:hamcrest-library:1.4-atlassian-1' + testImplementation 'nl.jqno.equalsverifier:equalsverifier:2.4.8' testImplementation 'org.apache.commons:commons-io:1.3.2' - testImplementation 'org.mockito:mockito-core:2.8.9' - testImplementation 'org.json:json:20160810' + testImplementation 'org.hamcrest:hamcrest-library:1.4-atlassian-1' + testImplementation 'org.mockito:mockito-core:2.28.2' testImplementation 'org.xerial:sqlite-jdbc:3.18.0' - testImplementation 'nl.jqno.equalsverifier:equalsverifier:2.4.8' - testImplementation "org.jetbrains.kotlin:kotlin-test:$KOTLIN_VERSION" - testImplementation "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION" - - implementation('com.opencsv:opencsv:3.10') { - exclude group: 'commons-logging', module: 'commons-logging' - } - } sourceCompatibility = "1.8"