Skip to content

Commit fd614d4

Browse files
committed
Update README and example
1 parent 6460f6a commit fd614d4

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Examples/PackageTraits/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,29 @@ The `SQLMiddleware` module has just a single top-level function `middlewareDatab
9494

9595
A dependent of `SQLMiddleware` that enables the `SQLCipher` trait.
9696

97+
```swift
98+
// swift-tools-version: 6.1
99+
import PackageDescription
100+
101+
let package = Package(
102+
name: "MiddlewareClientWithSQLCipher",
103+
products: [
104+
.library(name: "MiddlewareClientWithSQLCipher",
105+
targets: ["MiddlewareClientWithSQLCipher"])
106+
],
107+
dependencies: [
108+
.package(path: "../SQLMiddleware", traits: ["SQLCipher"])
109+
],
110+
targets: [
111+
.target(name: "MiddlewareClientWithSQLCipher", dependencies: [
112+
.product(name: "SQLMiddleware", package: "SQLMiddleware")
113+
]),
114+
.testTarget(name: "MiddlewareClientWithSQLCipherTests",
115+
dependencies: ["MiddlewareClientWithSQLCipher"])
116+
]
117+
)
118+
```
119+
97120
It contains a test case:
98121

99122
```swift
@@ -106,6 +129,29 @@ It contains a test case:
106129

107130
A dependent of `SQLMiddleware` that does not enable the `SQLCipher` trait. It is otherwise identical to `MiddlewareClientWithSQLCipher` in every way.
108131

132+
```swift
133+
// swift-tools-version: 6.1
134+
import PackageDescription
135+
136+
let package = Package(
137+
name: "MiddlewareClientWithoutSQLCipher",
138+
products: [
139+
.library(name: "MiddlewareClientWithoutSQLCipher",
140+
targets: ["MiddlewareClientWithoutSQLCipher"])
141+
],
142+
dependencies: [
143+
.package(path: "../SQLMiddleware")
144+
],
145+
targets: [
146+
.target(name: "MiddlewareClientWithoutSQLCipher", dependencies: [
147+
.product(name: "SQLMiddleware", package: "SQLMiddleware")
148+
]),
149+
.testTarget(name: "MiddlewareClientWithoutSQLCipherTests",
150+
dependencies: ["MiddlewareClientWithoutSQLCipher"])
151+
]
152+
)
153+
```
154+
109155
It contains a test case:
110156

111157
```swift

0 commit comments

Comments
 (0)