Created
June 30, 2016 11:48
-
-
Save azimin/84c574ab8d49947bc0d1db828ee691da to your computer and use it in GitHub Desktop.
Autosign podfile
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
developer_info = { | |
"DevelopmentTeam" => "5-------S4", | |
"DevelopmentTeamName" => "Alexander Zimin" | |
} | |
post_install do |installer| | |
path = installer.pods_project.path | |
pbxproj_path = path + 'project.pbxproj' | |
unless File.exist?(pbxproj_path) | |
puts "Pods.xcodeproj wasn't before, please run `pod update`/`pod install` again".red | |
next | |
end | |
plist = Xcodeproj::Plist.read_from_path(pbxproj_path.to_s) | |
root_object_string = plist["rootObject"] | |
targets = plist["objects"][root_object_string]["targets"] | |
developer_info_dic = Hash.new(targets.size()) | |
targets.each do |target_name| | |
developer_info_dic[target_name] = developer_info | |
end | |
installer.pods_project.root_object.attributes["TargetAttributes"] = developer_info_dic | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment