An open API service indexing awesome lists of open source software.

https://github.com/couchbase/couchbase-lite-swift-ee

Hosting Swift Package for CouchbaseLiteSwift Enterprise Edition
https://github.com/couchbase/couchbase-lite-swift-ee

Last synced: 15 days ago
JSON representation

Hosting Swift Package for CouchbaseLiteSwift Enterprise Edition

Awesome Lists containing this project

README

          

# CouchbaseLiteSwift-EE

Repository for hosting Swift package for Couchbase Lite Swift Enterprise Edition

## Case 1. Including Couchbase Lite to an existing swift package
Adding CouchbaseLiteSwift dependency to your Parent swift package.

1. Add the CouchbaseLiteSwift package as dependency:
```
dependencies: [
.package(name: "CouchbaseLiteSwift",
url: "https://github.com/couchbase/couchbase-lite-swift-ee.git",
from: "4.0.1"),
],
```

2. Add the dependent package product name, to the target:
```
targets: [
.target(name: "ParentPackage",
dependencies: ["CouchbaseLiteSwift"]),
]

```
3. Import CouchbaseLiteSwift, and use it:
```
import CouchbaseLiteSwift

class ParentPackageSomeClass {
func someFunction() {
let db = try! Database(name: "testdb")
print(">> opening the db: \(db.name)")
}
}

```

### Sample Manifest file
```
// swift-tools-version:5.8

import PackageDescription

let package = Package(
name: "ParentPackage",
products: [
.library(
name: "ParentPackage",
targets: ["ParentPackage"]),
],
dependencies: [
.package(name: "CouchbaseLiteSwift",
url: "https://github.com/couchbase/couchbase-lite-swift-ee.git",
from: "4.0.1"),
],
targets: [
.target(
name: "ParentPackage",
dependencies: ["CouchbaseLiteSwift"]),
.testTarget(
name: "ParentPackageTests",
dependencies: ["ParentPackage"]),
]
)
```

## Case 2. Including Couchbase Lite directly to your app project

Add CouchbaseLiteSwift to your HostApp

1. Project to which you are going to add the CouchbaseLiteSwift
1

2. Click on the add package dependency button, (Xcode Project File > Project Settings > Swift Packages > Add Package Dependency)
2

3. Enter the URL, `https://github.com/couchbase/couchbase-lite-swift-ee.git`
3

4. Specify the version
4

5. Finish
5

6. You will see the name, version and URL of the added CouchbaseLiteSwift Package
6

7. Import CouchbaseLiteSwift, and use it.
7