Skip to content

Commit

Permalink
Add JetBrain's new kotlin binary compatibility validator to start tra…
Browse files Browse the repository at this point in the history
…cking changes to our ABI.

Ignores all leaf sample projects individually, wildcards are not supported
(see Kotlin/binary-compatibility-validator#3).

Closes #243.
  • Loading branch information
zach-klippenstein committed Feb 10, 2020
1 parent 923a0f2 commit 1b130e5
Show file tree
Hide file tree
Showing 14 changed files with 1,287 additions and 0 deletions.
32 changes: 32 additions & 0 deletions kotlin/build.gradle
Expand Up @@ -72,6 +72,7 @@ buildscript {
'timber': "com.jakewharton.timber:timber:4.7.1",

'kotlin': [
'binaryCompatibilityValidatorPlugin': "org.jetbrains.kotlinx:binary-compatibility-validator:0.1.1",
'gradlePlugin': "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61",
'stdLib': [
'common': "org.jetbrains.kotlin:kotlin-stdlib-common",
Expand Down Expand Up @@ -142,6 +143,7 @@ buildscript {
classpath deps.detekt
classpath deps.dokka
classpath deps.jmh.gradlePlugin
classpath deps.kotlin.binaryCompatibilityValidatorPlugin
classpath deps.kotlin.gradlePlugin
classpath deps.kotlin.serialization.gradlePlugin
classpath deps.ktlint
Expand All @@ -156,6 +158,8 @@ buildscript {
maven {
url { "https://oss.sonatype.org/content/repositories/snapshots" }
}
// For binary compatibility validator.
maven { url "https://kotlin.bintray.com/kotlinx" }
}
}

Expand Down Expand Up @@ -206,3 +210,31 @@ subprojects {
]
}
}

// We use JetBrain's Kotlin Binary Compatibility Validator to track changes to our public binary
// APIs.
// When making a change that results in a public ABI change, the apiCheck task will fail. When this
// happens, run ./gradlew apiDump to generate updated *.api files, and add those to your commit.
// See https://github.com/Kotlin/binary-compatibility-validator
apply plugin: 'binary-compatibility-validator'
apiValidation {
// Only leaf project name is valid configuration, and every project must be individually ignored.
// See https://github.com/Kotlin/binary-compatibility-validator/issues/3
ignoredProjects += [
"android",
"app-poetry",
"app-raven",
"common",
"hello-back-button",
"poetry",
"app",
"timemachine",
"timemachine-shakeable",
"hello-terminal-app",
"terminal-workflow",
"todo-terminal-app",
"hello-workflow",
"hello-workflow-fragment",
"recyclerview",
]
}
10 changes: 10 additions & 0 deletions kotlin/internal-testing-utils/api/internal-testing-utils.api
@@ -0,0 +1,10 @@
public final class com/squareup/workflow/internal/util/UncaughtExceptionGuard {
public fun <init> ()V
public final fun reportUncaught (Ljava/lang/Throwable;)V
public final fun runRethrowingUncaught (Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
}

public final class com/squareup/workflow/internal/util/UncaughtExceptionGuardKt {
public static final fun rethrowingUncaughtExceptions (Lkotlin/jvm/functions/Function0;)V
}

201 changes: 201 additions & 0 deletions kotlin/legacy/legacy-workflow-core/api/legacy-workflow-core.api
@@ -0,0 +1,201 @@
public final class com/squareup/workflow/legacy/CoroutineWorkflowKt {
public static final fun workflow (Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function4;)Lcom/squareup/workflow/legacy/Workflow;
public static synthetic fun workflow$default (Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/Workflow;
}

public final class com/squareup/workflow/legacy/EnterState : com/squareup/workflow/legacy/Reaction {
public fun <init> (Ljava/lang/Object;)V
public final fun component1 ()Ljava/lang/Object;
public final fun copy (Ljava/lang/Object;)Lcom/squareup/workflow/legacy/EnterState;
public static synthetic fun copy$default (Lcom/squareup/workflow/legacy/EnterState;Ljava/lang/Object;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/EnterState;
public fun equals (Ljava/lang/Object;)Z
public final fun getState ()Ljava/lang/Object;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class com/squareup/workflow/legacy/FinishWith : com/squareup/workflow/legacy/Reaction {
public fun <init> (Ljava/lang/Object;)V
public final fun component1 ()Ljava/lang/Object;
public final fun copy (Ljava/lang/Object;)Lcom/squareup/workflow/legacy/FinishWith;
public static synthetic fun copy$default (Lcom/squareup/workflow/legacy/FinishWith;Ljava/lang/Object;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/FinishWith;
public fun equals (Ljava/lang/Object;)Z
public final fun getResult ()Ljava/lang/Object;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class com/squareup/workflow/legacy/Finished : com/squareup/workflow/legacy/WorkflowUpdate {
public fun <init> (Ljava/lang/Object;)V
public final fun component1 ()Ljava/lang/Object;
public final fun copy (Ljava/lang/Object;)Lcom/squareup/workflow/legacy/Finished;
public static synthetic fun copy$default (Lcom/squareup/workflow/legacy/Finished;Ljava/lang/Object;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/Finished;
public fun equals (Ljava/lang/Object;)Z
public final fun getResult ()Ljava/lang/Object;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public abstract class com/squareup/workflow/legacy/Reaction {
}

public abstract interface class com/squareup/workflow/legacy/Reactor : com/squareup/workflow/legacy/WorkflowPool$Launcher {
public abstract fun launch (Ljava/lang/Object;Lcom/squareup/workflow/legacy/WorkflowPool;)Lcom/squareup/workflow/legacy/Workflow;
public abstract fun onReact (Ljava/lang/Object;Lkotlinx/coroutines/channels/ReceiveChannel;Lcom/squareup/workflow/legacy/WorkflowPool;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class com/squareup/workflow/legacy/Reactor$DefaultImpls {
public static fun launch (Lcom/squareup/workflow/legacy/Reactor;Ljava/lang/Object;Lcom/squareup/workflow/legacy/WorkflowPool;)Lcom/squareup/workflow/legacy/Workflow;
}

public final class com/squareup/workflow/legacy/ReactorException : java/lang/RuntimeException {
public fun <init> (Ljava/lang/Throwable;Lcom/squareup/workflow/legacy/Reactor;Ljava/lang/Object;)V
public fun getMessage ()Ljava/lang/String;
public final fun getReactor ()Lcom/squareup/workflow/legacy/Reactor;
public final fun getReactorState ()Ljava/lang/Object;
}

public final class com/squareup/workflow/legacy/ReactorKt {
public static final fun doLaunch (Lcom/squareup/workflow/legacy/Reactor;Ljava/lang/Object;Lcom/squareup/workflow/legacy/WorkflowPool;Lkotlin/coroutines/CoroutineContext;)Lcom/squareup/workflow/legacy/Workflow;
public static synthetic fun doLaunch$default (Lcom/squareup/workflow/legacy/Reactor;Ljava/lang/Object;Lcom/squareup/workflow/legacy/WorkflowPool;Lkotlin/coroutines/CoroutineContext;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/Workflow;
}

public abstract interface class com/squareup/workflow/legacy/Renderer {
public abstract fun render (Ljava/lang/Object;Lcom/squareup/workflow/legacy/WorkflowInput;Lcom/squareup/workflow/legacy/WorkflowPool;)Ljava/lang/Object;
}

public final class com/squareup/workflow/legacy/RendererKt {
public static final fun render (Lcom/squareup/workflow/legacy/Renderer;Lcom/squareup/workflow/legacy/WorkflowPool$Handle;Lcom/squareup/workflow/legacy/WorkflowPool;)Ljava/lang/Object;
}

public final class com/squareup/workflow/legacy/Running : com/squareup/workflow/legacy/WorkflowUpdate {
public fun <init> (Lcom/squareup/workflow/legacy/WorkflowPool$Handle;)V
public final fun component1 ()Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
public final fun copy (Lcom/squareup/workflow/legacy/WorkflowPool$Handle;)Lcom/squareup/workflow/legacy/Running;
public static synthetic fun copy$default (Lcom/squareup/workflow/legacy/Running;Lcom/squareup/workflow/legacy/WorkflowPool$Handle;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/Running;
public fun equals (Ljava/lang/Object;)Z
public final fun getHandle ()Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public abstract interface class com/squareup/workflow/legacy/Worker {
public abstract fun call (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class com/squareup/workflow/legacy/WorkerKt {
public static final fun asWorker (Lkotlinx/coroutines/Deferred;)Lcom/squareup/workflow/legacy/Worker;
public static final fun worker (Lkotlin/jvm/functions/Function2;)Lcom/squareup/workflow/legacy/Worker;
}

public abstract interface class com/squareup/workflow/legacy/Workflow : com/squareup/workflow/legacy/WorkflowInput, kotlinx/coroutines/Deferred {
public abstract fun openSubscriptionToState ()Lkotlinx/coroutines/channels/ReceiveChannel;
}

public final class com/squareup/workflow/legacy/Workflow$DefaultImpls {
public static synthetic fun cancel (Lcom/squareup/workflow/legacy/Workflow;)V
public static fun fold (Lcom/squareup/workflow/legacy/Workflow;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
public static fun get (Lcom/squareup/workflow/legacy/Workflow;Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext$Element;
public static fun minusKey (Lcom/squareup/workflow/legacy/Workflow;Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext;
public static fun plus (Lcom/squareup/workflow/legacy/Workflow;Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
public static fun plus (Lcom/squareup/workflow/legacy/Workflow;Lkotlinx/coroutines/Job;)Lkotlinx/coroutines/Job;
}

public abstract interface class com/squareup/workflow/legacy/WorkflowInput {
public static final field Companion Lcom/squareup/workflow/legacy/WorkflowInput$Companion;
public abstract fun sendEvent (Ljava/lang/Object;)V
}

public final class com/squareup/workflow/legacy/WorkflowInput$Companion {
public final fun disabled ()Lcom/squareup/workflow/legacy/WorkflowInput;
}

public final class com/squareup/workflow/legacy/WorkflowInput$ReadOnly : com/squareup/workflow/legacy/WorkflowInput {
public static final field INSTANCE Lcom/squareup/workflow/legacy/WorkflowInput$ReadOnly;
public synthetic fun sendEvent (Ljava/lang/Object;)V
public fun sendEvent (Ljava/lang/Void;)V
}

public final class com/squareup/workflow/legacy/WorkflowInputKt {
public static final fun WorkflowInput (Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow/legacy/WorkflowInput;
public static final fun adaptEvents (Lcom/squareup/workflow/legacy/WorkflowInput;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow/legacy/WorkflowInput;
}

public final class com/squareup/workflow/legacy/WorkflowOperatorsKt {
public static final fun adaptEvents (Lcom/squareup/workflow/legacy/Workflow;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow/legacy/Workflow;
public static final fun mapResult (Lcom/squareup/workflow/legacy/Workflow;Lkotlin/jvm/functions/Function2;)Lcom/squareup/workflow/legacy/Workflow;
public static final fun mapState (Lcom/squareup/workflow/legacy/Workflow;Lkotlin/jvm/functions/Function2;)Lcom/squareup/workflow/legacy/Workflow;
public static final fun switchMapState (Lcom/squareup/workflow/legacy/Workflow;Lkotlin/jvm/functions/Function3;)Lcom/squareup/workflow/legacy/Workflow;
}

public final class com/squareup/workflow/legacy/WorkflowPool {
public static final field Companion Lcom/squareup/workflow/legacy/WorkflowPool$Companion;
public fun <init> ()V
public final fun abandonAll ()V
public final synthetic fun abandonWorker (Lcom/squareup/workflow/legacy/Worker;Ljava/lang/String;)V
public static synthetic fun abandonWorker$default (Lcom/squareup/workflow/legacy/WorkflowPool;Lcom/squareup/workflow/legacy/Worker;Ljava/lang/String;ILjava/lang/Object;)V
public final fun abandonWorkflow (Lcom/squareup/workflow/legacy/WorkflowPool$Handle;)V
public final fun abandonWorkflow (Lcom/squareup/workflow/legacy/WorkflowPool$Id;)V
public final fun awaitWorkerResult (Lcom/squareup/workflow/legacy/Worker;Ljava/lang/Object;Ljava/lang/String;Lcom/squareup/workflow/legacy/WorkflowPool$Type;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final synthetic fun awaitWorkerResult (Lcom/squareup/workflow/legacy/Worker;Ljava/lang/Object;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun awaitWorkerResult$default (Lcom/squareup/workflow/legacy/WorkflowPool;Lcom/squareup/workflow/legacy/Worker;Ljava/lang/Object;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public final fun awaitWorkflowUpdate (Lcom/squareup/workflow/legacy/WorkflowPool$Handle;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getPeekWorkflowsCount ()I
public final fun input (Lcom/squareup/workflow/legacy/WorkflowPool$Handle;)Lcom/squareup/workflow/legacy/WorkflowInput;
public final fun register (Lcom/squareup/workflow/legacy/WorkflowPool$Launcher;Lcom/squareup/workflow/legacy/WorkflowPool$Type;)V
}

public final class com/squareup/workflow/legacy/WorkflowPool$Companion {
public final synthetic fun handle (Lkotlin/reflect/KClass;Ljava/lang/Object;Ljava/lang/String;)Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
public final synthetic fun handle (Lkotlin/reflect/KClass;Ljava/lang/String;)Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
public static synthetic fun handle$default (Lcom/squareup/workflow/legacy/WorkflowPool$Companion;Lkotlin/reflect/KClass;Ljava/lang/Object;Ljava/lang/String;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
public static synthetic fun handle$default (Lcom/squareup/workflow/legacy/WorkflowPool$Companion;Lkotlin/reflect/KClass;Ljava/lang/String;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
}

public final class com/squareup/workflow/legacy/WorkflowPool$Handle {
public fun <init> (Lcom/squareup/workflow/legacy/WorkflowPool$Id;Ljava/lang/Object;)V
public final fun component2 ()Ljava/lang/Object;
public final fun copy (Lcom/squareup/workflow/legacy/WorkflowPool$Id;Ljava/lang/Object;)Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
public static synthetic fun copy$default (Lcom/squareup/workflow/legacy/WorkflowPool$Handle;Lcom/squareup/workflow/legacy/WorkflowPool$Id;Ljava/lang/Object;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/WorkflowPool$Handle;
public fun equals (Ljava/lang/Object;)Z
public final fun getState ()Ljava/lang/Object;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class com/squareup/workflow/legacy/WorkflowPool$Id {
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Lcom/squareup/workflow/legacy/WorkflowPool$Type;
public final fun copy (Ljava/lang/String;Lcom/squareup/workflow/legacy/WorkflowPool$Type;)Lcom/squareup/workflow/legacy/WorkflowPool$Id;
public static synthetic fun copy$default (Lcom/squareup/workflow/legacy/WorkflowPool$Id;Ljava/lang/String;Lcom/squareup/workflow/legacy/WorkflowPool$Type;ILjava/lang/Object;)Lcom/squareup/workflow/legacy/WorkflowPool$Id;
public fun equals (Ljava/lang/Object;)Z
public final fun getName ()Ljava/lang/String;
public final fun getWorkflowType ()Lcom/squareup/workflow/legacy/WorkflowPool$Type;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public abstract interface class com/squareup/workflow/legacy/WorkflowPool$Launcher {
public abstract fun launch (Ljava/lang/Object;Lcom/squareup/workflow/legacy/WorkflowPool;)Lcom/squareup/workflow/legacy/Workflow;
}

public final class com/squareup/workflow/legacy/WorkflowPool$Type {
public fun <init> (Lkotlin/reflect/KClass;Lkotlin/reflect/KClass;Lkotlin/reflect/KClass;)V
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public final fun makeWorkflowId (Ljava/lang/String;)Lcom/squareup/workflow/legacy/WorkflowPool$Id;
}

public final class com/squareup/workflow/legacy/WorkflowPoolKt {
public static final synthetic fun getWorkflowType (Lcom/squareup/workflow/legacy/WorkflowPool$Launcher;)Lcom/squareup/workflow/legacy/WorkflowPool$Type;
public static final synthetic fun getWorkflowType (Lkotlin/reflect/KClass;)Lcom/squareup/workflow/legacy/WorkflowPool$Type;
public static final synthetic fun register (Lcom/squareup/workflow/legacy/WorkflowPool;Lcom/squareup/workflow/legacy/WorkflowPool$Launcher;)V
public static final synthetic fun workerResult (Lcom/squareup/workflow/legacy/WorkflowPool;Lcom/squareup/workflow/legacy/Worker;Ljava/lang/Object;Ljava/lang/String;)Lkotlinx/coroutines/Deferred;
public static final fun workerResult (Lcom/squareup/workflow/legacy/WorkflowPool;Lcom/squareup/workflow/legacy/Worker;Ljava/lang/Object;Ljava/lang/String;Lcom/squareup/workflow/legacy/WorkflowPool$Type;)Lkotlinx/coroutines/Deferred;
public static synthetic fun workerResult$default (Lcom/squareup/workflow/legacy/WorkflowPool;Lcom/squareup/workflow/legacy/Worker;Ljava/lang/Object;Ljava/lang/String;ILjava/lang/Object;)Lkotlinx/coroutines/Deferred;
public static final fun workflowUpdate (Lcom/squareup/workflow/legacy/WorkflowPool;Lcom/squareup/workflow/legacy/WorkflowPool$Handle;)Lkotlinx/coroutines/Deferred;
}

public abstract class com/squareup/workflow/legacy/WorkflowUpdate {
}

0 comments on commit 1b130e5

Please sign in to comment.