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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

galli-leo
Copy link

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
Copy link
Author

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
Copy link
Author

Bump

@joesus
Copy link
Contributor

joesus commented Sep 3, 2019

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

@johnfairh
Copy link
Collaborator

@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.

@joesus
Copy link
Contributor

joesus commented Sep 4, 2019

@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?

@johnfairh
Copy link
Collaborator

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

@kerrmarin-lvmh
Copy link

This would be great to have in jazzy

@realm realm deleted a comment Oct 29, 2021
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.

Pod subspecs are built (and documented) in addition to the main spec.
4 participants