-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter to ignore entities #378
Conversation
during class generation
Hey Martin, I like the exclusion idea for better Xcode interop and your code. However, I think it would make more sense to opt out of mogenerator's codegen at the entity's userInfo level instead of passing in a new argument. I'm thinking something like What do you think? |
Actually, I like your initial naming, so how about Doesn't matter the value of the key, just the key's presence would be enough for mogenerator to ignore it. |
I agree. This is a per-entity setting, and mogenerator already does per-entity checks. It fits with the mogenerator approach to configure this in the model editor instead of at the command line. |
Hey @rentzsch @atomicbird, in the initial implementation I actually started out by having it in the entities. I will update the pull request and give it another try. Thanks for the feedback 🙂 |
as `mogenerator.ignore` user info key
I have added it to the entity now, it looks much better like this. I moved |
Overall looks great. I see two outstanding issues:
|
def assert_entity_user_info_respected
# mogenerator.ignore
includes_uncle = Dir.entries('./MOs').any? { |file| file.include?('Uncle') }
raise 'Failed: Ignored entities should not be generated' if includes_uncle
end
desc 'Generate, Compile and Run Objective-C'
task :objc do
Rake::Task[:clean].execute
gen_and_compile_objc(MOGENERATOR_PATH, '', '')
assert_entity_user_info_respected
Rake::Task[:clean].execute
end
desc 'Generate, Compile and Run Swift'
task :swift do
Rake::Task[:clean].execute
gen_and_compile_swift(MOGENERATOR_PATH, '')
assert_entity_user_info_respected
Rake::Task[:clean].execute
end |
|
@rentzsch, @atomicbird I updated all the things, looking forward to it, thank you 🙂 |
I haven't had a chance to review this in detail but if it looks good to you @rentzsch then by all means merge it. Most of my recent work has gone into the |
Awesome @rentzsch @atomicbird, thanks for merging 🎉 |
Hi @rentzsch
Recently I have been looking into using the Xcode CoreData generated NSManagedObject subclasses. The code base we are working on is kind of big and we have plenty of Mogenerator generated classes.
In order to slowly migrate to the Xcode generated classes we need a way to use both generators at the same time.
Xcode already supports this by allowing to enable/disable code generation per entity. This pull request adds support for ignoring entities when generating with Mogenerator (I looked a bit but couldn't find any other solution to ignore entities).
Tests passed with
MacOSX10.14.sdk
and I added another test for checking if the parameter works.Thank you and I am looking forward to your feedback!