Skip to content

Instantly share code, notes, and snippets.

View cesar1000's full-sized avatar

Cesar Puerta cesar1000

View GitHub Profile
@cesar1000
cesar1000 / BlockUserItemHydrator.kt
Created July 5, 2020 03:19
Indeterministic Kapt stub generation
class BlockUserItemHydrator() : RichFeedbackActionItemHydrator<TwitterUser, RichFeedbackBehaviorBlockUser> {
override fun RichFeedbackBehaviorBlockUser.hydrate(): Pair<RichFeedbackBehaviorBlockUser, TwitterUser?> =
RichFeedbackBehaviorBlockUser.DEFAULT to null
override fun getPrompt(data: TwitterUser): String = "" // implementation removed
@HorizonIcon
override fun getIcon(data: TwitterUser): String? = null // implementation removed
}
@cesar1000
cesar1000 / OrderedTestClassScanner.java
Last active April 17, 2024 05:23
Ordered unit tests in Gradle
package com.twitter.gradle.plugin.orderedtest;
import org.gradle.api.file.EmptyFileVisitor;
import org.gradle.api.file.FileTree;
import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.internal.file.RelativeFile;
import org.gradle.api.internal.tasks.testing.DefaultTestClassRunInfo;
import org.gradle.api.internal.tasks.testing.TestClassProcessor;
import org.gradle.api.internal.tasks.testing.TestClassRunInfo;
import org.gradle.api.internal.tasks.testing.detection.TestFrameworkDetector;