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

Add pod subspec for 'IGListKit/Diffing' #365

Closed
jessesquires opened this issue Dec 23, 2016 · 15 comments
Closed

Add pod subspec for 'IGListKit/Diffing' #365

jessesquires opened this issue Dec 23, 2016 · 15 comments

Comments

@jessesquires
Copy link
Contributor

See discussion here:

4e42712#commitcomment-20243693

@jessesquires
Copy link
Contributor Author

cc @Sherlouk 😄

@Sherlouk
Copy link
Contributor

@jessesquires

Aye yeah sorry was meant to update on this - had it working all the way up until the #imports which @rnystrom stressed he didn't want changing. Unfortunately any iOS usage expects all the relevant files like IGListAdapter.h, we'd need to do something a bit more clever than "if iOS import full IGListKit".

Suggestions?

@jessesquires
Copy link
Contributor Author

Ah sorry, I missed some of that.

I don't have much experience with subspecs. Here's the final behavior that I would want:

  1. The existing behavior, no changes
  2. Add the option for 'IGListKit/Diffing', where if specified, you only get diffing (i.e., exactly what the macOS target is now.)

Is that possible? Do we have to have this other "IGListKit/CollectionView" spec?

@Sherlouk
Copy link
Contributor

Sherlouk commented Dec 23, 2016

So that's exactly what I'm aiming for, but if you have the IGListKit/Diffing spec that will contain only the files pertinent for diffing to work (the ones in the common folder) but the bridging header has imports for all the files if the OS is iOS (Regardless of the subspec they use).

So if they use just the Diffing subspec, then certain files will be missing and thus won't build.

https://github.com/Instagram/IGListKit/blob/master/Source/Common/IGListKit.h (Noting the if statement checking for iOS)

@jessesquires
Copy link
Contributor Author

Ahh I see... 🤔

@Sherlouk
Copy link
Contributor

Just had a nosey at SDWebImage's Podspec file and they add 'SD_WEBP=1' to the preprocessor and then can, seemingly, access that directly in their header file.

We could do something similar, but otherwise I'm without idea how to achieve the desired effect!

@jessesquires
Copy link
Contributor Author

@Sherlouk Ah interesting! (I'm sure CP allows for this kind of thing. Maybe this is how.)

What if we have a "common" umbrella header, IGListDiffKit.h. So then the main IGListKit.h umbrella header wouldn't be included in the subspec... ?

@Sherlouk
Copy link
Contributor

@jessesquires Allow me to ensure we're on the same page:

Having two header files:

  • IGListDiffKit.h which imports all the Common files
  • IGListKit.h which imports IGListDiffKit.h and all the other files

If you use IGListKit/Diffing (in your Podfile) then you have to use IGListDiffKit.h
If you use IGListKit (in your Podfile) then you have to use IGListKit.h

@jessesquires
Copy link
Contributor Author

@Sherlouk - Exactly 😄 Is that possible? 🤔

@Sherlouk
Copy link
Contributor

@jessesquires - Will try and get it working tomorrow, and will also update README.md/relevant guides with info on how it works!

Does sound like it would work, in theory. But we all know theory goes out the window when we're talking about all of this. 😂

@jessesquires
Copy link
Contributor Author

Sounds good! I think a new guide in Guides/ would be awesome 👍 Great idea.

@rnystrom
Copy link
Contributor

@Sherlouk I should clarify too, if we can find a way to make 2 specs, IGListDiffKit and IGListKit, where the latter depends on the former, then we could play w/ the imports. I'll just have to patch + build internally before we land to make sure that CP and Buck specs play nicely together.

In fact that might even solve collisions when one library imports IGListDiffKit and another uses IGListKit, but some app uses both libs.

So IGListAdapterUpdater.h could have imports like

#import <IGListDiffKit/IGListDiff.h>

(sorry if I threw another wrench into things)

@Sherlouk
Copy link
Contributor

@rnystrom I think I understand where you're coming from!

I'm going to play around a little with it this morning and will see what actually works - will create a PR and can see whether the solution needs changing to work internally!

@Sherlouk Sherlouk mentioned this issue Dec 24, 2016
6 tasks
@jessesquires jessesquires added this to the 2.1.0 milestone Dec 24, 2016
@Sherlouk
Copy link
Contributor

@jessesquires Flagging for closure

@jessesquires
Copy link
Contributor Author

done in #368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants