Texture icon indicating copy to clipboard operation
Texture copied to clipboard

Added SPM support

Open 3a4oT opened this issue 5 years ago • 31 comments

  • implemented SPM layout generator swift scripts/generate_spm_sources_layout.swift which use symlinks technics.

  • introduced the AsyncDisplayKitIGListKit library which is an umbrella for IG+Texture. To deal with SPM restrictions I did some kind of hack:)) I've symlinked the spm/Sources/AsyncDisplayKit (generated by a script) and created the AsyncDisplayKitIGListKit folder. It should be available ONLY for Package.swift. (TODO: upstream changes to Instagram)

  • refactored #include by dropping AsyncDisplayKit/

  • added a small tweak to be able to assemble for macCatalyst via SPM

  • Xcode 12 required (SPM only)

  • added sh build.sh build_listkit_xcode_spm_integration to the build pipeline which can verify Xcode's SPM integration.

  • added CI steps to check SPM based BUILDS for iOS, tvOS, macCatalyst.

depends on https://github.com/pinterest/PINRemoteImage/pull/586

  • [x] experiment with IGListKit support and try to upstream changes to https://github.com/Instagram/IGListKit/pull/1487
  • [ ] Update PINRemoteImage dependency and point it to official repository instead of fork
  • [x] Figure out how to add the possibility for testing this integration.

3a4oT avatar Oct 06 '20 23:10 3a4oT

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 06 '20 23:10 CLAassistant

Still need to figure out how to test it

3a4oT avatar Oct 07 '20 14:10 3a4oT

any updates on this PR?

freemansion avatar Nov 16 '20 13:11 freemansion

last commits should repair Xcode's SPM integration!

3a4oT avatar Nov 17 '20 19:11 3a4oT

Confirming, it compiles and works fine in my project. Let's get merge it.

freemansion avatar Nov 18 '20 06:11 freemansion

Great job guys! Working for me!

NoliNik avatar Nov 18 '20 08:11 NoliNik

For some reason I still can't access ASPINRemoteImageDownloader despite AS_PIN_REMOTE_IMAGE being defined in Package.swift. Is there something I'm missing?

xezero avatar Nov 21 '20 01:11 xezero

Hi, @3a4oT I tried using AsyncDisplayKitIGListKit from your fork on Xcode 12.2. Unfortunately I am getting the following errors

  1. on IGListKitUpdatingDelegate.h file: -

IGListUpdatingDelegate' has different definitions in different modules; first difference is definition in module 'IGListKit' found method 'performUpdateWithCollectionViewBlock:fromObjects:toObjectsBlock:animated:objectTransitionBlock:completion:' with 1st parameter of type 'IGListCollectionViewBlock _Nonnull __strong' (aka 'UICollectionView * _Nullable (^__strong)(void)')

Screen Shot 2020-11-23 at 12 24 54 PM

  1. Also similar error on IGListAdapter.h file Screen Shot 2020-11-23 at 12 47 07 PM

based on the error messages it seems like there is a namespace conflicts (I searched related issues, where the work around is renaming one of the module classname/function etc.. and this issue happens in Xcode 12, even though things worked well on Xcode 11. Are you also using Xcode 12.2 on your current working version?

MussaCharles avatar Nov 23 '20 04:11 MussaCharles

@MussaCharles thanks for the detailed feedback. Should be OK now. I've added the sample project (examples/ASIGListKitSPM/) which should verify that it won't break again. Would you mind giving it another shot?

@xezero PINRemoteImage should be available now :) so you can access ASPINRemoteImageDownloader.

3a4oT avatar Dec 02 '20 00:12 3a4oT

@3a4oT Wow, great work on figuring those headers out! Looks intense 😅

xezero avatar Dec 02 '20 02:12 xezero

@MussaCharles thanks for the detailed feedback. Should be OK now. I've added the sample project (examples/ASIGListKitSPM/) which should verify that it won't break again. Would you mind giving it another shot?

@xezero PINRemoteImage should be available now :) so you can access ASPINRemoteImageDownloader.

@3a4oT Thanks for the updates, I will give it another shot later today or tomorrow and get back to you.

MussaCharles avatar Dec 02 '20 03:12 MussaCharles

Hi everyone! Is there any updates? I noticed that only Carthage build is not successful. This may be caused by that issue. Please check it out!

iosg1sw avatar Dec 11 '20 15:12 iosg1sw

