Skip to content

Commit 05af9df

Browse files
authored
Removed local package (#4)
1 parent f9fccd8 commit 05af9df

File tree

19 files changed

+35
-52
lines changed

19 files changed

+35
-52
lines changed

DemoApp/DemoApp.xcodeproj/project.pbxproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
FA1671FD2A53E11E00A42DB0 /* MessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1671FC2A53E11E00A42DB0 /* MessageView.swift */; };
3131
FA1671FF2A53E1AF00A42DB0 /* ConversationMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1671FE2A53E1AF00A42DB0 /* ConversationMessageView.swift */; };
3232
FA3C0DE72A620E9A00278952 /* MyPreviewTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA3C0DE62A620E9A00278952 /* MyPreviewTest.swift */; };
33+
FA4F5AD92A7A3E7700B268FF /* Snapshotting in Frameworks */ = {isa = PBXBuildFile; productRef = FA4F5AD82A7A3E7700B268FF /* Snapshotting */; };
34+
FA4F5ADA2A7A3E7700B268FF /* Snapshotting in Embed Frameworks */ = {isa = PBXBuildFile; productRef = FA4F5AD82A7A3E7700B268FF /* Snapshotting */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
3335
FA9C8E442A56959300DC4574 /* RatingPreviews.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA9C8E432A56959300DC4574 /* RatingPreviews.swift */; };
3436
FACA23792A55FBEE0080545A /* DemoModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA1671D72A5399F700A42DB0 /* DemoModule.framework */; };
3537
FAF1BA632A54935C00AEBE1B /* .. in Resources */ = {isa = PBXBuildFile; fileRef = FAF1BA622A54934200AEBE1B /* .. */; };
@@ -59,6 +61,7 @@
5961
dstPath = "";
6062
dstSubfolderSpec = 10;
6163
files = (
64+
FA4F5ADA2A7A3E7700B268FF /* Snapshotting in Embed Frameworks */,
6265
);
6366
name = "Embed Frameworks";
6467
runOnlyForDeploymentPostprocessing = 0;
@@ -127,6 +130,7 @@
127130
isa = PBXFrameworksBuildPhase;
128131
buildActionMask = 2147483647;
129132
files = (
133+
FA4F5AD92A7A3E7700B268FF /* Snapshotting in Frameworks */,
130134
FA0D85432A72A5BD002A28ED /* SnapshottingTests in Frameworks */,
131135
);
132136
runOnlyForDeploymentPostprocessing = 0;
@@ -294,6 +298,7 @@
294298
name = DemoAppUITests;
295299
packageProductDependencies = (
296300
FA0D85422A72A5BD002A28ED /* SnapshottingTests */,
301+
FA4F5AD82A7A3E7700B268FF /* Snapshotting */,
297302
);
298303
productName = DemoAppUITests;
299304
productReference = FAC167E72A5F41C500D79C23 /* DemoAppUITests.xctest */;
@@ -798,6 +803,10 @@
798803
isa = XCSwiftPackageProductDependency;
799804
productName = SnapshottingTests;
800805
};
806+
FA4F5AD82A7A3E7700B268FF /* Snapshotting */ = {
807+
isa = XCSwiftPackageProductDependency;
808+
productName = Snapshotting;
809+
};
801810
/* End XCSwiftPackageProductDependency section */
802811
};
803812
rootObject = FA1671B72A5367A800A42DB0 /* Project object */;

DemoApp/DemoAppUITests/MyPreviewTest.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import Foundation
99
import XCTest
10+
import Snapshotting
1011
import SnapshottingTests
1112

1213
class MyPreviewTest: PreviewTest {

Package.swift

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@ let package = Package(
1717
.library(
1818
name: "SnapshotPreviewsCore",
1919
targets: ["SnapshotPreviewsCore"]),
20-
],
21-
dependencies: [
22-
.package(name: "Snapshotting", path: "Sources/Snapshotting"),
20+
// Dynamic library that your main app will have inserted to generate previews
21+
.library(
22+
name: "Snapshotting",
23+
type: .dynamic,
24+
targets: ["Snapshotting"]),
2325
],
2426
targets: [
2527
// Targets are the basic building blocks of a package, defining a module or a test suite.
2628
// Targets can depend on other targets in this package and products from dependencies.
27-
// Snapshotting must be a dependency here so it dynamically links
28-
.target(name: "SnapshottingTests", dependencies: [.product(name: "Snapshotting", package: "Snapshotting")]),
29-
.target(name: "SnapshotPreviewsCore", dependencies: [.product(name: "SnapshottingCore", package: "Snapshotting")]),
29+
// Target that provides the XCTest
30+
.target(name: "SnapshottingTests"),
31+
// Core functionality
32+
.target(name: "SnapshotPreviewsCore"),
33+
// Inserted dylib
34+
.target(name: "Snapshotting", dependencies: ["SnapshottingSwift"]),
35+
// Swift code in the inserted dylib
36+
.target(name: "SnapshottingSwift", dependencies: ["SnapshotPreviewsCore"]),
3037
.testTarget(
3138
name: "SnapshotPreviewsTests",
3239
dependencies: ["SnapshotPreviewsCore"]),

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ See [the documentation](https://docs.emergetools.com/docs/swiftui-previews) for
1515

1616
## Local Debugging
1717

18-
Use this Swift Package for locally debugging your views snapshots. You’ll need a UI test target that imports the `SnapshottingTests` product from this package. Create a test that inherits from `PreviewTest` like this:
18+
Use this Swift Package for locally debugging your views snapshots. You’ll need a UI test target that imports the `SnapshottingTests` and `Snapshotting` products from this package. Create a test that inherits from `PreviewTest` like this:
1919

2020
```
21+
import Snapshotting
22+
import SnapshottingTests
23+
2124
class MyPreviewTest: PreviewTest {
2225
2326
override func getApp() -> XCUIApplication {

Sources/SnapshotPreviewsCore/Exports.swift

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)