Skip to content

Commit 19a0002

Browse files
authored
Add klib api validation (#20)
1 parent d41e283 commit 19a0002

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,23 @@ jobs:
4848
distribution: 'zulu'
4949
java-version: 11
5050

51+
- name: Check API Compatibility
52+
if: matrix.os == 'macos-latest'
53+
run: >
54+
./gradlew apiCheck --stacktrace
55+
5156
- name: Run macOS Tests
5257
if: matrix.os == 'macos-latest'
5358
run: >
5459
./gradlew check --stacktrace
5560
-PKMP_TARGETS="JVM,JS,IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_SIMULATOR_ARM64,WASM_JS,WASM_WASI"
61+
5662
- name: Run Linux Tests
5763
if: matrix.os == 'ubuntu-latest'
5864
run: >
5965
./gradlew check --stacktrace
6066
-PKMP_TARGETS="JVM,JS,ANDROID,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,LINUX_ARM64,LINUX_X64,WASM_JS,WASM_WASI"
67+
6168
- name: Run Windows Tests
6269
if: matrix.os == 'windows-latest'
6370
run: >

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ plugins.withType<YarnPlugin> {
3636
}
3737

3838
apiValidation {
39+
// Only enable when selectively enabled targets are not being passed via cli.
40+
// See https://github.com/Kotlin/binary-compatibility-validator/issues/269
41+
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
42+
klib.enabled = findProperty("KMP_TARGETS") == null
43+
3944
if (findProperty("CHECK_PUBLICATION") != null) {
4045
ignoredProjects.add("check-publication")
4146
} else {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
gradle-binary-compat = "0.14.0"
2+
gradle-binary-compat = "0.16.3"
33
gradle-kmp-configuration = "0.3.2"
44
gradle-kotlin = "1.9.24"
55
gradle-publish-maven = "0.29.0"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ zipStorePath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55

66
# https://gradle.org/release-checksums/
7-
distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
8-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
7+
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
8+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Klib ABI Dump
2+
// Targets: [androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86, iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64]
3+
// Rendering settings:
4+
// - Signature version: 2
5+
// - Show manifest properties: true
6+
// - Show declarations: true
7+
8+
// Library unique name: <org.kotlincrypto:secure-random>
9+
final class org.kotlincrypto/SecRandomCopyException : kotlin/RuntimeException { // org.kotlincrypto/SecRandomCopyException|null[0]
10+
constructor <init>() // org.kotlincrypto/SecRandomCopyException.<init>|<init>(){}[0]
11+
constructor <init>(kotlin/String?) // org.kotlincrypto/SecRandomCopyException.<init>|<init>(kotlin.String?){}[0]
12+
constructor <init>(kotlin/String?, kotlin/Throwable?) // org.kotlincrypto/SecRandomCopyException.<init>|<init>(kotlin.String?;kotlin.Throwable?){}[0]
13+
constructor <init>(kotlin/Throwable?) // org.kotlincrypto/SecRandomCopyException.<init>|<init>(kotlin.Throwable?){}[0]
14+
}
15+
16+
final class org.kotlincrypto/SecureRandom { // org.kotlincrypto/SecureRandom|null[0]
17+
constructor <init>() // org.kotlincrypto/SecureRandom.<init>|<init>(){}[0]
18+
19+
final fun nextBytesCopyTo(kotlin/ByteArray?) // org.kotlincrypto/SecureRandom.nextBytesCopyTo|nextBytesCopyTo(kotlin.ByteArray?){}[0]
20+
final fun nextBytesOf(kotlin/Int): kotlin/ByteArray // org.kotlincrypto/SecureRandom.nextBytesOf|nextBytesOf(kotlin.Int){}[0]
21+
}

0 commit comments

Comments
 (0)