Skip to content

Commit d3c54b7

Browse files
Format with swift-format, add info to README
1 parent 482431b commit d3c54b7

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

Plugins/GeneratorCommand/ObjectBoxCommand.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ struct GeneratorCommand: CommandPlugin {
9494
? context.package.targets
9595
: try context.package.targets(named: targetNames)
9696

97-
9897
// Since the generator generates code even for targets that have no ObjectBox annotations at all,
9998
// restrict the target to not generate code for targets like tests ...
10099
if targets.count > 1 {
101100
let availableTargetNames = targets.map { $0.name }.joined(separator: ", ")
102-
Diagnostics.error("Multiple targets found\nPlease select specify one target by using the `--target name` option\nAvailable target names: \(availableTargetNames)")
101+
Diagnostics.error(
102+
"Multiple targets found\nPlease select specify one target by using the `--target name` option\nAvailable target names: \(availableTargetNames)"
103+
)
103104
return
104105
} else if targets.isEmpty {
105106
Diagnostics.error("No target found")
@@ -108,7 +109,7 @@ struct GeneratorCommand: CommandPlugin {
108109
print("Have one target \(targets[0].name)")
109110
}
110111

111-
print("Remove updated version 1") // some debug to see if latest git version is fetched, or if some cache is used
112+
print("Remove updated version 1") // some debug to see if latest git version is fetched, or if some cache is used
112113

113114
for target in targets {
114115
guard let target = target.sourceModule else { continue }
@@ -202,8 +203,12 @@ struct GeneratorCommand: CommandPlugin {
202203
runGenerator(generator: tool, args: args)
203204

204205
// TODO , figgure out how to add the generated folder to xcode within here
205-
Diagnostics.remark("! Don't forget to add the generated source file in 'ObjectBox-generated/EntityInfo.generated.swift' to the project, and to git if you want to keep it")
206-
Diagnostics.remark("! Don't forget to add the generated model file in 'ObjectBox-models.json' to git, this is important for the ObjectBox model generation")
206+
Diagnostics.remark(
207+
"! Don't forget to add the generated source file in 'ObjectBox-generated/EntityInfo.generated.swift' to the project, and to git if you want to keep it"
208+
)
209+
Diagnostics.remark(
210+
"! Don't forget to add the generated model file in 'ObjectBox-models.json' to git, this is important for the ObjectBox model generation"
211+
)
207212

208213
}
209214

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@
55
This repository only hosts the ObjectBox Swift package.
66

77
This Swift package contains the [ObjectBox Swift API](https://objectbox.io/docfiles/swift/current/), the [ObjectBox Swift generator](https://swift.objectbox.io/getting-started#generate-objectbox-code) as a command plugin and the native ObjectBox library for macOS and iOS.
8+
9+
## Development
10+
11+
Swift code is formatted using [swift-format](https://github.com/swiftlang/swift-format):
12+
13+
```shell
14+
swift-format --in-place --recursive .
15+
```

0 commit comments

Comments
 (0)