diff --git a/configuration/src/main/kotlin/com/malinskiy/marathon/config/vendor/android/ScreenRecordConfiguration.kt b/configuration/src/main/kotlin/com/malinskiy/marathon/config/vendor/android/ScreenRecordConfiguration.kt index 1489b7386..679050ef3 100644 --- a/configuration/src/main/kotlin/com/malinskiy/marathon/config/vendor/android/ScreenRecordConfiguration.kt +++ b/configuration/src/main/kotlin/com/malinskiy/marathon/config/vendor/android/ScreenRecordConfiguration.kt @@ -18,7 +18,7 @@ enum class RecorderType { @JsonCreator fun fromString(key: String?): RecorderType? { return key?.let { - RecorderType.valueOf(it.toUpperCase()) + RecorderType.valueOf(it.uppercase()) } } } diff --git a/core/src/main/kotlin/com/malinskiy/marathon/coroutines/ThreadPoolDispatcher.kt b/core/src/main/kotlin/com/malinskiy/marathon/coroutines/ThreadPoolDispatcher.kt index a12652b6e..cddca1bdb 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/coroutines/ThreadPoolDispatcher.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/coroutines/ThreadPoolDispatcher.kt @@ -4,7 +4,7 @@ import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineExceptionHandler import mu.KLogger -fun newCoroutineExceptionHandler(logger: KLogger) = CoroutineExceptionHandler { context, exception -> +fun newCoroutineExceptionHandler(logger: KLogger) = CoroutineExceptionHandler { _, exception -> when (exception) { null -> logger.debug { "CoroutineContext finished" } is CancellationException -> logger.debug(exception) { "CoroutineContext cancelled" } diff --git a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt index 1fdec6118..9d1338281 100644 --- a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt +++ b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt @@ -58,7 +58,7 @@ abstract class BaseAndroidDevice( override var manufacturer: String = "Unknown" override var deviceFeatures: Collection = emptyList() override var apiLevel: Int = version.apiLevel - override var operatingSystem: OperatingSystem = OperatingSystem(version.apiString) + override var operatingSystem: OperatingSystem = OperatingSystem(version.apiStringWithoutExtension) override var initialRotation: Rotation = Rotation.ROTATION_0 var realSerialNumber: String = "Unknown" var booted: Boolean = false @@ -92,7 +92,7 @@ abstract class BaseAndroidDevice( AndroidVersion(sdk.toInt(), codename) } else AndroidVersion.DEFAULT apiLevel = version.apiLevel - operatingSystem = OperatingSystem(version.apiString) + operatingSystem = OperatingSystem(version.apiStringWithoutExtension) model = getProperty("ro.product.model") ?: "Unknown" manufacturer = getProperty("ro.product.manufacturer") ?: "Unknown" initialRotation = fetchRotation() diff --git a/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/AppleApplicationInstaller.kt b/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/AppleApplicationInstaller.kt index ecd8bf5f1..4c0ffc49e 100644 --- a/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/AppleApplicationInstaller.kt +++ b/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/AppleApplicationInstaller.kt @@ -31,7 +31,7 @@ open class AppleApplicationInstaller( val bundle = AppleTestBundle(app, testApp, xctest, device.sdk) val relativeTestBinaryPath = bundle.relativeBinaryPath val testBinary = bundle.testBinary - var remoteXctest = "" + val remoteXctest: String if (testApp != null) { logger.debug { "Moving xctest runner application to ${device.serialNumber}" } diff --git a/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/RemoteFileManager.kt b/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/RemoteFileManager.kt index d04d92eb3..0ba5b9523 100644 --- a/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/RemoteFileManager.kt +++ b/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/RemoteFileManager.kt @@ -70,9 +70,7 @@ class RemoteFileManager(private val device: AppleDevice) { private suspend fun safeExecuteCommand(command: List) { try { device.executeWorkerCommand(command) - } catch (e: Exception) { - null - } + } catch (_: Exception) {} } private suspend fun executeCommand(command: List, errorMessage: String): String? { diff --git a/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/plist/PropertyList.kt b/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/plist/PropertyList.kt index 7c943a5e2..681739009 100644 --- a/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/plist/PropertyList.kt +++ b/vendor/vendor-apple/base/src/main/kotlin/com/malinskiy/marathon/apple/plist/PropertyList.kt @@ -1,7 +1,9 @@ package com.malinskiy.marathon.apple.plist +import com.dd.plist.BinaryPropertyListWriter import com.dd.plist.NSObject import com.dd.plist.PropertyListParser +import com.dd.plist.XMLPropertyListWriter import java.io.File import java.io.InputStream import java.io.OutputStream @@ -20,22 +22,20 @@ abstract class PropertyList(val delegate: T) { } } - - fun saveAsBinary(file: File) { - PropertyListParser.saveAsBinary(delegate, file) + BinaryPropertyListWriter.write(delegate, file) } fun saveAsBinary(outputStream: OutputStream) { - PropertyListParser.saveAsBinary(delegate, outputStream) + BinaryPropertyListWriter.write(delegate, outputStream) } fun saveAsXML(file: File) { - PropertyListParser.saveAsXML(delegate, file) + XMLPropertyListWriter.write(delegate, file) } fun saveAsXML(outputStream: OutputStream) { - PropertyListParser.saveAsXML(delegate, outputStream) + XMLPropertyListWriter.write(delegate, outputStream) } override fun equals(other: Any?): Boolean {