Skip to content

Commit 921dec7

Browse files
authored
feat: binary compatibility validator (#808)
1 parent 057e0f0 commit 921dec7

File tree

25 files changed

+3975
-0
lines changed

25 files changed

+3975
-0
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,18 @@ across both repos, it's best to create/use the same branch name in both location
179179

180180
This check enforces the changelog requirements [described above](#Changelog).
181181

182+
#### Binary Compatibility Validation
183+
This repository uses [Kotlin's binary compatibility validator plugin](https://github.com/Kotlin/binary-compatibility-validator)
184+
to help preserve backwards compatibility across releases.
185+
186+
The plugin will automatically run during a build with no extra steps needed from the developer.
187+
If a backwards incompatible change is introduced, the build will fail.
188+
189+
If the backwards incompatibility is expected, the appropriate `.api` files must be updated as part of the PR.
190+
The `.api` files can be updated by running `./gradlew apiDump`.
191+
192+
The binary compatibility validator can also be run manually using `./gradlew apiCheck`.
193+
182194
## Finding contributions to work on
183195
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
184196

build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ plugins {
2020
kotlin("jvm") apply false
2121
id("org.jetbrains.dokka")
2222
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
23+
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.12.1"
2324
}
2425

2526
allprojects {
@@ -161,3 +162,27 @@ tasks.register<JavaExec>("ktlintFormat") {
161162
main = "com.pinterest.ktlint.Main"
162163
args = listOf("-F") + lintPaths
163164
}
165+
166+
apiValidation {
167+
nonPublicMarkers.add("aws.smithy.kotlin.runtime.InternalApi")
168+
169+
ignoredProjects.addAll(setOf(
170+
"dokka-smithy",
171+
"ktlint-rules",
172+
"aws-signing-tests",
173+
"test-suite",
174+
"http-test",
175+
"smithy-test",
176+
"testing",
177+
"smithy-kotlin-codegen",
178+
"smithy-kotlin-codegen-testutils",
179+
"aws-signing-benchmarks",
180+
"channel-benchmarks",
181+
"http-benchmarks",
182+
"serde-benchmarks",
183+
"serde-benchmarks-codegen",
184+
"paginator-tests",
185+
"waiter-tests",
186+
"compile"
187+
))
188+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
public final class aws/smithy/kotlin/runtime/auth/awscredentials/CachedCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
2+
public synthetic fun <init> (Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;JJLaws/smithy/kotlin/runtime/time/Clock;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
3+
public synthetic fun <init> (Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;JJLaws/smithy/kotlin/runtime/time/Clock;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
4+
public fun close ()V
5+
public fun getCredentials (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
6+
}
7+
8+
public final class aws/smithy/kotlin/runtime/auth/awscredentials/CachedCredentialsProviderKt {
9+
public static final field DEFAULT_CREDENTIALS_REFRESH_SECONDS I
10+
}
11+
12+
public abstract interface class aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider, java/io/Closeable {
13+
}
14+
15+
public final class aws/smithy/kotlin/runtime/auth/awscredentials/Credentials {
16+
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Laws/smithy/kotlin/runtime/time/Instant;Ljava/lang/String;)V
17+
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Laws/smithy/kotlin/runtime/time/Instant;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
18+
public final fun component1 ()Ljava/lang/String;
19+
public final fun component2 ()Ljava/lang/String;
20+
public final fun component3 ()Ljava/lang/String;
21+
public final fun component4 ()Laws/smithy/kotlin/runtime/time/Instant;
22+
public final fun component5 ()Ljava/lang/String;
23+
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Laws/smithy/kotlin/runtime/time/Instant;Ljava/lang/String;)Laws/smithy/kotlin/runtime/auth/awscredentials/Credentials;
24+
public static synthetic fun copy$default (Laws/smithy/kotlin/runtime/auth/awscredentials/Credentials;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Laws/smithy/kotlin/runtime/time/Instant;Ljava/lang/String;ILjava/lang/Object;)Laws/smithy/kotlin/runtime/auth/awscredentials/Credentials;
25+
public fun equals (Ljava/lang/Object;)Z
26+
public final fun getAccessKeyId ()Ljava/lang/String;
27+
public final fun getExpiration ()Laws/smithy/kotlin/runtime/time/Instant;
28+
public final fun getProviderName ()Ljava/lang/String;
29+
public final fun getSecretAccessKey ()Ljava/lang/String;
30+
public final fun getSessionToken ()Ljava/lang/String;
31+
public fun hashCode ()I
32+
public fun toString ()Ljava/lang/String;
33+
}
34+
35+
public abstract interface class aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider {
36+
public abstract fun getCredentials (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
37+
}
38+
39+
public class aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProviderChain : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
40+
public fun <init> ([Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;)V
41+
public fun close ()V
42+
public fun getCredentials (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
43+
protected final fun getProviders ()[Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;
44+
public fun toString ()Ljava/lang/String;
45+
}
46+
47+
public final class aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProviderException : aws/smithy/kotlin/runtime/ClientException {
48+
public fun <init> (Ljava/lang/String;Ljava/lang/Throwable;)V
49+
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
50+
}
51+

0 commit comments

Comments
 (0)