Podspec链接二进制库 [英] Podspec Link Binary Library

查看:508
本文介绍了Podspec链接二进制库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为以下内容创建Podspec: https://github.com/sincerely/shiplib-ios-framework

I'm attempting to create a Podspec for: https://github.com/sincerely/shiplib-ios-framework

Pod Lint通过&文件正在添加到项目中,但它不链接二进制Sincerely文件。通过以下方式导入时,由于缺少文件,示例项目构建失败:< Sincerely / filename.h>

Pod Lint passes & the files are being added to the project but it does not link the binary "Sincerely" file. The sample project build fails due to missing files when importing via: <Sincerely/filename.h>

 Pod::Spec.new do |s|
  s.name  = 'ShipLib'
  s.version = '1.4'
  ...
  s.source = {
    :git => 'https://github.com/sincerely/shiplib-ios-framework.git',
    :tag => 's.version.to_s'
  } 
  s.library = 'Sincerely'
  s.source_files = 'Sincerely.framework','Sincerely.framework/Headers/*.h'
  s.resources = 'Sincerely.framework/Resources/*.{png,nib}'
  s.frameworks = 'AddressBook', 'AddressBookUI', 'SystemConfiguration', 'CoreTelephony'
  s.xcconfig  =   { 'LIBRARY_SEARCH_PATHS' =>  '$(PODS_ROOT)/ShipLib/' }
end

编辑:

Pod::Spec.new do |s|
  s.name  = 'ShipLib'
  s.version = '1.4'
  s.platform = :ios
  s.summary = 'Allow users to send printed photos from your app.'
  s.author = { 'Sincerely' => 'dev@sincerely.com' }
  s.homepage = 'https://github.com/sincerely/shiplib-ios-framework'
  s.license = { :file => 'LICENSE', :type => 'Commercial' }
  s.source = {
    :git => 'https://github.com/sincerely/shiplib-ios-framework.git',
    :tag => 's.version.to_s'
  }
  s.frameworks = 'AddressBook', 'AddressBookUI', 'SystemConfiguration', 'CoreTelephony'
  s.ios.vendored_frameworks = 'Sincerely.framework'
end


推荐答案

不会复制标题框架,不应指定为源文件。如果您要做的只是将框架添加为 vendored_framework 。这是 CP 0.23.0 中的新功能。

Headers will not be copied for frameworks, and should not be specified as source files. If all you are looking to do is add the framework as a vendored_framework. This is new in CP 0.23.0.

来自文档

  spec.ios.vendored_frameworks = 'Frameworks/MyFramework.framework'

编辑


删除有关 .framework 来自 s.source_files 。源文件只是文件,而不是框架。


Remove all the stuff about the .framework from s.source_files. Source files are just that, files, not frameworks.

这篇关于Podspec链接二进制库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