Skip to content

Commit 2dc0536

Browse files
committed
Introduce optimal provider which if preferred way to have single dependency
1 parent c7f57fc commit 2dc0536

File tree

6 files changed

+100
-0
lines changed

6 files changed

+100
-0
lines changed

cryptography-providers/optimal/api/cryptography-provider-optimal.api

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Klib ABI Dump
2+
// Targets: [androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86, iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, 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: <dev.whyoleg.cryptography:cryptography-provider-optimal>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright (c) 2023-2025 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
import ckbuild.*
6+
import org.jetbrains.kotlin.gradle.*
7+
import org.jetbrains.kotlin.gradle.plugin.mpp.*
8+
import org.jetbrains.kotlin.konan.target.*
9+
10+
plugins {
11+
id("ckbuild.multiplatform-library")
12+
}
13+
14+
description = "cryptography-kotlin optimal provider"
15+
16+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
17+
kotlin {
18+
jvmTarget()
19+
jsTarget()
20+
wasmJsTarget()
21+
nativeTargets()
22+
23+
applyDefaultHierarchyTemplate {
24+
common {
25+
group("web") {
26+
withWasmJs()
27+
withJs()
28+
}
29+
group("native") {
30+
group("nonApple") {
31+
group("mingw")
32+
group("linux")
33+
group("androidNative")
34+
}
35+
group("apple") {
36+
group("cryptokitSupported") {
37+
withApple()
38+
excludeCompilations {
39+
(it.target as? KotlinNativeTarget)?.konanTarget == KonanTarget.WATCHOS_ARM32
40+
}
41+
}
42+
}
43+
}
44+
}
45+
}
46+
47+
sourceSets {
48+
commonMain.dependencies {
49+
api(projects.cryptographyCore)
50+
}
51+
jvmMain.dependencies {
52+
implementation(projects.cryptographyProviderJdk)
53+
}
54+
named("webMain").dependencies {
55+
implementation(projects.cryptographyProviderWebcrypto)
56+
}
57+
appleMain.dependencies {
58+
implementation(projects.cryptographyProviderApple)
59+
}
60+
named("cryptokitSupportedMain").dependencies {
61+
implementation(projects.cryptographyProviderCryptokit)
62+
}
63+
named("nonAppleMain").dependencies {
64+
implementation(projects.cryptographyProviderOpenssl3Prebuilt)
65+
}
66+
}
67+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright (c) 2023-2025 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
package dev.whyoleg.cryptography.providers.optimal
6+
7+
private fun stub(): Unit = Unit
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2023-2025 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
package dev.whyoleg.cryptography.providers.optimal
6+
7+
import dev.whyoleg.cryptography.*
8+
import kotlin.test.*
9+
10+
class RegisteredProvidersTest {
11+
@Test
12+
fun test() {
13+
assertTrue(CryptographySystem.getRegisteredProviders().also {
14+
println(it)
15+
}.isNotEmpty())
16+
}
17+
}

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ projects("cryptography-kotlin") {
6262
module("test")
6363
}
6464
module("cryptokit")
65+
module("optimal") // composite provider
6566
}
6667

6768
// providers tests

0 commit comments

Comments
 (0)