我正在使用cocoapods 1.2.1
我做了这个podspec:
if (jQuery.isEmptyObject(data.divostar)){
html_result = "<p id='report'>No report yet</p>";
$('#no_report_table').html(html_result).fadeIn('fast');
}
此ALMOST有效,但在某些文件中有一个:
Pod::Spec.new do |s|
s.name = "SignalLib"
s.version = "2.3.1"
s.summary = "Signal Protocol Pod."
s.description = <<-DESC
This allows an iOS project to retrieve and configure the Signal C implementation
https://github.com/WhisperSystems/libsignal-protocol-c
DESC
s.homepage = "http://www.pangea.com"
s.license = { :type => 'GPLv3', :text => <<-LICENSE
Copyright 2015-2016 Open Whisper Systems
Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html
Additional Permissions For Submission to Apple App Store: Provided that you are otherwise in compliance with the GPLv3 for each covered work you convey (including without limitation making the Corresponding Source available in compliance with Section 6 of the GPLv3), Open Whisper Systems also grants you the additional permission to convey through the Apple App Store non-source executable versions of the Program as incorporated into each applicable covered work as Executable Versions only under the Mozilla Public License version 2.0 (https://www.mozilla.org/en-US/MPL/2.0/).
LICENSE
}
s.author = { "XXX" => "XXX@XXX.com" }
s.osx.deployment_target = '10.9'
s.ios.deployment_target = '8.0'
s.source = { :git => "https://github.com/WhisperSystems/libsignal-protocol-c.git",
:tag => 'v' + s.version.to_s}
s.header_mappings_dir = 'src'
s.source_files = ["src/**/*.{h,c}"]
s.exclude_files = 'src/curve25519/ed25519/main'
s.public_header_files = ["src/signal_protocol.h", "src/signal_protocol_internal.h", "src/LocalStorageProtocol.pb-c.h", "src/signal_protocol_types.h", "src/curve.h", "src/hkdf.h", "src/ratchet.h", "src/protocol.h", "src/session_state.h", "src/session_record.h", "src/session_pre_key.h", "src/session_builder.h", "src/session_cipher.h", "src/key_helper.h", "src/sender_key.h", "src/sender_key_state.h", "src/sender_key_record.h", "src/group_session_builder.h", "src/group_cipher.h", "src/fingerprint.h"]
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(PODS_ROOT)/SignalLib/src $(PODS_ROOT)/SignalLib/src/curve25519 $(PODS_ROOT)/SignalLib/src/curve25519/ed25519', 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' }
#s.preserve_paths = 'src'
s.subspec 'protobuf-c' do |ss|
ss.source_files = 'src/protobuf-c/protobuf-c.h', 'src/protobuf-c'
ss.public_header_files = 'src/protobuf-c/protobuf-c.h'
#ss.preserve_paths = 'src/protobuf-c'
ss.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(PODS_ROOT)/SignalLib/src/protobuf-c' }
#ss.frameworks = 'frameworks'
end
end
当Xcode尝试编译它时失败了。 原因是,即使我创建一个子规格应该包含文件protobuf-c.h,该文件也不在subspec文件夹中。
我尝试使用
#import <protobuf-c/protobuf-c.h>
但那也失败了。它实际上更糟糕,因为s.public_header_files甚至不再工作,只有我的伞头被公开。