ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with
what info we expect.
Please remove this line and all above before submitting.
- [X] I've read and understood the *CONTRIBUTING guidelines and have done my best effort to follow.
Report
I have a pod that supports app extensions that partially uses precompiler flag to disable some of code. So to do that I created subspec with dependency on default subspec and modified flags. I see that CocoaPods creates two separate targets for the same library but I am not able to import header in extension. @import statement seems to work but I don't understand how to make it work the same way for both app and extension.
Using ss.ios.source_files directly instead of dependency in my pod spec does not seem to change anything..
ℹ Please replace this with what you did.
e.g. Run pod install
Expect that #import <Operative/Operative.h> should work just fine for both app and extension.
Compiler says it cannot import <Operative/Operative.h>. However @import works fine.
ℹ Please replace this with the output of pod env.
e.g. via pod env | pbcopy
Part of spec:
s.source_files = 'Pod/Classes/Operative.h'
s.default_subspec = 'Core'
s.subspec 'Core' do |ss|
ss.ios.source_files = 'Pod/Classes/{Core,iOS}/**/*'
ss.osx.source_files = 'Pod/Classes/{Core,OSX}/**/*'
end
s.subspec 'Extension' do |ss|
ss.platform = :ios
ss.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) OP_TARGET_IS_EXTENSION' }
ss.dependency 'Operative/Core'
end
Pod file:
target 'App' do
pod 'Operative', :git => 'https://github.com/pronebird/Operative', :branch => 'develop'
end
target 'Widget' do
pod 'Operative/Extension', :git => 'https://github.com/pronebird/Operative', :branch => 'develop'
end
ℹ Please link to a project we can download that reproduces the issue.
You can delete this section if your issue is unrelated to build problems,
i.e. it's only an issue with CocoaPods the tool.
See #5643 — since you'll end up with only one copy of your framework in the application bundle, this scenario will likely not work at runtime anyway and should probably raise an error.
@neonichu Can we somehow force cocoapods to build and bundle 2 differently named frameworks (one for extension and one for the main app, for example 'Operative-Main.framework', 'Operative-Extension.framework')
or this is architecturally wrong?
Thanks!
Most helpful comment
@neonichu Can we somehow force cocoapods to build and bundle 2 differently named frameworks (one for extension and one for the main app, for example 'Operative-Main.framework', 'Operative-Extension.framework')
or this is architecturally wrong?
Thanks!