Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

54
packages/swift/Package.swift generated Normal file
View File

@@ -0,0 +1,54 @@
// swift-tools-version: 6.0
import PackageDescription
// NOTE: Run `cargo build -p kreuzberg-swift` and then rerun `alef generate`
// before `swift build`. Alef materializes the swift-bridge Swift/C outputs into
// Sources/RustBridge and Sources/RustBridgeC when the Cargo build output exists.
// See README.md for the full workflow.
let package = Package(
name: "Kreuzberg",
platforms: [
.macOS(.v13),
.iOS(.v16),
],
products: [
.library(name: "Kreuzberg", targets: ["Kreuzberg"])
],
targets: [
// RustBridgeC: pure C/headers target. Swift files in RustBridge import this
// to access C types (RustStr, etc.) produced by swift-bridge.
// publicHeadersPath: "." exposes RustBridgeC.h to dependents.
.target(
name: "RustBridgeC",
path: "Sources/RustBridgeC",
publicHeadersPath: "."
),
// RustBridge: Swift wrapper around the Rust static library.
// Depends on RustBridgeC so the generated Swift files can use the C types.
// linkerSettings wire the Rust staticlib (libkreuzberg_swift.a) produced by
// `cargo build -p kreuzberg-swift` so `swift build` / `swift test` can resolve
// the `__swift_bridge__$*` C symbols. Both target/release and target/debug are
// searched so either cargo profile works.
.target(
name: "RustBridge",
dependencies: ["RustBridgeC"],
path: "Sources/RustBridge",
linkerSettings: [
.unsafeFlags([
"-L../../target/release",
"-L../../target/debug",
]),
.linkedLibrary("kreuzberg_swift"),
.linkedFramework("Security", .when(platforms: [.macOS, .iOS])),
.linkedFramework("CoreFoundation", .when(platforms: [.macOS, .iOS])),
.linkedFramework("SystemConfiguration", .when(platforms: [.macOS])),
]
),
.target(
name: "Kreuzberg", dependencies: ["RustBridge"],
path: "Sources/Kreuzberg"),
.testTarget(
name: "KreuzbergTests", dependencies: ["Kreuzberg"],
path: "Tests/KreuzbergTests"),
]
)