Skip to content

Commit

Permalink
Merge pull request #1 from rafaeltoledo/master
Browse files Browse the repository at this point in the history
Update dependencies and targets Q on sample
  • Loading branch information
joshschriever authored Nov 4, 2019
2 parents a1bdb58 + 27f9e69 commit 39788a6
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 26 deletions.
9 changes: 5 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ plugins {
}

android {
compileSdkVersion(28)
compileSdkVersion(29)
buildToolsVersion("29.0.2")
defaultConfig {
minSdkVersion(21)
targetSdkVersion(28)
targetSdkVersion(29)
applicationId = "com.banno.android.gordontest"
versionCode = 1
versionName = "1.0"
Expand All @@ -31,6 +32,6 @@ dependencies {
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
implementation("com.google.android.material:material:1.0.0")

androidTestImplementation("androidx.test:runner:1.1.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.1.1")
androidTestImplementation("androidx.test:runner:1.2.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0")
}
8 changes: 4 additions & 4 deletions gordon-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {
dependencies {
implementation(gradleKotlinDsl())
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.12.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.13.0")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.12")

val androidGradlePluginVersion: String by project
Expand All @@ -26,11 +26,11 @@ dependencies {
implementation("org.smali:dexlib:1.4.2")
implementation("com.shazam:axmlparser:1.0")

implementation("io.arrow-kt:arrow-core-data:0.9.0")
implementation("io.arrow-kt:arrow-effects-io-extensions:0.9.0")
implementation("io.arrow-kt:arrow-core-data:0.10.2")
implementation("io.arrow-kt:arrow-fx:0.10.2")

testImplementation("junit:junit:4.12")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.banno.gordon

import arrow.effects.IO
import arrow.effects.extensions.io.fx.fx
import arrow.fx.IO
import arrow.fx.extensions.fx
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineStart
Expand Down Expand Up @@ -43,7 +43,7 @@ internal fun JadbDevice.executeShellWithTimeout(
internal fun JadbDevice.isTablet(): IO<Boolean> =
executeShellWithTimeout(20_000, "getprop", "ro.build.characteristics").map { it!!.contains("tablet") }

internal fun JadbDevice.installApk(apk: File, vararg options: String) = fx {
internal fun JadbDevice.installApk(apk: File, vararg options: String) = IO.fx {
val remoteFile = RemoteFile("/data/local/tmp/" + apk.name)

push(apk, remoteFile)
Expand Down
6 changes: 3 additions & 3 deletions gordon-plugin/src/main/kotlin/com/banno/gordon/DevicePools.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.banno.gordon

import arrow.effects.IO
import arrow.effects.extensions.io.fx.fx
import arrow.fx.IO
import arrow.fx.extensions.fx
import se.vidstige.jadb.JadbConnection
import se.vidstige.jadb.JadbDevice

Expand All @@ -12,7 +12,7 @@ internal data class DevicePool(
val devices: List<JadbDevice>
)

internal fun calculatePools(adb: JadbConnection, strategy: PoolingStrategy): IO<List<DevicePool>> = fx {
internal fun calculatePools(adb: JadbConnection, strategy: PoolingStrategy): IO<List<DevicePool>> = IO.fx {
val allDevices = adb.getAllDevices().bind()

when (strategy) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.banno.gordon

import arrow.effects.extensions.io.fx.fx
import arrow.fx.IO
import arrow.fx.extensions.fx
import kotlinx.coroutines.Dispatchers
import org.gradle.api.DefaultTask
import org.gradle.api.file.Directory
Expand Down Expand Up @@ -64,7 +65,7 @@ internal abstract class GordonTestTask : DefaultTask() {

@TaskAction
private fun runTests() {
val runTests = fx {
val runTests = IO.fx {
testResultsDirectory.get().asFile.clear().bind()
reportDirectory.get().asFile.clear().bind()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.banno.gordon

import arrow.effects.IO
import arrow.effects.extensions.io.fx.fx
import arrow.fx.IO
import arrow.fx.extensions.fx
import com.shazam.axmlparser.AXMLParser
import java.io.File
import java.util.zip.ZipFile

internal fun getManifestPackage(apk: File): IO<String> = fx {
internal fun getManifestPackage(apk: File): IO<String> = IO.fx {
val manifestPackage: String? = loadFromManifest(apk) {
moveToTag("manifest")

Expand Down
6 changes: 3 additions & 3 deletions gordon-plugin/src/main/kotlin/com/banno/gordon/ReportFile.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.banno.gordon

import arrow.effects.IO
import arrow.effects.extensions.io.fx.fx
import arrow.fx.IO
import arrow.fx.extensions.fx
import java.io.File

internal data class ReportFile(val fileName: String, val fileContent: String)
Expand All @@ -13,7 +13,7 @@ internal fun ReportFile.write(directory: File) = IO {
.absolutePath
}

internal fun List<ReportFile>.write(directory: File) = fx {
internal fun List<ReportFile>.write(directory: File) = IO.fx {
forEach { it.write(directory).bind() }
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.banno.gordon

import arrow.effects.IO
import arrow.fx.IO
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineStart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal fun runTest(
logger.error("${device.serial}: $testName: UNABLE TO RUN")
TestResult.NotRun
}
) { shellOutput ->
) { shellOutput: String? ->
val testTime = shellOutput
?.substringAfter("Time: ")
?.substringBefore("\n")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.banno.gordon

import arrow.effects.IO
import arrow.fx.IO
import org.jf.dexlib.AnnotationDirectoryItem
import org.jf.dexlib.AnnotationItem
import org.jf.dexlib.ClassDefItem
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

0 comments on commit 39788a6

Please sign in to comment.