Skip to content

Commit

Permalink
Add klib api validation (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Aug 31, 2024
1 parent bffc3db commit 952bbc1
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 16 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
java-version: [ 11, 19 ]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -42,33 +43,43 @@ jobs:
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('gradle/libs.versions.toml') }}
restore-keys: ${{ runner.os }}-gradle-caches-

# Windows does not build ANDROID, but needs Java 11 for JPMS Multi-Release Jar build
- name: Setup JDK 11
if: matrix.os == 'windows-latest'
- name: Setup JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 11
java-version: ${{ matrix.java-version }}

- name: Setup JDK 19
if: matrix.os != 'windows-latest'
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 19
- name: Check API Compatibility
if: matrix.os == 'macos-latest' && matrix.java-version == 19
run: >
./gradlew apiCheck --stacktrace
- name: Run macOS Tests
if: matrix.os == 'macos-latest'
if: matrix.os == 'macos-latest' && matrix.java-version == 19
run: >
./gradlew check --stacktrace
-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"
-PKMP_TARGETS="IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,JVM,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_SIMULATOR_ARM64"
- name: Run macOS Java11 Tests
if: matrix.os == 'macos-latest' && matrix.java-version == 11
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JS,JVM,WASM_JS,WASM_WASI"
- name: Run Linux Tests
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && matrix.java-version == 19
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="ANDROID,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,JVM,LINUX_ARM64,LINUX_X64"
- name: Run Linux Java11 Tests
if: matrix.os == 'ubuntu-latest' && matrix.java-version == 11
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,ANDROID,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,LINUX_ARM64,LINUX_X64,WASM_JS,WASM_WASI"
-PKMP_TARGETS="JS,JVM,WASM_JS,WASM_WASI"
- name: Run Windows Tests
if: matrix.os == 'windows-latest'
if: matrix.os == 'windows-latest' && matrix.java-version == 11
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,MINGW_X64,WASM_JS,WASM_WASI"
Expand Down
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ plugins.withType<YarnPlugin> {
}

