2

I have project developed by using plugins. So to add any new feature we create new plugin add it to main project after develop and tested. Every plugin has its own podfile and podspec. So I want to add quantumgraph pod to one of my plugin that named I GraphIntegrationPlugin.

Below is my podspec of GraphIntegrationPlugin:

Pod::Spec.new do |s|

s.name             = "GraphIntegrationPlugin"
s.version          = '0.1.1'
s.summary          = "GraphIntegrationPlugin plugin.
                     DESC
s.homepage         = "https://abc:8fqTzT2v7UXAwu6RE6CV@bitbucket.org/GraphIntegrationPlugin-ios.git"
s.license          = 'MIT'
s.author           = { "Aabc dd” => “abc@gmail.com" }
s.source           = { :git => "https://abc:8fqTzT2v7UXAwu6RE6CV@bitbucket.org/GraphIntegrationPlugin-ios.git", :tag => s.version.to_s }

s.ios.deployment_target  = "10.0"
s.platform     = :ios, '10.0'
s.requires_arc = true
s.swift_version = '5.1'
s.frameworks = 'UserNotifications', 'UIKit', 'Foundation', 'UserNotificationsUI'
s.source_files = 'PluginClasses/**/*.{swift,h,m}'
s.resources = 'Resources/**/*.{storyboard,xib,xcassets,png,plist}'
s.public_header_files = 'Pods/**/**/*.h'

# Public frameworks
s.dependency 'quantumgraph'

 s.xcconfig = {
    'OTHER_LDFLAGS' => '-objc -ObjC',
    'OTHER_CFLAGS'  => '-fembed-bitcode',
    'ENABLE_BITCODE' => 'YES',
    'SWIFT_VERSION' => '5.1',
    'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
    'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}"/**',
    'LIBRARY_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}"/**',
    'HEADER_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}"/Headers/Public'
}


end

After compile main project including this GraphIntegrationPlugin generate following project directory structure:

MainProject:
 - support files
 - Resources
 - Classes, etc.
Pod:
- Pods
  --quantumgraph
  - iOS-sdk
    - QGSdk.h
    - QGInbox.h
    - Frameworks
      - libQGSdk.a
  - Support Files
    - quantumgraph.xcconfig
  --GraphIntegrationPlugin
   -xyz.swift
   -support files
    - GraphIntegrationPlugin.modulempa
    - GraphIntegrationPlugin.xcconfig
    - GraphIntegrationPlugin.dummy.m
    - GraphIntegrationPlugin-Info.plist
    - GraphIntegrationPlugin.prefix.pch
    - GraphIntegrationPlugin.umbrella.h

After successfully generate project when I try to add import QGSdk to xyz.swift it throws error module not found. to fix this I did following manual changes to build setting of GraphIntegrationPlugin.

  1. I added libQGSdk.a to Framework and linked libraries in General of GraphIntegrationPlugin Target.
  2. In GraphIntegrationPlugin.umbrella.h I added #import QGSdk.h
  3. I added QGSdk.h to GraphIntegrationPlugin target and Target Membership made it public.

After this, error disappears and I am able to access all methods and variable of QGSdk to my xyz.swift.

But unfortunately I can not push this manual changes of build setting to Git or our architecture does not support this. Hence all above three manual build setting changes I want to do through podspec. I tried every possible solution to write podspec in such a way that it should configure build settings of GraphIntegrationPlugin as per my expected way but unable to do this.

What changes I need to do to podspec so make QGSdk.h header available in my Swift classes of GraphIntegrationPlugin? I have this link with me BJ Homer but it did not fulfil my requirement of creating podspec.

halfer
  • 19,824
  • 17
  • 99
  • 186
iMash
  • 1,178
  • 1
  • 12
  • 33

1 Answers1

0

Has tried setting the static framework to true, in the Podspecs?

s.static_framework = true

I use this setting for the same situation:

s.public_header_files = [
"MVVMRools/MVVMRools.h",
"MVVMRools/MVVMRools-Briging-Header.h",
"MVVMRools/Another.h"]
Oscar Cardona
  • 46
  • 1
  • 5
  • This GraphIntegrationPlugin also need below frameworks. When I add s.static_framework = true then it doesn't add below system frameworks. s.frameworks = 'UserNotifications', 'UIKit', 'Foundation', 'UserNotificationsUI' – iMash Mar 14 '20 at 09:09