CocoaPods/CocoaPods

Create modules for subspecs

Open

#8,413 opened on Jan 11, 2019

View on GitHub
 (1 comment) (7 reactions) (0 assignees)Ruby (2,685 forks)batch import
d2:moderatehelp wanteds7:workaround availablet1:enhancement

Repository metrics

Stars
 (14,815 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I'd like cocoapods to generate a modulemap when I use subspecs. I thought this was how it was done to match the concept of a submodule from modulemap. Is this possible or considerable?

For example (pseudocode):

Podspec:

Pod:: do |s|
    s.name = 'MyPod'
    s.modules = true  # <= potential configuration?
    s.subspec 'SubPodA' do |ss|
        ss.source_files = '...'
    end
    s.subspec 'SubPodB' do |ss|
        ss.source_files = '...'
    end
end

Then when I use pod 'MyPod' I'd like the resulting modules map to be:

framework module MyPod {
  module SubPodA { export ... }
  module SubPodB { export ... }
}

Then I can import in my project MyPod.SubPodA.

I imagine if someone uses pod 'MyPod/SubPodA' the the resulting modulemap would be normal:

framework module SubPodA {
    ...
}

Contributor guide