This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log | |
import com.google.gson.Gson | |
import io.reactivex.Completable | |
import io.reactivex.Maybe | |
import io.reactivex.Observable | |
import io.reactivex.Single | |
const val TAG = "MyAppRx" | |
fun Completable.logEvents(hint: String? = null): Completable = this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"frameworks": [ | |
{ | |
"startDate": 1585388826446, | |
"endDate": 1585388826446, | |
"active": true, | |
"name": "Android" | |
}, | |
{ | |
"startDate": 1585388826446, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package android.support.test.orchestrator; | |
import android.app.Instrumentation; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.ServiceConnection; | |
import android.content.pm.PackageManager.NameNotFoundException; | |
import android.os.Build.VERSION; | |
import android.os.Bundle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.gradle.api.DefaultTask | |
import org.gradle.api.tasks.InputFile | |
import java.io.File | |
/** | |
* Make sure the task is open. Otherwise the plugin will fail with exception: | |
* org.gradle.api.GradleException: Could not generate a proxy class for class com.sample.coolplugin.CoolTask. | |
*/ | |
open class CoolTask : DefaultTask() { | |
// Represents path to the instrumentation task that get generated for the tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sample.coolplugin | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import org.gradle.api.Task | |
class CoolPlugin : Plugin<Project> { | |
override fun apply(project: Project) { | |
validateAndroidPluginVersion3or31("Version of Android plugin should be >= 3.0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Yields all available variants of type [TestVariant]. | |
*/ | |
internal fun DomainObjectCollection<out BaseVariant>.forEachTestVariant(block: (TestVariant) -> Unit) { | |
all { variant -> | |
when (variant) { | |
is ApplicationVariant -> variant.testVariant?.let(block) | |
is TestVariant -> block(variant) | |
is LibraryVariant -> variant.testVariant?.let(block) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns the collection of Android variants on the basis of applied plugin. If the Android plugins are missing we | |
* are throwing build error. | |
*/ | |
internal fun Project.getAndroidVariantsOrThrow(errorMessage: String): DomainObjectCollection<out BaseVariant> { | |
return when { | |
this.plugins.hasPlugin("com.android.application") -> { | |
val ext = project.extensions.findByType(AppExtension::class.java) | |
ext!!.applicationVariants | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sample.coolplugin | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
/** | |
* Verifies if the plugin supports Android Gradle plugin of version 3.0 or 3.1. | |
*/ | |
internal fun Plugin<Project>.validateAndroidPluginVersion3or31(errorMessage: String) { | |
var gradlePluginVersion: String? = null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.test.espresso.IdlingResource | |
import co.metalab.asyncawait.onIdleCoroutines | |
import co.metalab.asyncawait.onRunningCoroutine | |
class AsyncIdlingResource : IdlingResource { | |
private var areCoroutinesIdle = true | |
private var callback: IdlingResource.ResourceCallback? = null | |
override fun getName(): String = "AsyncIdlingResource" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.test.espresso.Espresso.onView | |
import android.support.test.espresso.assertion.ViewAssertions.matches | |
import android.support.test.espresso.matcher.ViewMatchers.* | |
import android.support.test.runner.AndroidJUnit4 | |
import android.view.View | |
import org.junit.Rule | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
// https://gist.github.com/tomkoptel/1101b2bb61f3daf251e3d627ee533b92 |
NewerOlder