johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

Apple TV support + automatic Framework search paths setting #123

Closed rshev closed 8 years ago

rshev commented 8 years ago

Correct SDK selection for Apple TV. Automatic framework search paths setting to parent project build path (pods work out-of-the-box on Apple TV).

johnno1962 commented 8 years ago

Hi Roman, I can’t merge this request at the moment as I wouldn’t set the default FRAMEWORK_SEARCH_PATH to ../\ myself and don’t have the time for the retest this would require. I’ll leave this open so people can see what is required for Apple TV.

rshev commented 8 years ago

Hi, thanks for looking into it! FRAMEWORK_SEARCH_PATH = "../**" is just a placeholder in pbxproj file, it's overwritten by injection script with the build path for the correct SDK. Do you want me to leave it as it was and only override if sdk is definitely appletv?

orta commented 8 years ago

@johnno1962 - this probably wants another look 👍

johnno1962 commented 8 years ago

Hi @orta, @rshev. In truth I had reservations about this PR as I thought it might slow injection down for large projects. There would need to be two changes If you could change the FRAMEWORK_SEARCH_PATHS placeholder of "../” to “” that would be one fix but I am also concerned that a FRAMEWORK_SEARCH_PATHS of $buildRoot\/Products\/Debug-$sdk/ will bring in a very large number of directories for some projects which agan will slow things down. I’d merge it without hesitation if it were only the change to BundleInjection.h and the change:

Framework search paths took and age to get working. I’d rather not tangle with it at this stage.

rshev commented 8 years ago

@johnno1962 No problem, made it. Do you mind if I leave FRAMEWORK_SEARCH_PATHS adjuster there commented out? I still need it for projects using CocoaPods, for both iOS and AppleTV. It just doesn't find frameworks without that and asks to adjust bundle project manually, so annoying. Thanks!

johnno1962 commented 8 years ago

It’s interesting you have frameworks requiring a $buildRoot\/Products\/Debug-$sdk\/** search path. Where is the framework that can’t be found if you don’t do this?

rshev commented 8 years ago

Sorry, tried to make a basic test project for you, but can't reproduce the issue. It seems to be something weird with the project I'm actively working on. Tried to delete iOSInjectionProject to force it to be rebuilt, but it doesn't help. And Build Settings look almost identical in comparison. Bummer.

johnno1962 commented 8 years ago

I’ve merged it as is. Any information you turn up about what’s going on with your problem project let me know. Thanks for wading through all that Perl!

rshev commented 8 years ago

Thanks a lot, I'm happy to contribute to such a great project as yours!