Skip to content

Commit

Permalink
Add klib api validation (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Aug 31, 2024
1 parent fff249f commit 5915260
Show file tree
Hide file tree
Showing 11 changed files with 190 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/hmac/hmac-md/api/hmac-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.macs:hmac-md>
final class org.kotlincrypto.macs.hmac.md/HmacMD5 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.md/HmacMD5|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.md/HmacMD5.<init>|<init>(kotlin.ByteArray){}[0]
}
8 changes: 8 additions & 0 deletions library/hmac/hmac-md5/api/hmac-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.macs:hmac-md5>
11 changes: 11 additions & 0 deletions library/hmac/hmac-sha1/api/hmac-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.macs:hmac-sha1>
final class org.kotlincrypto.macs.hmac.sha1/HmacSHA1 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha1/HmacSHA1|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha1/HmacSHA1.<init>|<init>(kotlin.ByteArray){}[0]
}
30 changes: 30 additions & 0 deletions library/hmac/hmac-sha2/api/hmac-sha2.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 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.macs:hmac-sha2>
final class org.kotlincrypto.macs.hmac.sha2/HmacSHA224 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha2/HmacSHA224|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha2/HmacSHA224.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha2/HmacSHA256 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha2/HmacSHA256|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha2/HmacSHA256.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha2/HmacSHA384 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha2/HmacSHA384|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha2/HmacSHA384.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha2/HmacSHA512 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha2/HmacSHA512|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha2/HmacSHA512.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha2/HmacSHA512t : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha2/HmacSHA512t|null[0]
constructor <init>(kotlin/ByteArray, kotlin/Int) // org.kotlincrypto.macs.hmac.sha2/HmacSHA512t.<init>|<init>(kotlin.ByteArray;kotlin.Int){}[0]
}

final fun org.kotlincrypto.macs.hmac.sha2/HmacSHA512_224(kotlin/ByteArray): org.kotlincrypto.macs.hmac.sha2/HmacSHA512t // org.kotlincrypto.macs.hmac.sha2/HmacSHA512_224|HmacSHA512_224(kotlin.ByteArray){}[0]
final fun org.kotlincrypto.macs.hmac.sha2/HmacSHA512_256(kotlin/ByteArray): org.kotlincrypto.macs.hmac.sha2/HmacSHA512t // org.kotlincrypto.macs.hmac.sha2/HmacSHA512_256|HmacSHA512_256(kotlin.ByteArray){}[0]
39 changes: 39 additions & 0 deletions library/hmac/hmac-sha3/api/hmac-sha3.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// 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.macs:hmac-sha3>
final class org.kotlincrypto.macs.hmac.sha3/HmacKeccak224 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacKeccak224|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacKeccak224.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha3/HmacKeccak256 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacKeccak256|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacKeccak256.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha3/HmacKeccak384 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacKeccak384|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacKeccak384.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha3/HmacKeccak512 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacKeccak512|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacKeccak512.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha3/HmacSHA3_224 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_224|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_224.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha3/HmacSHA3_256 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_256|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_256.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha3/HmacSHA3_384 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_384|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_384.<init>|<init>(kotlin.ByteArray){}[0]
}

final class org.kotlincrypto.macs.hmac.sha3/HmacSHA3_512 : org.kotlincrypto.macs.hmac/Hmac { // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_512|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.hmac.sha3/HmacSHA3_512.<init>|<init>(kotlin.ByteArray){}[0]
}
9 changes: 9 additions & 0 deletions library/hmac/hmac/api/hmac.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// 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.macs:hmac>
abstract class org.kotlincrypto.macs.hmac/Hmac : org.kotlincrypto.core.mac/Mac // org.kotlincrypto.macs.hmac/Hmac|null[0]
50 changes: 50 additions & 0 deletions library/kmac/api/kmac.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// 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.macs:kmac>
final class org.kotlincrypto.macs.kmac/KMAC128 : org.kotlincrypto.macs.kmac/Kmac { // org.kotlincrypto.macs.kmac/KMAC128|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.kmac/KMAC128.<init>|<init>(kotlin.ByteArray){}[0]
constructor <init>(kotlin/ByteArray, kotlin/ByteArray?) // org.kotlincrypto.macs.kmac/KMAC128.<init>|<init>(kotlin.ByteArray;kotlin.ByteArray?){}[0]
constructor <init>(kotlin/ByteArray, kotlin/ByteArray?, kotlin/Int) // org.kotlincrypto.macs.kmac/KMAC128.<init>|<init>(kotlin.ByteArray;kotlin.ByteArray?;kotlin.Int){}[0]

final object Companion : org.kotlincrypto.macs.kmac/Kmac.KMACXofFactory<org.kotlincrypto.macs.kmac/KMAC128> { // org.kotlincrypto.macs.kmac/KMAC128.Companion|null[0]
final const val MAC_LENGTH // org.kotlincrypto.macs.kmac/KMAC128.Companion.MAC_LENGTH|<get-MAC_LENGTH>(){}[0]
final fun <get-MAC_LENGTH>(): kotlin/Int // org.kotlincrypto.macs.kmac/KMAC128.Companion.MAC_LENGTH.<get-MAC_LENGTH>|<get-MAC_LENGTH>(){}[0]

final fun xOf(kotlin/ByteArray, kotlin/ByteArray? =...): org.kotlincrypto.core.xof/Xof<org.kotlincrypto.macs.kmac/KMAC128> // org.kotlincrypto.macs.kmac/KMAC128.Companion.xOf|xOf(kotlin.ByteArray;kotlin.ByteArray?){}[0]
}
}

