Skip to content

Commit

Permalink
Merge pull request #5503 from grzesiek2010/dependency_updates_v2023.2
Browse files Browse the repository at this point in the history
Dependency updates v2023.2
  • Loading branch information
grzesiek2010 authored Mar 23, 2023
2 parents ef7e68d + a39b629 commit e2a67c6
Show file tree
Hide file tree
Showing 117 changed files with 373 additions and 359 deletions.
4 changes: 1 addition & 3 deletions analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}

namespace 'org.odk.collect.analytics'
}

Expand Down
4 changes: 0 additions & 4 deletions androidshared/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

testOptions {
unitTests {
includeAndroidResources = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class ImageCompressorTest {

// unsupported exif tags
ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH to "5",
ExifInterface.TAG_DNG_VERSION to "100",
ExifInterface.TAG_DNG_VERSION to "100"
)

saveTestBitmap(3000, 4000, attributes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class ImageFileUtilsTest {
assertEquals(
ExifInterface.ORIENTATION_UNDEFINED,
exifData.getAttributeInt(
ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_UNDEFINED
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ object ImageFileUtils {
@JvmStatic
fun saveBitmapToFile(bitmap: Bitmap?, path: String) {
val compressFormat =
if (path.lowercase(Locale.getDefault()).endsWith(".png"))
if (path.lowercase(Locale.getDefault()).endsWith(".png")) {
CompressFormat.PNG
else CompressFormat.JPEG
} else {
CompressFormat.JPEG
}
try {
if (bitmap != null) {
FileOutputStream(path).use { out -> bitmap.compress(compressFormat, IMAGE_COMPRESS_QUALITY, out) }
Expand Down Expand Up @@ -101,7 +103,9 @@ object ImageFileUtils {
if (bitmap != null) {
bitmap = Bitmap.createScaledBitmap(
bitmap,
newWidth.toInt(), newHeight.toInt(), false
newWidth.toInt(),
newHeight.toInt(),
false
)
}
} else {
Expand All @@ -122,7 +126,11 @@ object ImageFileUtils {
if (bitmap != null) {
Timber.i(
"Screen is %dx%d. Image has been scaled down by %f to %dx%d",
screenHeight, screenWidth, scale, bitmap.height, bitmap.width
screenHeight,
screenWidth,
scale,
bitmap.height,
bitmap.width
)
}
return bitmap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object PrefUtils {
title: String,
labelIds: IntArray,
values: Array<String>,
settings: Settings,
settings: Settings
): ListPreference {
val labels: Array<String?> = labelIds.map { context.getString(it) }.toTypedArray()
return createListPref(context, key, title, labels, values, settings)
Expand Down Expand Up @@ -48,7 +48,7 @@ object PrefUtils {
title: String,
labels: Array<String?>,
values: Array<String>,
settings: Settings,
settings: Settings
): ListPreference {
ensurePrefHasValidValue(key, values, settings)
return ListPreference(context).also {
Expand All @@ -65,7 +65,7 @@ object PrefUtils {
private fun ensurePrefHasValidValue(
key: String,
validValues: Array<String>,
settings: Settings,
settings: Settings
) {
val value = settings.getString(key)
if (validValues.indexOf(value) < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class MultiClickSafeButton : MaterialButton {
constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet?) : super(
context, attrs
context,
attrs
)

override fun performClick(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class MultiClickSafeImageButton : AppCompatImageButton {
constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet?) : super(
context, attrs
context,
attrs
)

override fun performClick(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class MultiClickSafeTextInputEditText : TextInputEditText {
constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet?) : super(
context, attrs
context,
attrs
)

override fun performClick(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import androidx.test.espresso.action.ViewActions.pressBack
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.`is`
import org.hamcrest.Matchers.equalToIgnoringCase
import org.hamcrest.Matchers.`is`
import org.hamcrest.Matchers.nullValue
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry

class FakeLifecycleOwner : LifecycleOwner {

private val lifecycle: LifecycleRegistry by lazy {
private val lifecycleRegistry: LifecycleRegistry by lazy {
LifecycleRegistry(this).also {
it.handleLifecycleEvent(Lifecycle.Event.ON_RESUME)
}
}

override val lifecycle: LifecycleRegistry = lifecycleRegistry

fun destroy() {
lifecycle.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY)
}

override fun getLifecycle(): Lifecycle {
return lifecycle
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun <T> LiveData<T>.getOrAwaitValue(
var data: T? = null
val latch = CountDownLatch(1)
val observer = object : Observer<T> {
override fun onChanged(o: T?) {
override fun onChanged(o: T) {
data = o
latch.countDown()
this@getOrAwaitValue.removeObserver(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package org.odk.collect.audioclips
import android.media.MediaPlayer
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.map
import org.odk.collect.async.Cancellable
import org.odk.collect.async.Scheduler
import java.io.File
Expand Down Expand Up @@ -57,7 +57,7 @@ class AudioClipViewModel(private val mediaPlayerFactory: Supplier<MediaPlayer>,
}

fun isPlaying(clipID: String): LiveData<Boolean> {
return Transformations.map(currentlyPlaying) { value ->
return currentlyPlaying.map { value ->
if (isCurrentPlayingClip(clipID, value)) {
!value!!.isPaused
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import org.junit.Rule
import org.junit.Test
import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatchers
import org.mockito.Mockito.`when`
import org.mockito.Mockito.doThrow
import org.mockito.Mockito.inOrder
import org.mockito.Mockito.mock
import org.mockito.Mockito.never
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.odk.collect.androidtest.getOrAwaitValue
import org.odk.collect.testshared.FakeScheduler
import java.io.File
Expand Down
4 changes: 0 additions & 4 deletions audiorecorder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

testOptions {
unitTests.includeAndroidResources = true
}
Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.0'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21"
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.1.0"
classpath "com.github.ben-manes:gradle-versions-plugin:0.44.0"
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.3.1"
classpath "com.github.ben-manes:gradle-versions-plugin:0.46.0"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3"
classpath "com.google.android.gms:oss-licenses-plugin:0.10.6"
}
Expand Down Expand Up @@ -64,6 +64,7 @@ allprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
freeCompilerArgs = ['-Xjvm-default=all']
jvmTarget = '1.8'
}
}
}
Expand Down
36 changes: 18 additions & 18 deletions buildSrc/src/main/java/dependencies/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
package dependencies

object Dependencies {
const val desugar = "com.android.tools:desugar_jdk_libs:1.1.5"
const val desugar = "com.android.tools:desugar_jdk_libs:2.0.2"
const val androidx_startup = "androidx.startup:startup-runtime:1.1.1"
const val androidx_annotations = "androidx.annotation:annotation:1.5.0"
const val androidx_annotations = "androidx.annotation:annotation:1.6.0"
const val androidx_lifecycle_runtime_ktx = "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifecycle}"
const val androidx_viewpager2= "androidx.viewpager2:viewpager2:1.0.0"
const val androidx_lifecycle_livedata_ktx = "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.lifecycle}"
const val androidx_lifecycle_viewmodel_ktx = "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycle}"
const val androidx_core_ktx = "androidx.core:core-ktx:1.9.0"
const val androidx_browser = "androidx.browser:browser:1.4.0"
const val androidx_recyclerview = "androidx.recyclerview:recyclerview:1.2.1"
const val androidx_browser = "androidx.browser:browser:1.5.0"
const val androidx_recyclerview = "androidx.recyclerview:recyclerview:1.3.0"
const val androidx_fragment = "androidx.fragment:fragment:${Versions.androidx_fragment}"
const val androidx_navigation_fragment_ktx = "androidx.navigation:navigation-fragment-ktx:2.5.3"
const val androidx_navigation_ui = "androidx.navigation:navigation-ui-ktx:2.5.3"
const val androidx_appcompat = "androidx.appcompat:appcompat:1.5.1"
const val androidx_appcompat = "androidx.appcompat:appcompat:1.6.1"
const val androidx_work_runtime = "androidx.work:work-runtime:${Versions.work}"
const val androidx_cardview = "androidx.cardview:cardview:1.0.0"
const val androidx_exinterface = "androidx.exifinterface:exifinterface:1.3.6"
const val androidx_multidex = "androidx.multidex:multidex:2.0.1"
const val androidx_preference_ktx = "androidx.preference:preference-ktx:1.2.0"
const val androidx_fragment_ktx = "androidx.fragment:fragment-ktx:${Versions.androidx_fragment}"
const val android_material = "com.google.android.material:material:1.7.0"
const val android_material = "com.google.android.material:material:1.8.0"
const val android_flexbox = "com.google.android.flexbox:flexbox:3.0.0"
const val google_api_client_android = "com.google.api-client:google-api-client-android:2.1.1"
const val google_api_services_drive = "com.google.apis:google-api-services-drive:v3-rev20221023-2.0.0"
const val google_api_services_sheets = "com.google.apis:google-api-services-sheets:v4-rev20220927-2.0.0"
const val play_services_auth = "com.google.android.gms:play-services-auth:20.4.0"
const val google_api_client_android = "com.google.api-client:google-api-client-android:2.2.0"
const val google_api_services_drive = "com.google.apis:google-api-services-drive:v3-rev20230212-2.0.0"
const val google_api_services_sheets = "com.google.apis:google-api-services-sheets:v4-rev20230227-2.0.0"
const val play_services_auth = "com.google.android.gms:play-services-auth:20.4.1"
const val play_services_maps = "com.google.android.gms:play-services-maps:18.1.0"
const val play_services_location = "com.google.android.gms:play-services-location:20.0.0" // Check if map screens still work when upgrading
const val play_services_oss_licenses = "com.google.android.gms:play-services-oss-licenses:17.0.0"
const val mapbox_android_sdk = "com.mapbox.maps:android:10.10.0"
const val mapbox_android_sdk = "com.mapbox.maps:android:10.11.2"
const val osmdroid = "org.osmdroid:osmdroid-android:6.1.14"
const val guava = "com.google.guava:guava:31.1-android"
const val squareup_okhttp = "com.squareup.okhttp3:okhttp:${Versions.okhttp3}"
const val squareup_okhttp_tls = "com.squareup.okhttp3:okhttp-tls:${Versions.okhttp3}"
const val burgstaller_okhttp_digest = "io.github.rburgst:okhttp-digest:3.0"
const val burgstaller_okhttp_digest = "io.github.rburgst:okhttp-digest:3.0.1"
const val persian_joda_time = "com.github.mohamadian:persianjodatime:1.2"
const val myanmar_calendar = "com.github.chanmratekoko:myanmar-calendar:1.0.6.RC3"
const val bikram_sambat = "bikramsambat:bikram-sambat:1.1.0"
Expand All @@ -57,17 +57,17 @@ object Dependencies {
const val glide_compiler = "com.github.bumptech.glide:compiler:${Versions.glide}"
const val caverock_androidsvg = "com.caverock:androidsvg-aar:1.4"
const val mp4parser_muxer = "org.mp4parser:muxer:1.9.41" // Check if https://github.com/getodk/collect/issues/5323 no longer takes place before upgrading
const val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:1.7.22"
const val gson = "com.google.code.gson:gson:2.10"
const val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
const val gson = "com.google.code.gson:gson:2.10.1"
const val firebase_analytics = "com.google.firebase:firebase-analytics:21.2.0"
const val firebase_crashlytics = "com.google.firebase:firebase-crashlytics:18.3.2"
const val firebase_crashlytics = "com.google.firebase:firebase-crashlytics:18.3.5"
const val fastlane_screengrab = "tools.fastlane:screengrab:2.1.1"
const val leakcanary = "com.squareup.leakcanary:leakcanary-android:2.10"
const val timber = "com.jakewharton.timber:timber:5.0.1"
const val slf4j_api = "org.slf4j:slf4j-api:2.0.6"
const val slf4j_timber = "com.arcao:slf4j-timber:3.1@aar"
const val emoji_java = "com.vdurmont:emoji-java:5.1.1"
const val json_schema_validator = "com.networknt:json-schema-validator:1.0.75"
const val json_schema_validator = "com.networknt:json-schema-validator:1.0.78"
const val splashscreen = "androidx.core:core-splashscreen:1.0.0"
const val camerax_core = "androidx.camera:camera-core:${Versions.camerax}"
const val camerax_view = "androidx.camera:camera-view:${Versions.camerax}"
Expand All @@ -81,14 +81,14 @@ object Dependencies {
const val mockito_inline = "org.mockito:mockito-inline:${Versions.mockito}"
const val mockito_kotlin = "org.mockito.kotlin:mockito-kotlin:4.1.0"
const val androidx_fragment_testing = "androidx.fragment:fragment-testing:${Versions.androidx_fragment}"
const val androidx_arch_core_testing = "androidx.arch.core:core-testing:2.1.0"
const val androidx_arch_core_testing = "androidx.arch.core:core-testing:2.2.0"
const val androidx_work_testing = "androidx.work:work-testing:${Versions.work}"
const val androidx_test_core_ktx = "androidx.test:core-ktx:1.5.0"
const val androidx_test_rules = "androidx.test:rules:1.5.0"
const val androidx_test_espresso_contrib = "androidx.test.espresso:espresso-contrib:${Versions.espresso}"
const val androidx_test_espresso_core = "androidx.test.espresso:espresso-core:${Versions.espresso}"
const val androidx_test_espresso_intents = "androidx.test.espresso:espresso-intents:${Versions.espresso}"
const val androidx_test_ext_junit = "androidx.test.ext:junit:1.1.4"
const val androidx_test_ext_junit = "androidx.test.ext:junit:1.1.5"
const val okhttp3_mockwebserver = "com.squareup.okhttp3:mockwebserver:${Versions.okhttp3}"
const val hamcrest = "org.hamcrest:hamcrest:2.2"
const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}"
Expand Down
14 changes: 7 additions & 7 deletions buildSrc/src/main/java/dependencies/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ object Versions {
const val android_target_sdk = 31

const val androidx_fragment = "1.5.5"
const val dagger = "2.44.2"
const val espresso = "3.5.0"
const val glide = "4.14.2"
const val mockito = "4.10.0"
const val dagger = "2.45"
const val espresso = "3.5.1"
const val glide = "4.15.1"
const val mockito = "5.2.0"
const val okhttp3 = "4.10.0"
const val robolectric = "4.9"
const val work = "2.7.1"
const val lifecycle = "2.5.1"
const val camerax = "1.2.0"
const val work = "2.8.0"
const val lifecycle = "2.6.0"
const val camerax = "1.2.1"
}
5 changes: 1 addition & 4 deletions collect_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

testOptions {
unitTests {
includeAndroidResources = true
Expand Down Expand Up @@ -341,6 +337,7 @@ dependencies {

// Android Architecture Components:
implementation Dependencies.androidx_lifecycle_runtime_ktx
implementation Dependencies.androidx_lifecycle_livedata_ktx
implementation Dependencies.androidx_viewpager2

// Dagger:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class InstanceUploadActionTest {

@Test
fun whenInstanceDoesNotExist_showsError() {

val instanceIds = longArrayOf(11)
instanceUploadAction(instanceIds)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FakeClickableMapFragment : Fragment(), MapFragment {

override fun init(
readyListener: MapFragment.ReadyListener?,
errorListener: MapFragment.ErrorListener?,
errorListener: MapFragment.ErrorListener?
) {
readyListener?.onReady(this)
}
Expand Down
Loading

0 comments on commit e2a67c6

Please sign in to comment.