Skip to content

Commit c549f33

Browse files
author
Harald
committed
Adopt readme
1 parent 455feb2 commit c549f33

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This Swift package contains the ObjectOox generator as a plugin and the ObjectBo
44

55
## Usage
66

7+
Add you package dependency
8+
9+
### From a Swift package
10+
711
Declare the package dependency
812

913
```swift
@@ -14,12 +18,17 @@ Then link your application with ObjectBox
1418

1519
```swift
1620
.executableTarget(
17-
name: "CoolApp",
21+
name: "MyApp",
1822
dependencies: [
19-
.product(name: "ObjectBox", package: "objectbox-swift-spm")
23+
.product(name: "ObjectBox.xcframework", package: "objectbox-swift-spm")
2024
],
2125
```
2226

27+
### For a XCode project
28+
29+
- Add a package dependency `"https://github.com/objectbox/objectbox-swift-spm.git"` for your project.
30+
- Confirm to link your project against `ObjectBox.xcframework`
31+
2332
## Running the objectbox code generator
2433

2534
The plugin name name is `objectbox-generator`
@@ -34,19 +43,14 @@ To run the plugin from the command line:
3443
swift package plugin --allow-writing-to-package-directory objectbox-generator
3544
```
3645

37-
### XCode, opening a Swift package
46+
### XCode
3847

3948
Find the plugin menu entry for `ObjectBox` and run the `GeneratorCommand`.
4049

41-
If you have multiple targets, select the one for which you want to generate the code.
42-
43-
### XCode, classic .xcodeproj
44-
45-
As for now, we still recommend to use the existing Cocoapod.
46-
47-
However, if you want, you can still add `objectbox-swift-spm` as a package dependency
48-
and run the generator command. But please be aware that this is not supported yet.
50+
You will be asked to select a target, select that one which contains your ObjectBox model.
4951

50-
TODO: add note about the XCFramework
52+
## Known limitations
5153

52-
(TODO: Note to myself: Align cocoapod way and generator way to produce the same files)
54+
- The MacCatalyst build has not yet been integrated into Objectbox tests.
55+
- For XCode project, the generated file `TargetProject/ObjectBox-generated/EntityInfo.generated.swift` needs to be added to XCode by hand.
56+
- After changes on the ObjectBox models, the generator needs to be executed manually. This is due to the fact that only Generator commands are allowed to write to the package directory, and ObjectBox generated `ObjectBox-models.json` file needs to be added to git.

0 commit comments

Comments
 (0)