Skip to content

Commit ddeaefa

Browse files
author
Harald
committed
Add some temporary diagnostig output, to trace fetch behaviour
1 parent ae377e2 commit ddeaefa

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Plugins/GeneratorCommand/ObjectBoxCommand.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,22 @@ struct GeneratorCommand: CommandPlugin {
7878
? context.package.targets
7979
: try context.package.targets(named: targetNames)
8080

81+
8182
// Since the generator generates code even for targets that have no ObjectBox annotations at all,
8283
// restrict the target to not generate code for targets like tests ...
8384
if targets.count > 1 {
84-
let targetNames = targets.map { $0.name }.joined(separator: ", ")
85-
Diagnostics.error("Multiple targets found\nPlease select specify one target by using the `--target name` option\nAvailable target names: \(targetNames)")
85+
let availableTargetNames = targets.map { $0.name }.joined(separator: ", ")
86+
Diagnostics.error("Multiple targets found\nPlease select specify one target by using the `--target name` option\nAvailable target names: \(availableTargetNames)")
87+
return
88+
} else if targets.isEmpty {
89+
Diagnostics.error("No target found")
8690
return
91+
} else {
92+
print("Have one target \(targets[0].name)")
8793
}
8894

95+
print("Remove updated version 1") // some debug to see if latest git version is fetched, or if some cache is used
96+
8997
for target in targets {
9098
guard let target = target.sourceModule else { continue }
9199

0 commit comments

Comments
 (0)