2016-05-23 68 views
0

我想解决如何添加头文件到特定的Podspec。我现在必须手动将文件拖放到Xcode的Pod组中以使其生成。否则,它会抱怨它找不到头文件。我想从构建过程中走出这一步。我仍然在学习在Cocoapods中声明依赖关系的细节。添加头文件到Podspec

的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 <[email protected]>' 
    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 

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

回答

1

试试这在你的subspec。

ss.public_header_files = 'Extras/CBLRegisterJSViewCompiler.h' 

Link back to CocoaPods reference

+0

这没有奏效 - 我正在等待对couchbase-lite-ios软件包的建议更改,该软件包默认包含库的该部分。 – Adamski