apiValidation {
// Only enable when selectively enabled targets are not being passed via cli.
// See https://github.com/Kotlin/binary-compatibility-validator/issues/269
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
klib.enabled = findProperty("KMP_TARGETS") == null

if (findProperty("CHECK_PUBLICATION") != null) {
ignoredProjects.add("check-publication")
} else {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
gradle-android = "8.2.2"
gradle-binary-compat = "0.14.0"
gradle-binary-compat = "0.16.3"
gradle-kmp-configuration = "0.3.2"
gradle-kotlin = "1.9.24"
gradle-publish-maven = "0.29.0"
Expand Down
11 changes: 11 additions & 0 deletions library/md/api/md.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Klib ABI Dump
// Targets: [androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86, iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64]
// Rendering settings:
// - Signature version: 2
// - Show manifest properties: true
// - Show declarations: true

// Library unique name: <org.kotlincrypto.hash:md>
final class org.kotlincrypto.hash.md/MD5 : org.kotlincrypto.core.digest/Digest { // org.kotlincrypto.hash.md/MD5|null[0]
constructor <init>() // org.kotlincrypto.hash.md/MD5.<init>|<init>(){}[0]
}
8 changes: 8 additions & 0 deletions library/md5/api/md5.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Klib ABI Dump
// Targets: [androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86, iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64]
// Rendering settings:
// - Signature version: 2
// - Show manifest properties: true
// - Show declarations: true

// Library unique name: <org.kotlincrypto.hash:md5>
11 changes: 11 additions & 0 deletions library/sha1/api/sha1.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Klib ABI Dump
// Targets: [androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86, iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64]
// Rendering settings:
// - Signature version: 2
// - Show manifest properties: true
// - Show declarations: true

// Library unique name: <org.kotlincrypto.hash:sha1>
final class org.kotlincrypto.hash.sha1/SHA1 : org.kotlincrypto.core.digest/Digest { // org.kotlincrypto.hash.sha1/SHA1|null[0]
constructor <init>() // org.kotlincrypto.hash.sha1/SHA1.<init>|<init>(){}[0]
}
75 changes: 75 additions & 0 deletions library/sha2/api/sha2.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Klib ABI Dump
// Targets: [androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86, iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64]
// Rendering settings:
// - Signature version: 2
// - Show manifest properties: true
// - Show declarations: true

// Library unique name: <org.kotlincrypto.hash:sha2>
final class org.kotlincrypto.hash.sha2/SHA224 : org.kotlincrypto.hash.sha2/Bit32Digest { // org.kotlincrypto.hash.sha2/SHA224|null[0]
constructor <init>() // org.kotlincrypto.hash.sha2/SHA224.<init>|<init>(){}[0]
}

final class org.kotlincrypto.hash.sha2/SHA256 : org.kotlincrypto.hash.sha2/Bit32Digest { // org.kotlincrypto.hash.sha2/SHA256|null[0]
constructor <init>() // org.kotlincrypto.hash.sha2/SHA256.<init>|<init>(){}[0]
}

final class org.kotlincrypto.hash.sha2/SHA384 : org.kotlincrypto.hash.sha2/Bit64Digest { // org.kotlincrypto.hash.sha2/SHA384|null[0]
constructor <init>() // org.kotlincrypto.hash.sha2/SHA384.<init>|<init>(){}[0]
}

final class org.kotlincrypto.hash.sha2/SHA512 : org.kotlincrypto.hash.sha2/Bit64Digest { // org.kotlincrypto.hash.sha2/SHA512|null[0]
constructor <init>() // org.kotlincrypto.hash.sha2/SHA512.<init>|<init>(){}[0]
}

final class org.kotlincrypto.hash.sha2/SHA512t : org.kotlincrypto.hash.sha2/Bit64Digest { // org.kotlincrypto.hash.sha2/SHA512t|null[0]
constructor <init>(kotlin/Int) // org.kotlincrypto.hash.sha2/SHA512t.<init>|<init>(kotlin.Int){}[0]
}

sealed class org.kotlincrypto.hash.sha2/Bit32Digest : org.kotlincrypto.core.digest/Digest { // org.kotlincrypto.hash.sha2/Bit32Digest|null[0]
constructor <init>(kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int) // org.kotlincrypto.hash.sha2/Bit32Digest.<init>|<init>(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int){}[0]
constructor <init>(org.kotlincrypto.core.digest.internal/DigestState, org.kotlincrypto.hash.sha2/Bit32Digest) // org.kotlincrypto.hash.sha2/Bit32Digest.<init>|<init>(org.kotlincrypto.core.digest.internal.DigestState;org.kotlincrypto.hash.sha2.Bit32Digest){}[0]

abstract fun out(kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.hash.sha2/Bit32Digest.out|out(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int){}[0]
final fun compress(kotlin/ByteArray, kotlin/Int) // org.kotlincrypto.hash.sha2/Bit32Digest.compress|compress(kotlin.ByteArray;kotlin.Int){}[0]
final fun digest(kotlin/Long, kotlin/Int, kotlin/ByteArray): kotlin/ByteArray // org.kotlincrypto.hash.sha2/Bit32Digest.digest|digest(kotlin.Long;kotlin.Int;kotlin.ByteArray){}[0]
final fun resetDigest() // org.kotlincrypto.hash.sha2/Bit32Digest.resetDigest|resetDigest(){}[0]
}

sealed class org.kotlincrypto.hash.sha2/Bit64Digest : org.kotlincrypto.core.digest/Digest { // org.kotlincrypto.hash.sha2/Bit64Digest|null[0]
constructor <init>(kotlin/Int, kotlin/Int?, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.<init>|<init>(kotlin.Int;kotlin.Int?;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long){}[0]
constructor <init>(org.kotlincrypto.core.digest.internal/DigestState, org.kotlincrypto.hash.sha2/Bit64Digest) // org.kotlincrypto.hash.sha2/Bit64Digest.<init>|<init>(org.kotlincrypto.core.digest.internal.DigestState;org.kotlincrypto.hash.sha2.Bit64Digest){}[0]

final var h0 // org.kotlincrypto.hash.sha2/Bit64Digest.h0|{}h0[0]
final fun <get-h0>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h0.<get-h0>|<get-h0>(){}[0]
final fun <set-h0>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h0.<set-h0>|<set-h0>(kotlin.Long){}[0]
final var h1 // org.kotlincrypto.hash.sha2/Bit64Digest.h1|{}h1[0]
final fun <get-h1>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h1.<get-h1>|<get-h1>(){}[0]
final fun <set-h1>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h1.<set-h1>|<set-h1>(kotlin.Long){}[0]
final var h2 // org.kotlincrypto.hash.sha2/Bit64Digest.h2|{}h2[0]
final fun <get-h2>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h2.<get-h2>|<get-h2>(){}[0]
final fun <set-h2>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h2.<set-h2>|<set-h2>(kotlin.Long){}[0]
final var h3 // org.kotlincrypto.hash.sha2/Bit64Digest.h3|{}h3[0]
final fun <get-h3>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h3.<get-h3>|<get-h3>(){}[0]
final fun <set-h3>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h3.<set-h3>|<set-h3>(kotlin.Long){}[0]
final var h4 // org.kotlincrypto.hash.sha2/Bit64Digest.h4|{}h4[0]
final fun <get-h4>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h4.<get-h4>|<get-h4>(){}[0]
final fun <set-h4>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h4.<set-h4>|<set-h4>(kotlin.Long){}[0]
final var h5 // org.kotlincrypto.hash.sha2/Bit64Digest.h5|{}h5[0]
final fun <get-h5>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h5.<get-h5>|<get-h5>(){}[0]
final fun <set-h5>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h5.<set-h5>|<set-h5>(kotlin.Long){}[0]
final var h6 // org.kotlincrypto.hash.sha2/Bit64Digest.h6|{}h6[0]
final fun <get-h6>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h6.<get-h6>|<get-h6>(){}[0]
final fun <set-h6>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h6.<set-h6>|<set-h6>(kotlin.Long){}[0]
final var h7 // org.kotlincrypto.hash.sha2/Bit64Digest.h7|{}h7[0]
final fun <get-h7>(): kotlin/Long // org.kotlincrypto.hash.sha2/Bit64Digest.h7.<get-h7>|<get-h7>(){}[0]
final fun <set-h7>(kotlin/Long) // org.kotlincrypto.hash.sha2/Bit64Digest.h7.<set-h7>|<set-h7>(kotlin.Long){}[0]

abstract fun out(kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long, kotlin/Long): kotlin/ByteArray // org.kotlincrypto.hash.sha2/Bit64Digest.out|out(kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long;kotlin.Long){}[0]
final fun compress(kotlin/ByteArray, kotlin/Int) // org.kotlincrypto.hash.sha2/Bit64Digest.compress|compress(kotlin.ByteArray;kotlin.Int){}[0]
final fun digest(kotlin/Long, kotlin/Int, kotlin/ByteArray): kotlin/ByteArray // org.kotlincrypto.hash.sha2/Bit64Digest.digest|digest(kotlin.Long;kotlin.Int;kotlin.ByteArray){}[0]
final fun resetDigest() // org.kotlincrypto.hash.sha2/Bit64Digest.resetDigest|resetDigest(){}[0]
}

final fun org.kotlincrypto.hash.sha2/SHA512_224(): org.kotlincrypto.hash.sha2/SHA512t // org.kotlincrypto.hash.sha2/SHA512_224|SHA512_224(){}[0]
final fun org.kotlincrypto.hash.sha2/SHA512_256(): org.kotlincrypto.hash.sha2/SHA512t // org.kotlincrypto.hash.sha2/SHA512_256|SHA512_256(){}[0]
Loading

0 comments on commit 952bbc1

Please sign in to comment.