2017-01-05 12 views
1

:以下のように 'mypodspecfile.podspec':同じpodspecファイルのサブスペック 'B'からサブスペック 'A'への依存関係をどのように宣言できますか?私はpodspecに 'A' をsubspecするsubspec 'B' からの依存関係を宣言するための方法を見つけるためにしようとしています

Pod::Spec.new do |s| 
    s.name   = "MyLib-SDK" 
    s.version  = "1.0" 
    s.summary  = "My Library" 
    s.homepage  = "http://myhomepage.com" 

    s.ios.deployment_target = "8.0" 
    s.ios.frameworks = "Foundation", "UIKit", "SystemConfiguration", "Security", "CoreTelephony", "WebKit" 

    s.source  = { :git => "https://github.com/myhome/ios-project.git", :tag => "1.0" } 

    s.subspec 'MyLibrary-A' do |libOne| 
    libOne.source_files = "Headers", "Headers/**/*.h" 
    libOne.exclude_files = "Headers/Exclude" 
    libOne.resources = "SharedAssets/*" 

    libOne.libraries = "z","sqlite3" #Zlib for gzip, sqlite3 for event store 
    libOne.vendored_library = "libMyLibrary_A.a" 
    end 

    s.subspec 'MyLibrary-B' do |libTwo| 
    libTwo.source_files = "Headers", "Headers/**/*.h" 
    libTwo.exclude_files = "Headers/Exclude" 
    libTwo.resources = "SharedAssets/*" 
    libTwo.dependency 'MyLibrary-A' <-- doesn't seem to be working here!! 

    libTwo.libraries = "sqlite3" # sqlite3 for db 
    libTwo.vendored_library = "libMyLibrary_B.a" 
    end 

end 

私が実行した場合:

$pod spec lint mypodspecfile.podspec --verbose 

-ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for MyLibrary-A depended upon by MyLibrary-B 

ご協力いただければ幸いです。ありがとうございます!

+0

:https://github.com/CocoaPods/Specs/blob/master/Specs/0/3/5 /Firebase/3.11.0/Firebase.podspec.json? 'libTwo.dependency =" MyLib-SDK/MyLibrary-A "'またはそれに類するもの? – Larme

答えて

0

常に、ポッド依存関係の完全なパスを書き込む必要があります。このエラーは、ココアポッドがMyLibrary-Aのファイルを.podspecのポッドレポで見つけることができないことを示しています。問題を解決するには、フルパス'MyLib-SDK/MyLibrary-A'を指定してください。

だからあなたpodspecファイルは次のようになります。FireBaseと同じ操作を実行して、たぶん

Pod::Spec.new do |s| 
    s.name   = "MyLib-SDK" 
    s.version  = "1.0" 
    s.summary  = "My Library" 
    s.homepage  = "http://myhomepage.com" 

    s.ios.deployment_target = "8.0" 
    s.ios.frameworks = "Foundation", "UIKit", "SystemConfiguration", "Security", "CoreTelephony", "WebKit" 

    s.source = { :git => "https://github.com/myhome/ios-project.git", :tag => "#{s.version}" } 

    s.subspec 'MyLibrary-A' do |libOne| 
    libOne.source_files = "Headers", "Headers/**/*.h" 
    libOne.exclude_files = "Headers/Exclude" 
    libOne.resources = "SharedAssets/*" 

    libOne.libraries = "z","sqlite3" #Zlib for gzip, sqlite3 for event store 
    libOne.vendored_library = "libMyLibrary_A.a" 
    end 

    s.subspec 'MyLibrary-B' do |libTwo| 
    libTwo.source_files = "Headers", "Headers/**/*.h" 
    libTwo.exclude_files = "Headers/Exclude" 
    libTwo.resources = "SharedAssets/*" 
    libTwo.dependency 'MyLib-SDK/MyLibrary-A' # here is the change 

    libTwo.libraries = "sqlite3" # sqlite3 for db 
    libTwo.vendored_library = "libMyLibrary_B.a" 
    end 

end 
関連する問題