-
Notifications
You must be signed in to change notification settings - Fork 74
Allow additional imports with natalie-imports.json #55
base: master
Are you sure you want to change the base?
Conversation
To be automatically detected in our perfect world you can put the file near the storyboard with specific extension, as I do with my PR https://github.com/krzyzanowskim/Natalie/pull/48/files |
what is wrong with specyfying module in storyboard? this is the easiest way to handle it. Configuration file introduce complication how to deal with the file, where to store etc. I'd like to realy avoid that as long as possible. |
you can't specify module for objective-c framework, this is what I understand in the corresponding issue |
@phimage |
Yes option is far better than adding an extra argument behind the file path
I prefer configuration files by storyboard because
that's why I make "plist" into PR #48 then plist VS json, the two are easy to read, but in Xcode I prefer create and edit plist file |
As a side note, if a solution is found to the issue #64 I just opened where I ask for a feature to have Natalie parse an xcodeproj file to generate target specific files, Natalie could automatically find out which frameworks each target is linked with. |
hello, I want merge this change, can you please rebase to current codebase ? 👍 |
@krzyzanowskim
Here's a proposed fix for #37, as per phimage's suggestion.
This commit modifies
natalie.swift
so it can take a second argumentimports_file_json
. This JSON file must contain an array of all the framework names to import and that natalie might not be able to autodetect (see original issue).For example, in
natalie-imports.json
:and then:
which will add
import FlatUIKit
right before custom module imports.A couple notes:
natalie-imports.json
to be automatically detected inprojectdir
, but since the documentation says that the path should beprojectdir/projectname
we'd have to go one directory up and that seems a bit hacky.--additional-imports natalie-imports.json
would be best, but I didn't want to add too much code without your approval (since we'd need to hack aroundProcess.argv
)Let me know what you think about this solution and how to possibly improve it.