final class org.kotlincrypto.macs.kmac/KMAC256 : org.kotlincrypto.macs.kmac/Kmac { // org.kotlincrypto.macs.kmac/KMAC256|null[0]
constructor <init>(kotlin/ByteArray) // org.kotlincrypto.macs.kmac/KMAC256.<init>|<init>(kotlin.ByteArray){}[0]
constructor <init>(kotlin/ByteArray, kotlin/ByteArray?) // org.kotlincrypto.macs.kmac/KMAC256.<init>|<init>(kotlin.ByteArray;kotlin.ByteArray?){}[0]
constructor <init>(kotlin/ByteArray, kotlin/ByteArray?, kotlin/Int) // org.kotlincrypto.macs.kmac/KMAC256.<init>|<init>(kotlin.ByteArray;kotlin.ByteArray?;kotlin.Int){}[0]

final object Companion : org.kotlincrypto.macs.kmac/Kmac.KMACXofFactory<org.kotlincrypto.macs.kmac/KMAC256> { // org.kotlincrypto.macs.kmac/KMAC256.Companion|null[0]
final const val MAC_LENGTH // org.kotlincrypto.macs.kmac/KMAC256.Companion.MAC_LENGTH|<get-MAC_LENGTH>(){}[0]
final fun <get-MAC_LENGTH>(): kotlin/Int // org.kotlincrypto.macs.kmac/KMAC256.Companion.MAC_LENGTH.<get-MAC_LENGTH>|<get-MAC_LENGTH>(){}[0]

final fun xOf(kotlin/ByteArray, kotlin/ByteArray? =...): org.kotlincrypto.core.xof/Xof<org.kotlincrypto.macs.kmac/KMAC256> // org.kotlincrypto.macs.kmac/KMAC256.Companion.xOf|xOf(kotlin.ByteArray;kotlin.ByteArray?){}[0]
}
}

sealed class org.kotlincrypto.macs.kmac/Kmac : org.kotlincrypto.core.mac/Mac, org.kotlincrypto.core.xof/XofAlgorithm { // org.kotlincrypto.macs.kmac/Kmac|null[0]
constructor <init>(kotlin/ByteArray, kotlin/ByteArray?, kotlin/Int, kotlin/Int, kotlin/Boolean) // org.kotlincrypto.macs.kmac/Kmac.<init>|<init>(kotlin.ByteArray;kotlin.ByteArray?;kotlin.Int;kotlin.Int;kotlin.Boolean){}[0]
constructor <init>(org.kotlincrypto.core.mac/Mac.Engine) // org.kotlincrypto.macs.kmac/Kmac.<init>|<init>(org.kotlincrypto.core.mac.Mac.Engine){}[0]

sealed class <#A1: org.kotlincrypto.macs.kmac/Kmac> KMACXofFactory : org.kotlincrypto.core.xof/XofFactory<#A1> { // org.kotlincrypto.macs.kmac/Kmac.KMACXofFactory|null[0]
constructor <init>() // org.kotlincrypto.macs.kmac/Kmac.KMACXofFactory.<init>|<init>(){}[0]

final inner class KMACXof : org.kotlincrypto.core.xof/XofFactory.XofDelegate<#A1> { // org.kotlincrypto.macs.kmac/Kmac.KMACXofFactory.KMACXof|null[0]
constructor <init>(#A1) // org.kotlincrypto.macs.kmac/Kmac.KMACXofFactory.KMACXof.<init>|<init>(2:0){}[0]

final fun copy(): org.kotlincrypto.core.xof/Xof<#A1> // org.kotlincrypto.macs.kmac/Kmac.KMACXofFactory.KMACXof.copy|copy(){}[0]
}
}

final object Companion // org.kotlincrypto.macs.kmac/Kmac.Companion|null[0]
}
Empty file.

0 comments on commit 5915260

Please sign in to comment.