CocoaPods/CocoaPods

Create modules for subspecs

Offen

#8.413 geöffnet am 11.01.2019

 (1 Kommentar) (7 Reaktionen) (0 zugewiesene Personen)Ruby (2.685 Forks)batch import
d2:moderatehelp wanteds7:workaround availablet1:enhancement

Repository-Metriken

Stars
 (14.815 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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