| 1 | // swift-tools-version: 6.2 |
| 2 | import PackageDescription |
| 3 | import Foundation |
| 4 | |
| 5 | // rastrillo/native at main bb989a7, with Base's additions (Task 1): |
| 6 | // OficinaIDModel.assertion(for:), OficinaApp.base and NativeConnection's |
| 7 | // ://open. OFICINA_NATIVE_PACKAGE_PATH points at a local checkout instead, |
| 8 | // for work on the kit itself. |
| 9 | let sharedNative: Package.Dependency = ProcessInfo.processInfo.environment["OFICINA_NATIVE_PACKAGE_PATH"].map { .package(name: "native", path: $0) } |
| 10 | ?? .package(url: "https://amadan.net/rastrillo/native", revision: "bb989a7cf3bdb152e1529f6e514d24f249f777ec") |
| 11 | |
| 12 | let package = Package( |
| 13 | name: "BaseNative", |
| 14 | defaultLocalization: "en", |
| 15 | platforms: [.macOS(.v26), .iOS(.v26)], |
| 16 | products: [ |
| 17 | .library(name: "BaseKit", targets: ["BaseKit"]), |
| 18 | .executable(name: "BaseMac", targets: ["BaseMac"]), |
| 19 | ], |
| 20 | dependencies: [ |
| 21 | sharedNative, |
| 22 | // Equipo's pin (00d09aa7): the chat's Markdown is Equipo's parser. |
| 23 | .package(url: "https://github.com/swiftlang/swift-cmark", revision: "08ddb528923cc1a6527e02b7a1aee9e516ca749a"), |
| 24 | // The Mac's shortcut for Ask Base (P11), 3.1.0. MIT; in the Colophon. |
| 25 | .package(url: "https://github.com/sindresorhus/KeyboardShortcuts", revision: "772133d9dbe800fdac0473226822994c5c162c58"), |
| 26 | ], |
| 27 | targets: [ |
| 28 | // The look, the API client, Ask and Home, for both apps. Fonts/ is |
| 29 | // filled by scripts/fonts-into-bundle.sh before any build. |
| 30 | .target(name: "BaseKit", |
| 31 | dependencies: [.product(name: "cmark-gfm", package: "swift-cmark"), |
| 32 | .product(name: "RastrilloApple", package: "native")], |
| 33 | resources: [.process("Resources/Localizable.xcstrings"), .copy("Resources/Fonts"), .copy("Resources/Colophon.json")]), |
| 34 | .executableTarget(name: "BaseMac", |
| 35 | dependencies: ["BaseKit", |
| 36 | .product(name: "RastrilloApple", package: "native"), |
| 37 | .product(name: "RastrilloMacUpdates", package: "native", condition: .when(platforms: [.macOS])), |
| 38 | .product(name: "KeyboardShortcuts", package: "KeyboardShortcuts", condition: .when(platforms: [.macOS]))], |
| 39 | path: "Sources/BaseMac"), |
| 40 | .testTarget(name: "BaseKitTests", |
| 41 | dependencies: ["BaseKit", .product(name: "RastrilloApple", package: "native"), |
| 42 | .product(name: "RastrilloTestSupport", package: "native")], |
| 43 | resources: [.copy("Fixtures")]), |
| 44 | // The screenshot gate's Mac half; scripts/snapshots.sh runs it, plain |
| 45 | // `swift test` skips it. ios/project.yml builds the same files as |
| 46 | // BasePhoneSnapshots for the iPhone half. |
| 47 | .testTarget(name: "BaseSnapshots", |
| 48 | dependencies: ["BaseKit", .product(name: "RastrilloSnapshots", package: "native"), |
| 49 | .product(name: "RastrilloApple", package: "native"), |
| 50 | .product(name: "RastrilloTestSupport", package: "native")], |
| 51 | exclude: ["__Snapshots__"]), |
| 52 | ] |
| 53 | ) |
| 54 | |