spotify / XCRemoteCache

Other
825 stars 50 forks source link

Support for Cocoapods's generate_multiple_pod_projects feature #155

Closed CharlieSuP1 closed 1 year ago

CharlieSuP1 commented 2 years ago

Great remote cache project, and seems to work very in my Demo project, very promising!Thx a lot!

But when I try to integrate XCRemoteCache in my company's non-trivial project,I got very low cache hit rate.

After investigation, I found that cocoapods-xcremotecache plugin seems do not support Cocoapod's generate_multiple_pod_projects feature. Any cocoapods project(not target) do not have a XC** build phase.

And I looked into the code base, found there are actually efforts to support generate_multiple_pod_projects:

image

So I want to ask is there any progress in supporting generate_multiple_pod_projects? Or are PRS related with generate_multiple_pod_projects welcome?

polac24 commented 2 years ago

That is fully supported, added in #57 by @vasvf (with further improvements).

I have just double-checked the sample Podfile we use in the E2E tests, and the project correctly adds [XCRC] Build phases. Sample project's target:

Screenshot 2022-07-07 at 18 46 31
CharlieSuP1 commented 1 year ago

Thx for reply!

I found the reason is that the feature Cocoapods' feature incremental_installation is also on. So the pod projects are not generated agin, thus no build phase inserted.

In our project install!('cocoapods', incremental_installation: true, generate_multiple_pod_projects: true)

I am not sure whether there is any way to insert XCR build phases with incremental_installation being true.

Thx again

polac24 commented 1 year ago

That happens because you generated all Pod's .xcodeprojs before integrating with XCRemoteCache and cocoapods does not generate them anymore, even it should.

I think you have 2 workarounds to force pods project regeneration:

polac24 commented 1 year ago

The ^ PR should fix that problem.

In the meantime, you can call pod install --clean-install if Pod's project/target misses [XCRC] integration build steps.

CharlieSuP1 commented 1 year ago

thx a lot