jazzy icon indicating copy to clipboard operation
jazzy copied to clipboard

Minimize the amount of specs being built by jazzy and improve checking which targets to build.

Open galli-leo opened this issue 6 years ago • 7 comments

This PR aims to improve jazzy's podspec integration in a few ways:

  1. Jazzy will try to build specs as few times as possible. By keeping track of what specs are already built by previous targets, it can skip targets that only include specs of other targets (Mostly subspecs). If there are subspecs that have a dependency on other subspecs, this can still lead to jazzy running for a spec multiple times. However, that should be relatively rare and only happen when the default_subspecs are set.
  2. Instead of checking the pod_name of a target and seeing if it matches, jazzy will take the first spec of a target and see whether the root of that target is the root of the podspec.

Let me know, if and where to add some tests for this as well as whether I should add a config option to only document certain subspecs.

Also should I refactor this? Rubocop complains that the method is too long.

Fixes #981

galli-leo avatar Jul 29 '18 14:07 galli-leo

I just found an even better way of fixing this:

Instead of creating a target for every subspec and platform, we create a single target for each platform including all subspecs. This way, jazzy only has to run one xcodebuild per platform.

At the moment, I have left in the earlier code change. Let me know, if I should remove that and have jazzy run for every platform.

galli-leo avatar Jul 29 '18 14:07 galli-leo

Bump

galli-leo avatar Aug 07 '18 20:08 galli-leo

Is this still active? This would be useful to me.

joesus avatar Sep 03 '19 17:09 joesus

@joesus i think this is becalmed because none of the active maintainers are confident enough about the cocoapods internals to understand whether we really need a fix here, whether this is the right one, and what the implications are for existing users.

johnfairh avatar Sep 04 '19 15:09 johnfairh

@johnfairh that makes sense. I'm working on a combined Swift/ObjC project and still struggling to figure out the best approach for merging the documentation. The best I can come up with is to either a) Use sourcekitten directly for each language and then try to run jazzy directly against the files b) Use jazzy to generate both and write a script to merge the files and use something like XSLT to combine the html.

In your opinion do you think option a will work or should I not waste time and start in on the more onerous option b?

joesus avatar Sep 04 '19 16:09 joesus

Probably (b) -- jazzy has an all-or-nothing approach to ObjC/Swift, more discussion in #447.

johnfairh avatar Sep 04 '19 16:09 johnfairh

This would be great to have in jazzy

kerrmarin-lvmh avatar May 11 '21 10:05 kerrmarin-lvmh