Last active
December 19, 2015 15:09
-
-
Save orta/5974581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cocoapods-downloader' | |
require 'cocoapods-core' | |
require 'cocoapods' | |
$active_folder = "active" | |
@download_location = $active_folder + "/download/#{spec.name}/#{spec.version}/#{spec.name}" | |
@spec = Pod::Spec.new do |s| | |
s.name = "MSActiveConfig" | |
s.version = "1.0.1" | |
s.summary = "Remote configuration and A/B Testing framework for iOS." | |
s.homepage = "https://github.com/mindsnacks/MSActiveConfig" | |
s.license = { :type => 'MIT', :file => 'LICENSE' } | |
s.author = { "Javier Soto" => "[email protected]" } | |
s.source = { :git => "https://github.com/mindsnacks/MSActiveConfig.git", :tag => "v1.0.1" } | |
s.platform = :ios, '6.0' | |
s.source_files = 'MSActiveConfig/Classes/*.{h,m}' | |
s.private_header_files = 'MSActiveConfig/Classes/*+Private.h' | |
s.requires_arc = true | |
end | |
# download | |
downloader = Pod::Downloader.for_target(@download_location, @spec.source) | |
downloader.cache_root = @cache_path | |
downloader.download | |
# extract headers from sandbox'd download files | |
download_location = $active_folder + "/download/#{@spec.name}/#{@spec.version}/#{@spec.name}" | |
pathlist = Pod::Sandbox::PathList.new( Pathname.new(download_location) ) | |
headers = [] | |
[@spec, *@spec.subspecs].each do |internal_spec| | |
if internal_spec.attributes_hash["source_files"] | |
internal_spec.available_platforms.each do |platform| | |
consumer = Pod::Specification::Consumer.new(internal_spec, platform) | |
accessor = Pod::Sandbox::FileAccessor.new(pathlist, consumer) | |
headers += accessor.public_headers.map{ |filepath| filepath.to_s } | |
end | |
else | |
puts "Skipping headers for #{internal_spec}".blue | |
end | |
end | |
p headers.uniq |
You get a free wine-glass from me at NSSpain.
Or maybe I'll ask Danger to bring something british over next week.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍 aceness