Skip to content
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

Added Carthage Support #164

Merged
merged 4 commits into from Mar 7, 2016
Merged

Added Carthage Support #164

merged 4 commits into from Mar 7, 2016

Conversation

davbeck
Copy link
Contributor

@davbeck davbeck commented Mar 2, 2016

This is done around the requirements and desires outlined in #61, meaning that it is a complete project restructuring.

I've included the framework in my own app using the following and so far everything is working as expected:

github "davbeck/NYTPhotoViewer" "develop"

See my note on the issue in regards to GIF support. This is, in my opinion, the closest analogue to Cocoapods subspecs.

As for the resource bundle, I just made the folder a bundle itself. CocoaPods should create it's own bundle based off of the files in that folder/bundle and Carthage should recognize the folder as a bundle and embed it as such. No need to special case any code.

I did run pod lib lint, but I haven't tried to pull in the framework using CocoaPods just yet.

This is a completel reorganization of the project, but there shouldn't be any changes to the actual code.
This should have been included with the Carthage restructuring.
@cdzombak cdzombak self-assigned this Mar 3, 2016
@cdzombak
Copy link
Contributor

cdzombak commented Mar 3, 2016

@davbeck this looks great, and I'm reviewing it today/tomorrow as I find time.

As a first small thing to fix, it looks like FLAnimatedImage is included in the NYTPhotoViewer project with an absolute path instead of "Relative to Group":

11FBDA7B1C87746600018169 /* FLAnimatedImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = FLAnimatedImage.framework; path = "/Users/davbeck/Library/Developer/Xcode/DerivedData/NYTPhotoViewer-cyvibeoaqesupbclsxbljcxwjqzw/Build/Products/Debug-iphoneos/FLAnimatedImage.framework"; sourceTree = "<absolute>"; };

screen shot 2016-03-03 at 14 45 23

Can you please push that small change to your branch, and I'll keep looking?

@davbeck
Copy link
Contributor Author

davbeck commented Mar 3, 2016

Good catch. It opens up another issue though I wasn't aware of. At least on my Mac with Xcode 7.2.1 (7C1002), linking against the relative framework doesn't properly add the project as a dependency to the Example app and the projects from the workspace don't appear when adding dependencies manually.

I don't normally use workspaces with Carthage (it's not how the official Carthage docs recommend setting up projects) but I wanted to follow the ThoughtBot guide linked to in the issue.

... by removing the workspace. I'm not entirely sure if this was due to a bug in Xcode, intended behavior, a bad system configuration, or user error, but the target dependencies were not working between projects in the same workspace.

However, projects can be linked from other projects without an explicit workspace. Switching to this method resolved any issues I was seeing.
@davbeck
Copy link
Contributor Author

davbeck commented Mar 4, 2016

I think I've resolved that issue in the last commit by removing the workspace and just using a single project. I also did a carthage update in my own project to verify everything still works there.

@cdzombak
Copy link
Contributor

cdzombak commented Mar 7, 2016

This looks great, @davbeck. I've completed an initial review and some experimenting and I am ready to merge!

Will have a writeup on #63 shortly detailing what I've looked at and what next steps are for getting this into a release.

cdzombak added a commit that referenced this pull request Mar 7, 2016
@cdzombak cdzombak merged commit 2752f7d into nytimes:develop Mar 7, 2016
This was referenced Mar 7, 2016
cdzombak added a commit that referenced this pull request Mar 7, 2016
This implements @cxa's fix from #165 on top of the large project restructuring from #164 .

I've reproduced the issue and verfied this fix on an iOS 9 device.
cdzombak added a commit that referenced this pull request Mar 8, 2016
When we added Carthage support ( #164 ), we created two NYTPhotoViewer targets: the “normal” one which includes animated gif support (via `ANIMATED_GIF_SUPPORT=1`, and requires linking with FLAnimatedImage); and the “-Core” target which does not include animated GIF support.

For brevity I will refer to the library version with animated gif support as “-Normal” even though it doesn’t have that suffix (the “-Core” target _does_ have that suffix).

The unit tests are configured to run against the “-Normal” target, but they weren’t compiled with `ANIMATED_GIF_SUPPORT=1`, so we were running unit tests intended for “-Core” against the “-Normal” target. This resulted in some test failures.

I’ve fixed them by removing the `ANIMATED_GIF_SUPPORT` conditionals from the test target, leaving in the code that should be run against “-Normal”.

I am unsure whether it’s worth making a new “-Core” test target just to include the three assertions (removed in this commit) which were intended to apply to “-Core”. Feedback is welcome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants