SPB Git

Repository Public License

Package.swift 2.3 KB 52 lines swift

1// swift-tools-version: 6.02// ORIX Convert — Packages/ConvertKit/Package.swift3// Description: ConvertKit assembles every conversion engine of ORIX Convert behind one library, and builds the4//              `orix-convert` command-line tool on top of it. To wire an engine package: add its name to `engines`.5// Author: Simon-Pierre Boucher — contact@spboucher.ai6import PackageDescription78/// The engine packages of this build — ONE LINE PER PACKAGE (directory name = module name = product name).9/// `Sources/ConvertKit/ORIXEngines.swift` picks each one up with `#if canImport(...)`.10/// List a package only when `swift build` succeeds in its directory.11let engines = [12    "EngineImage",13    "EnginePDF",14    "EngineVector",15    "EngineMedia",16    "EngineDocuments",17    "EngineData",18    "EngineArchive",19    "EngineFont",20    "EngineSubtitle",21    "EngineModel3D",22    "EngineGeo",23    "EngineScientific",24]2526.filter { name in27    // Development escape hatch: ORIX_CONVERT_SKIP_ENGINES=EngineArchive,EngineGeo builds without packages that are28    // being edited. Never set for a release build.29    !(Context.environment["ORIX_CONVERT_SKIP_ENGINES"] ?? "").split(separator: ",").map(String.init).contains(name)30}3132let core = Target.Dependency.product(name: "ConvertCore", package: "ORIXConvertCore")3334let package = Package(35    name: "ConvertKit",36    platforms: [.macOS(.v15)],37    products: [38        .library(name: "ConvertKit", targets: ["ConvertKit"]),39        .executable(name: "orix-convert", targets: ["orix-convert"]),40    ],41    dependencies: [.package(path: "../ORIXConvertCore")] + engines.map { .package(path: "../\($0)") },42    targets: [43        .target(name: "ConvertKit", dependencies: [core] + engines.map { .product(name: $0, package: $0) }),44        .target(name: "ConvertCLI", dependencies: ["ConvertKit", core]),45        // In the app bundle the tool sits in Contents/Helpers and its dynamic libraries (libduckdb) in46        // Contents/Frameworks; during development they sit next to it (@loader_path, added by SwiftPM).47        .executableTarget(name: "orix-convert", dependencies: ["ConvertCLI"],48                          linkerSettings: [.unsafeFlags(["-Xlinker", "-rpath", "-Xlinker", "@loader_path/../Frameworks"])]),49        .testTarget(name: "ConvertKitTests", dependencies: ["ConvertKit", "ConvertCLI", "orix-convert", core]),50    ]51)52
Files main
Menu

Theme