Ios 如何通过podspec配置Xcode项目的构建设置
我有一个使用插件开发的项目。所以,为了添加任何新功能,我们创建了新的插件,在开发和测试之后将其添加到主项目中。每个插件都有自己的podfile和podspec。因此,我想将quantumgraphpod添加到我的一个名为IGraphIntegrationPlugin的插件中 下面是我的GraphIntegrationPlugin的podspec:Ios 如何通过podspec配置Xcode项目的构建设置,ios,swift,cocoapods,podspec,build-settings,Ios,Swift,Cocoapods,Podspec,Build Settings,我有一个使用插件开发的项目。所以,为了添加任何新功能,我们创建了新的插件,在开发和测试之后将其添加到主项目中。每个插件都有自己的podfile和podspec。因此,我想将quantumgraphpod添加到我的一个名为IGraphIntegrationPlugin的插件中 下面是我的GraphIntegrationPlugin的podspec: Pod::Spec.new do |s| s.name = "GraphIntegrationPlugin" s.versi
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
编译包含此GraphIntegrationPlugin的主项目后,生成以下项目目录结构:
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
成功生成项目后,当我尝试将导入QGSdk添加到xyz.swift时,它抛出错误模块未找到。为了解决这个问题,我对GraphIntegrationPlugin的构建设置进行了以下手动更改
我需要对podspec做哪些更改,以便在我的Swift类GraphIntegrationPlugin中使用QGSdk.h头文件?我有这个链接,但它没有满足我创建podspec的要求。在podspec中尝试过将静态框架设置为true吗
s.static_framework = true
我将此设置用于相同的情况:
s.public_header_files = [
"MVVMRools/MVVMRools.h",
"MVVMRools/MVVMRools-Briging-Header.h",
"MVVMRools/Another.h"]
这个GraphIntegrationPlugin还需要以下框架。当我添加s.static_framework=true时,它不会添加到系统框架下面。s、 框架='UserNotifications','UIKit','Foundation','UserNotificationsUI'