Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binary API compatibility checks to v1 branch #1427

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ repositories {
}

object Versions {
const val binaryCompatibilityValidator = "0.14.0"
const val detekt = "1.20.0-RC1"
const val dokka = "1.6.10"
const val kotlin = "1.6.20"
Expand All @@ -31,6 +32,7 @@ object Versions {
}

object Plugins {
const val binaryCompatibilityValidator = "org.jetbrains.kotlinx:binary-compatibility-validator:${Versions.binaryCompatibilityValidator}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply binary compatibility checks for any published package.

const val detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${Versions.detekt}"
const val dokka = "org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokka}"
const val kotlinGradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
Expand All @@ -44,6 +46,7 @@ dependencies {
implementation(Plugins.kotlinGradle)
implementation(Plugins.ktlint)
implementation(Plugins.pig)
implementation(Plugins.binaryCompatibilityValidator)
}

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import kotlinx.validation.BinaryCompatibilityValidatorPlugin
import java.io.File

/**
Expand All @@ -51,6 +52,12 @@ abstract class PublishPlugin : Plugin<Project> {
pluginManager.apply(MavenPublishPlugin::class.java)
pluginManager.apply(SigningPlugin::class.java)
pluginManager.apply(DokkaPlugin::class.java)
// Use https://github.com/Kotlin/binary-compatibility-validator to maintain list of public binary APIs (defaults
// to <project dir>/api/<project dir>.api). When changes are made to public APIs (e.g. modifying a public class,
// adding a public function, etc.), the gradle `apiCheck` task will fail. To fix this error, run the `apiDump` task
// to update these .api files and commit the changes.
// See https://github.com/Kotlin/binary-compatibility-validator#optional-parameters for additional configuration.
pluginManager.apply(BinaryCompatibilityValidatorPlugin::class.java)
extensions.getByType(KotlinJvmProjectExtension::class.java).explicitApi = ExplicitApiMode.Strict
val ext = extensions.create("publish", PublishExtension::class.java)
target.afterEvaluate { publish(ext) }
Expand Down
36,013 changes: 36,013 additions & 0 deletions partiql-ast/api/partiql-ast.api

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions partiql-coverage/api/partiql-coverage.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
public abstract interface annotation class org/partiql/coverage/api/PartiQLTest : java/lang/annotation/Annotation {
public abstract fun provider ()Ljava/lang/Class;
}

public abstract interface class org/partiql/coverage/api/PartiQLTestCase {
public abstract fun getSession ()Lorg/partiql/lang/eval/EvaluationSession;
}

public abstract interface class org/partiql/coverage/api/PartiQLTestProvider {
public abstract fun getPipelineBuilder ()Lorg/partiql/lang/CompilerPipeline$Builder;
public abstract fun getStatement ()Ljava/lang/String;
public abstract fun getTestCases ()Ljava/lang/Iterable;
}

65 changes: 65 additions & 0 deletions partiql-eval/api/partiql-eval.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
public abstract interface class org/partiql/eval/PartiQLEngine {
public static final field Companion Lorg/partiql/eval/PartiQLEngine$Companion;
public static fun builder ()Lorg/partiql/eval/PartiQLEngineBuilder;
public static fun default ()Lorg/partiql/eval/PartiQLEngine;
public abstract fun execute (Lorg/partiql/eval/PartiQLStatement;)Lorg/partiql/eval/PartiQLResult;
public abstract fun prepare (Lorg/partiql/plan/PartiQLPlan;Lorg/partiql/eval/PartiQLEngine$Session;)Lorg/partiql/eval/PartiQLStatement;
}

public final class org/partiql/eval/PartiQLEngine$Companion {
public final fun builder ()Lorg/partiql/eval/PartiQLEngineBuilder;
public final fun default ()Lorg/partiql/eval/PartiQLEngine;
}

public final class org/partiql/eval/PartiQLEngine$Mode : java/lang/Enum {
public static final field PERMISSIVE Lorg/partiql/eval/PartiQLEngine$Mode;
public static final field STRICT Lorg/partiql/eval/PartiQLEngine$Mode;
public static fun valueOf (Ljava/lang/String;)Lorg/partiql/eval/PartiQLEngine$Mode;
public static fun values ()[Lorg/partiql/eval/PartiQLEngine$Mode;
}

public final class org/partiql/eval/PartiQLEngine$Session {
public fun <init> ()V
public fun <init> (Ljava/util/Map;Lorg/partiql/eval/PartiQLEngine$Mode;)V
public synthetic fun <init> (Ljava/util/Map;Lorg/partiql/eval/PartiQLEngine$Mode;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getCatalogs ()Ljava/util/Map;
public final fun getMode ()Lorg/partiql/eval/PartiQLEngine$Mode;
}

public final class org/partiql/eval/PartiQLEngineBuilder {
public fun <init> ()V
public final fun build ()Lorg/partiql/eval/PartiQLEngine;
}

public abstract interface class org/partiql/eval/PartiQLResult {
}

public final class org/partiql/eval/PartiQLResult$Error : org/partiql/eval/PartiQLResult {
public fun <init> (Ljava/lang/Throwable;)V
public final fun component1 ()Ljava/lang/Throwable;
public final fun copy (Ljava/lang/Throwable;)Lorg/partiql/eval/PartiQLResult$Error;
public static synthetic fun copy$default (Lorg/partiql/eval/PartiQLResult$Error;Ljava/lang/Throwable;ILjava/lang/Object;)Lorg/partiql/eval/PartiQLResult$Error;
public fun equals (Ljava/lang/Object;)Z
public final fun getCause ()Ljava/lang/Throwable;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class org/partiql/eval/PartiQLResult$Value : org/partiql/eval/PartiQLResult {
public fun <init> (Lorg/partiql/value/PartiQLValue;)V
public final fun component1 ()Lorg/partiql/value/PartiQLValue;
public final fun copy (Lorg/partiql/value/PartiQLValue;)Lorg/partiql/eval/PartiQLResult$Value;
public static synthetic fun copy$default (Lorg/partiql/eval/PartiQLResult$Value;Lorg/partiql/value/PartiQLValue;ILjava/lang/Object;)Lorg/partiql/eval/PartiQLResult$Value;
public fun equals (Ljava/lang/Object;)Z
public final fun getValue ()Lorg/partiql/value/PartiQLValue;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public abstract interface class org/partiql/eval/PartiQLStatement {
public abstract fun execute ()Ljava/lang/Object;
}

public abstract interface class org/partiql/eval/PartiQLStatement$Query : org/partiql/eval/PartiQLStatement {
}

Loading
Loading