Skip to content

Commit ea89342

Browse files
author
Harald
committed
Improve xcode plugin
1 parent f07960f commit ea89342

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Plugins/GeneratorCommand/ObjectBoxCommand.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,18 @@ struct GeneratorCommand: CommandPlugin {
150150

151151
if sourcesArgs.isEmpty {
152152
// TODO probably error
153-
Diagnostics.warning("No Sift files found in Target \(targetName) ")
153+
Diagnostics.warning("No Swift files found in Target \(targetName) ")
154154
return
155155
}
156156

157157
let targetPath = context.xcodeProject.directory
158+
let outputFolder = targetPath.appending("ObjectBox-generated").string
159+
let jsonModel = targetPath.appending("ObjectBox-models.json").string
158160

159161
let args: [String] =
160162
sourcesArgs + [
161-
"--model-json", targetPath.appending("ObjectBox-models.json").string,
162-
"--output", targetPath.appending("ObjectBox-generated").string,
163-
"--templates", targetPath.string,
163+
"--model-json", jsonModel,
164+
"--output", outputFolder,
164165
"--disableCache",
165166
"--verbose",
166167
"--no-statistics",
@@ -169,6 +170,8 @@ struct GeneratorCommand: CommandPlugin {
169170
runGenerator(generator: tool, args: args)
170171

171172
// TODO , figgure out how to add the generated folder to xcode within here
173+
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")
174+
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")
172175

173176
}
174177

0 commit comments

Comments
 (0)