-
Notifications
You must be signed in to change notification settings - Fork 10
/
Package.swift
61 lines (59 loc) · 2.96 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SnapshotPreviews",
platforms: [.iOS(.v15), .macOS(.v12), .watchOS(.v10)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "PreviewGallery",
targets: ["PreviewGallery"]),
// Test library to import in your XCTest target.
// This is the only library that depends on XCTest.framework
.library(
name: "SnapshottingTests",
targets: ["SnapshottingTests"]),
// Link the main app to this target to use custom snapshot settings
// This lib does not get inserted when running tests to avoid
// duplicate symbols.
.library(
name: "SnapshotPreferences",
targets: ["SnapshotPreferences"]),
// Core functionality for snapshotting exported from the internal package
.library(
name: "SnapshotPreviewsCore",
targets: ["SnapshotPreviewsCore"]),
// Dynamic library that your main app will have inserted to generate previews
.library(
name: "Snapshotting",
type: .dynamic,
targets: ["Snapshotting"]),
],
dependencies: [
.package(url: "https://github.com/EmergeTools/FlyingFox.git", exact: "1.0.0"),
.package(url: "https://github.com/EmergeTools/AccessibilitySnapshot.git", exact: "1.0.2"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
// Target that provides the XCTest
.target(name: "SnapshottingTestsObjc"),
.target(name: "SnapshottingTests", dependencies: ["SnapshotPreviewsCore", "SnapshottingTestsObjc"]),
.target(name: "SnapshotSharedModels"),
// Core functionality
.target(name: "SnapshotPreviewsCore", dependencies: ["PreviewsSupport", "SnapshotSharedModels", .product(name: "AccessibilitySnapshotCore", package: "AccessibilitySnapshot", condition: .when(platforms: [.iOS, .macCatalyst]))]),
.target(name: "SnapshotPreferences", dependencies: ["SnapshotSharedModels"]),
// Inserted dylib
.target(name: "Snapshotting", dependencies: ["SnapshottingSwift"]),
// Swift code in the inserted dylib
.target(name: "SnapshottingSwift", dependencies: ["SnapshotPreviewsCore", .product(name: "FlyingFox", package: "FlyingFox")]),
.target(name: "PreviewGallery", dependencies: ["SnapshotPreviewsCore", "SnapshotPreferences"]),
.binaryTarget(
name: "PreviewsSupport",
path: "PreviewsSupport/PreviewsSupport.xcframework"),
.testTarget(
name: "SnapshotPreviewsTests",
dependencies: ["SnapshotPreviewsCore"]),
]
)