| 1 | // swift-tools-version: 6.2 |
| 2 | import PackageDescription |
| 3 | import Foundation |
| 4 | |
| 5 | let sharedNative: Package.Dependency = ProcessInfo.processInfo.environment["OFICINA_NATIVE_PACKAGE_PATH"].map { .package(name: "native", path: $0) } |
| 6 | ?? .package(url: "https://amadan.net/rastrillo/native", revision: "0254817dc9dd118ab271f1120cd2b03c1270a1f9") |
| 7 | |
| 8 | /// The editor's probe counters (DocsKit/DocsProbes.swift): on in debug |
| 9 | /// builds, where `swift test` holds them as gates, and in the release probe |
| 10 | /// builds, which pass `-Xswiftc -DDOCS_PROBES` (native/benchmarks/realtime). |
| 11 | /// Never in a shipping (release) build. |
| 12 | let probes: [SwiftSetting] = [.define("DOCS_PROBES", .when(configuration: .debug))] |
| 13 | |
| 14 | let package = Package(name: "DocsNative", defaultLocalization: "en", platforms: [.macOS(.v26), .iOS(.v26)], |
| 15 | products: [.library(name: "DocsKit", targets: ["DocsKit"]), .executable(name: "DocsMac", targets: ["DocsMac"])], |
| 16 | dependencies: [sharedNative], |
| 17 | targets: [ |
| 18 | .binaryTarget(name: "DocsCRDT", path: "Artifacts/DocsCRDT.xcframework"), |
| 19 | .target(name: "DocsKit", dependencies: ["DocsCRDT", .product(name: "RastrilloApple", package: "native")], resources: [.process("Resources"), .copy("Fonts")], swiftSettings: probes), |
| 20 | .executableTarget(name: "DocsMac", dependencies: [.product(name: "RastrilloMacUpdates", package: "native", condition: .when(platforms: [.macOS])), "DocsKit", .product(name: "RastrilloApple", package: "native")], path: "Sources/DocsApp"), |
| 21 | .testTarget(name: "DocsKitTests", dependencies: ["DocsKit", .product(name: "RastrilloTestSupport", package: "native")], swiftSettings: probes), |
| 22 | .testTarget(name: "DocsWindowTests", dependencies: ["DocsMac", "DocsKit", .product(name: "RastrilloApple", package: "native"), |
| 23 | .product(name: "RastrilloTestSupport", package: "native")], swiftSettings: probes), |
| 24 | // The screenshot gate's Mac half; native/scripts/snapshots.sh runs it, |
| 25 | // plain `swift test` skips it. ios/project.yml builds the same file |
| 26 | // as DocsPhoneSnapshots for the iPhone half. |
| 27 | .testTarget(name: "DocsSnapshots", dependencies: ["DocsKit", .product(name: "RastrilloSnapshots", package: "native"), |
| 28 | .product(name: "RastrilloApple", package: "native"), |
| 29 | .product(name: "RastrilloTestSupport", package: "native")], |
| 30 | exclude: ["__Snapshots__"]), |
| 31 | ]) |
| 32 | |