@MussaCharles Today I've integrated into another codebase which was using Carthage. I faced the same errors as you reported, to resolve issues make sure you delete any cached pods or Carthage artifacts (.framework) from your project. settings.

3a4oT avatar Dec 13 '20 20:12 3a4oT

@MussaCharles Today I've integrated into another codebase which was using Carthage. I faced the same errors as you reported, to resolve issues make sure you delete any cached pods or Carthage artifacts (.framework) from your project. settings.

Hi, @3a4oT Okay, I will double check to see if it was caused by the same files. Also Sorry for the late. I was a bit occupied with work so I didn't get some time to test your last changes. I will have a look again soon and get back to you. Happy Coding!!

MussaCharles avatar Dec 14 '20 02:12 MussaCharles

Just wondering what the status is on this currently. I've had to do quite a few of these integrations, would be more than happy to jump in.

that-scalcucci-guy avatar Feb 17 '21 17:02 that-scalcucci-guy

Thank you for putting in all this work!

I would like to avoid using a fork if possible on IGListKit… And since SPM currently doesn’t support running scripts there’s probably no way to add the spm directory to .gitignore is there? I wonder if we could use https://github.com/apple/swift-evolution/blob/main/proposals/0303-swiftpm-extensible-build-tools.md ?

garrettmoon avatar Mar 11 '21 18:03 garrettmoon

Any update to this? 🙏

rogerluan avatar Jun 10 '21 22:06 rogerluan

Updates please?!

grangej avatar Jun 16 '21 14:06 grangej

Just an small update:

  • So I was manage to upstream my SPM changes to Instagram. (https://github.com/Instagram/IGListKit/pull/1487). This mean that technically we can drop my fork from the dependencies. However, this may be tricky since IGListKit on current master doesn't work well with Texture. More investigation required.

  • I'm waiting until SE-0303 will be available (probably Swift 5.6) to continue my work and implement code generation as a plugin.

3a4oT avatar Sep 09 '21 20:09 3a4oT

I'm waiting until SE-0303 will be available (probably Swift 5.6) to continue my work and implement code generation as a plugin.

Hai @3a4oT it's available now in Xcode 13.3 beta, perhaps you can continue this MR if you're available, thanks in advance 🙏

annomusa avatar Jan 31 '22 05:01 annomusa

Any updates please? 😥

dehrom avatar Mar 11 '22 10:03 dehrom

As you may know, my country (Ukraine) was attacked by russian invaders, I'm on military service now and don't have time at the moment to support this fork. Invaders Must Die!

3a4oT avatar Mar 11 '22 10:03 3a4oT

Please, don't mess up P. and russians...

So, on my fork SPM is working, if you need that

Package.swift example: https://github.com/nickaroot/TextureUI/blob/master/Package.swift

nickaroot avatar Mar 11 '22 10:03 nickaroot

Слава Украине! Героям слава! 🇺🇦

bejeri4 avatar Mar 16 '22 15:03 bejeri4

What other tasks do we have to accomplish this PR? I might help

muukii avatar Jun 30 '22 17:06 muukii

please merge - need SPM integration urgently.

wweevv-johndpope avatar Aug 29 '22 05:08 wweevv-johndpope

and I found a situation that break-points are not working when installed as swift-package. I filed it on FB11418698

muukii avatar Aug 31 '22 13:08 muukii

Hey all. No commitments, but I did some work this morning to synchronize the latest IGListKit and Texture. For now, it will live under my fork branch - https://github.com/3a4oT/Texture/pull/1. In a time of my absence, Xcode 14.3 arrives, which add one more challenge to make it work. We need to land new versions of PINOperation, PINRemoteImage, PINCache to be compatible with Xcode 14.3. Also, we need to make Instagram finally tag a new release on GitHub. For PIN-related repositories I saw that community started to submit PRs, but it seems like there are no active maintainers. For Instagram related task, I started a conversation . If you want to contribute and don't know how, please leave a comment/issue on those repositories so you may be heard.

3a4oT avatar Aug 05 '23 15:08 3a4oT

Apologies that this has sat for so long. I have a couple questions about this PR.

Why did you change all of the imports? Is this required for Package.swift to work? If it isn't required, splitting up these diffs would make it much easier for us to move forward with landing.

Is the "hack" for AsyncDisplayKitIGListKit still required? I see that IGListKit has a Package.swift file. Is it possible to use this instead?

rcancro avatar Sep 26 '23 17:09 rcancro