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

Pod subspecs are built (and documented) in addition to the main spec. #981

Open
galli-leo opened this issue Jun 15, 2018 · 6 comments · May be fixed by #997
Open

Pod subspecs are built (and documented) in addition to the main spec. #981

galli-leo opened this issue Jun 15, 2018 · 6 comments · May be fixed by #997

Comments

@galli-leo
Copy link

When one tries to run jazzy with a podspec that has multiple subspecs, jazzy will document all of them. This not only causes a lot of unnecessary compilation, but also get's jazzy confused, since a lot of symbols are defined multiple times.

Fix should be pretty simple here:

targets = installer.pod_targets
.select { |pt| pt.pod_name == podspec.root.name }
.map(&:label)

Before I am opening a pr, should this be a new config option? If yes, where would I add those? (The first time I have worked with ruby, so assistance is appreciated).

I think something like: --subspecs Subspec and only include those targets.

Also I noticed that my own podspec creates some target with a weird label:

#<Pod::PodTarget:0x00007f908dcb9e70>
Pod-b2cd66da
Pod
#<Pod::PodTarget:0x00007f908dcb9808>
Pod-SocketServer
Pod
#<Pod::PodTarget:0x00007f908dcb92b8>
Pod-Image
Pod

Above was created by adding the following code:

installer.pod_targets.map do |t|
            warn t
            warn t.label
            warn t.pod_name
end
@probot-label-groups
Copy link

This is an automated message
It looks like more than one label assigned to this issue belongs to the same group:
Please remove the appropriate labels

@segiddins
Copy link
Collaborator

This was the intentional behavior when I added CocoaPods support years ago

@galli-leo
Copy link
Author

@segiddins But this just increases the time for docs generation (and creates a lot of warnings). Is there a benefit?

@johnfairh
Copy link
Collaborator

johnfairh commented Jun 16, 2018

It's to handle the modularization subspec use case, where subspecs contain unique source files. See Moya for an example. If we wanted to offer some kind of configurability here -- I use cocoa pods very naively, Sam is the expert -- then I think the default would be 'all subspecs' to maintain the current behavior. A --subspecs option could go into config.rb.

@galli-leo
Copy link
Author

galli-leo commented Jun 16, 2018

@johnfairh That‘s the exact use case where I ran into the problem. The issue is that cocoapods highly recommends that the root podspec already includes all subspecs (i.e. You need to explicitly set which one‘s you do not want in your root spec). But jazzy creates documentation for all subspecs as well, although they are already included in the root spec.

@ronanociosoig
Copy link

I am having the same issue. The project I am working on has a base subspec and 8 others. This means that the symbols are found 9 times. The log for the generation prints "Found conflicting type declarations with the same name, which may indicate a build issue or a bug in Jazzy: .... " for each method and class.

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