Skip to content

Instantly share code, notes, and snippets.

@huinme
Created December 21, 2013 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huinme/8067005 to your computer and use it in GitHub Desktop.
Save huinme/8067005 to your computer and use it in GitHub Desktop.
Cocoapodsをより使いこなすためのTips ref: http://qiita.com/huin/items/54b5a1778cec0bf44ad0
$ cd /path/to/MyLibrary
$ pod spec create MyLibrary
Pod::Spec.new do |s|
# s.versionで指定したバージョンを、s.sourceの :tag で呼び出すように書いておく.
s.version = "0.0.1"
s.source = { :git => "https://github.com/username/MyLibrary.git", :tag => "#{s.version}" }
end
pod 'MyLibrary', :git => 'https://github.com/username/MyLibrary.git', :tag => '0.0.1'
pod 'MyLibrary', :podspec => 'https://gist.github.com/username/abc...xyz/raw/abc...xyz/MyLibrary.podspec'
Pod::Spec.new do |s|
# zipファイルのURLと、`:flatten => true`を指定する.
s.source = { :http => "https://example.com/path/to/AnySDK.zip", :flatten => true }
# ヘッダーファイルを指定する.
s.source_files = 'AnySDK/**/*.h'
# コンパイル済みバイナリを指定する.
s.preserve_paths = 'AnySDK/**/*.a'
# ヘッダーパスを指定しておくとコード補完などしてくれて便利.
s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/AnySDK/**"' }
end
pod 'AnySDK', :podspec => './local/path/to/AnySDK.podspec'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment