Nastya Gorban
Nastya Gorban

Reputation: 1241

Does Mogenerator works with Xcode 6?

I've setup Mogenerator for my project using tutorial but is some reason it doesn't generate files on Build.

Here is my script: enter image description here

My Project Folder: enter image description here And *.xcdatamodel file: enter image description here

I'm choosing Mogenerator target, pressing build. Build succeeded, but no files created. I know that mogenerator doesn't add it to my xcode project and lookup for files in project folder in finder, but nothing new there :(. I just don't understand what am I doing wrong. Tried a lot of scripts variants.

I'll be grateful for any help! Thanks.

Upvotes: 1

Views: 1042

Answers (2)

MadNik
MadNik

Reputation: 7793

This is my script. It works fine. Replace content inside <> with yours. Also check the path to shell. Mine is /bin/sh .

https://gist.github.com/madnik/8a91d546cc7031f829c5

MODEL_PATH="$PROJECT_DIR/<RootDirectory>/<ModelName>.xcdatamodeld"
OUTPUT_DIRECTORY="$PROJECT_DIR/<RootDirectory>/Classes/Model"
mogenerator --v2 --model $MODEL_PATH --output-dir $OUTPUT_DIRECTORY

Note I'm using latest version of mogenerator. --v2 argument is basically semantic versioning for tool arguments.

Upvotes: 1

Nastya Gorban
Nastya Gorban

Reputation: 1241

The problem was in script. I don't know why but I had to explicitly provide path to mogenerator (which is "/usr/local/bin/mogenerator"):

/usr/local/bin/mogenerator --v2 --model MogeneratorProject/MogeneratorProject.xcdatamodeld --output-dir MogeneratorProject/Model

Also I've been providing wrong path to Shell. Now it's /bin/sh

Upvotes: 0

Related Questions