gpt4 book ai didi

ios - 将头文件添加到 Podspec

转载 作者:行者123 更新时间:2023-11-29 00:58:07 27 4
gpt4 key购买 nike

我正在尝试研究如何将头文件添加到特定的 Podspec。我目前必须手动将文件拖到 Xcode 中的 Pod 组中才能构建它。否则它会提示找不到头文件。我想把这一步从构建过程中去掉。我仍在学习在 Cocoapods 中声明依赖项的来龙去脉。

Podspec如下:

Pod::Spec.new do |s|
s.name = 'ReactNativeCouchbaseLite'
s.version = '0.3.0'
s.summary = 'couchbase lite binding for react-native'
s.license = 'MIT'
s.platform = :ios, '7.0'
s.requires_arc = true
s.authors = 'Fraser Xu <xvfeng123@gmail.com>'
s.homepage = 'https://github.com/fraserxu/react-native-couchbase-lite.git'
s.source = { :git => 'https://github.com/fraserxu/react-native-couchbase-lite.git' }
s.source_files = 'ios/**/*.{h,m}'
s.dependency 'couchbase-lite-ios'
s.dependency 'couchbase-lite-ios/Listener'

# Current attempt to add the header file
s.subspec 'CBLRegisterJSViewCompiler' do |ss|
ss.source_files = 'Extras/CBLRegisterJSViewCompiler.h'
ss.preserve_paths = 'CouchbaseLite.framework'
ss.vendored_frameworks = 'CouchbaseLite.framework'
ss.dependency 'couchbase-lite-ios'
end
end

我需要添加的 header 是 CBLRegisterJSViewCompiler.h。在 couchbase-lite-ios 的发布下载中,此 header 出现在 Extras 文件夹中。

最佳答案

在您的子规范中尝试此操作。

ss.public_header_files = 'Extras/CBLRegisterJSViewCompiler.h'

Link back to CocoaPods reference .

关于ios - 将头文件添加到 Podspec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37401708/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com