Use the latest ObjectivePGP framework (v0.6.2)

This commit is contained in:
Yishi Lin 2017-08-12 15:12:33 +08:00
parent a4efe57db9
commit aa4ff7ce47
3 changed files with 122 additions and 167 deletions

41
Podfile
View file

@ -1,45 +1,8 @@
platform :ios, '10.2'
def generate_modulemap(name, path)
f = File.new(File.join("#{path}/module.modulemap"), "w+")
module_name = "#{name}"
while(module_name["+"])
module_name["+"] = "_"
end
f.puts("module #{module_name} {")
f.puts(" umbrella header \"#{name}_umbrella.h\"")
f.puts(" export *")
f.puts("}")
end
def generate_umbrella(name, path)
f = File.new(File.join("#{path}/#{name}_umbrella.h"), "w+")
f.puts("#import <Foundation/Foundation.h>")
Dir.chdir(path) {
Dir.glob("**/*.h").map {
|filename| f.puts("#import \"#{filename}\"")
}
}
end
post_install do |installer|
require "fileutils"
headers_path = "#{Dir::pwd}/Pods/Headers/Public/"
installer.pods_project.targets.each do |target|
target_header_path = "#{headers_path}#{target.product_name}"
if File.exist?(target_header_path)
filename = target.product_name
if filename != "." and filename != ".."
generate_umbrella(filename, target_header_path)
generate_modulemap(filename, target_header_path)
end
end
end
end
use_frameworks!
target 'passKit' do
pod 'ObjectivePGP', :git => 'https://github.com/mssun/ObjectivePGP.git'
pod 'ObjectivePGP', :git => 'https://github.com/krzyzanowskim/ObjectivePGP.git'
target 'pass' do
inherit! :search_paths
end