Skip to content

Commit

Permalink
Introduce binary compatibility plugin (#1774)
Browse files Browse the repository at this point in the history
* Introduce binary compatibility plugin

* Update diffs
  • Loading branch information
MarcinAman authored Apr 14, 2021
1 parent 38270a3 commit 7bfab09
Show file tree
Hide file tree
Showing 23 changed files with 7,642 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/apiCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: CI

on: pull_request

jobs:
apiCheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- run: ./gradlew apiCheck --stacktrace
10 changes: 10 additions & 0 deletions .github/workflows/wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Validate Gradle Wrapper"
on: pull_request

jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ repositories {
dependencies {
implementation("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4")
implementation("com.github.jengelman.gradle.plugins:shadow:2.0.4")
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.4.0")
}
31 changes: 31 additions & 0 deletions buildSrc/src/main/kotlin/org/jetbrains/binaryCompatibility.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.jetbrains

import kotlinx.validation.ApiValidationExtension
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure

internal object BinaryCompatibilityConfig {
val ignoredPublications = setOf("kotlinAnalysisIntelliJ", "kotlinAnalysis", "kotlinAnalysisCompiler")
val ignoredSubprojects = setOf(
"search-component",
"compiler-dependency",
"intellij-dependency",
"kotlin-analysis",
"frontend"
)
}

internal fun Project.registerBinaryCompatibilityCheck(publicationName: String) {
publicationName.takeIf {
it !in BinaryCompatibilityConfig.ignoredPublications
}?.let {
if (tasks.findByName("apiBuild") == null) {
plugins.apply(kotlinx.validation.BinaryCompatibilityValidatorPlugin::class.java)
configure<ApiValidationExtension> {
ignoredProjects.addAll(
BinaryCompatibilityConfig.ignoredSubprojects.intersect(allprojects.map { it.name })
)
}
}
}
}
7 changes: 3 additions & 4 deletions buildSrc/src/main/kotlin/org/jetbrains/publication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package org.jetbrains

import com.github.jengelman.gradle.plugins.shadow.ShadowExtension
import com.jfrog.bintray.gradle.BintrayExtension
import kotlinx.validation.ApiValidationExtension
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.withType
import org.gradle.kotlin.dsl.*
import org.gradle.plugins.signing.SigningExtension
import org.jetbrains.DokkaPublicationChannel.*
import java.net.URI
Expand Down Expand Up @@ -47,6 +45,7 @@ fun Project.registerDokkaArtifactPublication(publicationName: String, configure:
configureBintrayPublicationIfNecessary(publicationName)
configureSpacePublicationIfNecessary(publicationName)
createDokkaPublishTaskIfNecessary()
registerBinaryCompatibilityCheck(publicationName)
}

fun Project.configureSpacePublicationIfNecessary(vararg publications: String) {
Expand Down
4,315 changes: 4,315 additions & 0 deletions core/api/core.api

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions core/content-matcher-test-utils/api/content-matcher-test-utils.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
public final class matchers/content/ContentMatcherBuilder {
public fun <init> (Lkotlin/reflect/KClass;)V
public final fun build ()Lorg/jetbrains/dokka/test/tools/matchers/content/CompositeMatcher;
public final fun unaryPlus (Ljava/lang/String;)V
}

public abstract interface annotation class matchers/content/ContentMatchersDsl : java/lang/annotation/Annotation {
}

public final class matchers/content/ContentMatchersDslKt {
public static final fun after (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun assertNode (Lorg/jetbrains/dokka/pages/ContentNode;Lkotlin/jvm/functions/Function1;)V
public static final fun before (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun br (Lmatchers/content/ContentMatcherBuilder;)V
public static final fun caption (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun check (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun divergent (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun divergentGroup (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun divergentInstance (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun group (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun hasExactText (Lmatchers/content/ContentMatcherBuilder;Ljava/lang/String;)V
public static final fun header (Lmatchers/content/ContentMatcherBuilder;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun header$default (Lmatchers/content/ContentMatcherBuilder;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun link (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun list (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun p (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun platformHinted (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun skipAllNotMatching (Lmatchers/content/ContentMatcherBuilder;)V
public static final fun somewhere (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
public static final fun table (Lmatchers/content/ContentMatcherBuilder;Lkotlin/jvm/functions/Function1;)V
}

public final class org/jetbrains/dokka/test/tools/matchers/content/Anything : org/jetbrains/dokka/test/tools/matchers/content/MatcherElement {
public static final field INSTANCE Lorg/jetbrains/dokka/test/tools/matchers/content/Anything;
}

public final class org/jetbrains/dokka/test/tools/matchers/content/CompositeMatcher : org/jetbrains/dokka/test/tools/matchers/content/NodeMatcher {
public fun <init> (Lkotlin/reflect/KClass;Ljava/util/List;Lkotlin/jvm/functions/Function1;)V
public synthetic fun <init> (Lkotlin/reflect/KClass;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun tryMatch (Lorg/jetbrains/dokka/pages/ContentNode;)V
}

public abstract class org/jetbrains/dokka/test/tools/matchers/content/MatcherElement {
}

public final class org/jetbrains/dokka/test/tools/matchers/content/MatcherError : java/lang/AssertionError {
public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherElement;ZLjava/lang/Throwable;)V
public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherElement;ZLjava/lang/Throwable;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherElement;
public final fun component3 ()Z
public final fun component4 ()Ljava/lang/Throwable;
public final fun copy (Ljava/lang/String;Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherElement;ZLjava/lang/Throwable;)Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherError;
public static synthetic fun copy$default (Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherError;Ljava/lang/String;Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherElement;ZLjava/lang/Throwable;ILjava/lang/Object;)Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherError;
public fun equals (Ljava/lang/Object;)Z
public final fun getAnchor ()Lorg/jetbrains/dokka/test/tools/matchers/content/MatcherElement;
public final fun getAnchorAfter ()Z
public fun getCause ()Ljava/lang/Throwable;
public fun getMessage ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public class org/jetbrains/dokka/test/tools/matchers/content/NodeMatcher : org/jetbrains/dokka/test/tools/matchers/content/MatcherElement {
public fun <init> (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;)V
public synthetic fun <init> (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getAssertions ()Lkotlin/jvm/functions/Function1;
public final fun getKclass ()Lkotlin/reflect/KClass;
public fun tryMatch (Lorg/jetbrains/dokka/pages/ContentNode;)V
}

public final class org/jetbrains/dokka/test/tools/matchers/content/TextMatcher : org/jetbrains/dokka/test/tools/matchers/content/MatcherElement {
public fun <init> (Ljava/lang/String;)V
public final fun getText ()Ljava/lang/String;
}

Loading

0 comments on commit 7bfab09

Please sign in to comment.