Skip to content

Commit 4836b57

Browse files
committed
New approach for Swift Import
1 parent 63da345 commit 4836b57

24 files changed

+406
-536
lines changed

build-logic/src/main/kotlin/ckbuild/tests/GenerateProviderTestsTask.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import org.gradle.api.file.*
99
import org.gradle.api.provider.*
1010
import org.gradle.api.tasks.*
1111

12+
//@CacheableTask
1213
abstract class GenerateProviderTestsTask : DefaultTask() {
1314
@get:Input
1415
abstract val packageName: Property<String>

cryptography-providers/cryptokit/build.gradle.kts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,17 @@
33
*/
44

55
import ckbuild.*
6+
import dev.whyoleg.swiftinterop.*
7+
import org.jetbrains.kotlin.gradle.plugin.mpp.*
68

79
plugins {
8-
910
id("ckbuild.multiplatform-library")
1011
id("ckbuild.multiplatform-provider-tests")
1112
id("dev.whyoleg.swiftinterop")
1213
}
1314

1415
description = "cryptography-kotlin Cryptokit provider"
1516

16-
swiftInterop {
17-
packageName = "dev.whyoleg.cryptography.providers.cryptokit.internal.swiftinterop"
18-
iosVersion = "14"
19-
macosVersion = "11"
20-
tvosVersion = "14"
21-
watchosVersion = "7"
22-
}
23-
2417
kotlin {
2518
appleTargets(
2619
supportsWatchosArm32 = false,
@@ -39,6 +32,14 @@ kotlin {
3932
api(projects.cryptographyCore)
4033
implementation(projects.cryptographyProviderBase)
4134
}
35+
36+
targets.withType<KotlinNativeTarget>().configureEach {
37+
swiftInterop("DwcCryptoKitInterop") {
38+
packageName("dev.whyoleg.cryptography.providers.cryptokit.internal.swiftinterop")
39+
// TODO: migrate to new package and rename Swift classes to Dwc*
40+
// packageName("dev.whyoleg.cryptography.providers.cryptokit.internal.swift.DwcCryptoKitInterop")
41+
}
42+
}
4243
}
4344

4445
providerTests {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// swift-tools-version:6.2
2+
import PackageDescription
3+
4+
// dwc = dev.whyoleg.cryptography
5+
let package = Package(
6+
name: "DwcCryptoKitInterop",
7+
// versions for CryptoKit and/or Kotlin/Native support
8+
platforms: [
9+
.macOS(.v11),
10+
.iOS(.v14),
11+
.tvOS(.v14),
12+
.watchOS(.v7)
13+
],
14+
products: [
15+
.library(
16+
name: "DwcCryptoKitInterop",
17+
type: .static,
18+
targets: ["DwcCryptoKitInterop"]
19+
)
20+
],
21+
dependencies: [],
22+
targets: [
23+
.target(name: "DwcCryptoKitInterop")
24+
]
25+
)

0 commit comments

Comments
 (0)