Skip to content

Instantly share code, notes, and snippets.

@inket
Created June 3, 2014 19:01
Show Gist options
  • Save inket/1af11364ccaa9632f1bc to your computer and use it in GitHub Desktop.
Save inket/1af11364ccaa9632f1bc to your computer and use it in GitHub Desktop.
Updates your Xcode plug-ins to make them load on Xcode 6.0 Beta (6A215l)
# Run this to make your plugins load on Xcode 6 Beta [Version 6.0 (6A215l)]
# - Does NOT insure that your installed plugins will run fine on the new version.
# - Alcatraz (the package manager) might update the plugins or reset them;
# In that case, you'll need to run this script again
new_uuid = "AD68E85B-441B-4301-B564-A45E4919A6AD"
plugins_path = Dir.home+"/Library/Application Support/Developer/Shared/Xcode/Plug-ins/"
unless Dir.exist?(plugins_path)
puts "Couldn't find Plug-ins directory."
exit
end
Dir.entries(plugins_path).each {
|plugin|
next if plugin.start_with?(".")
info_plist_path = plugins_path+plugin+"/Contents/Info.plist"
unless File.exist?(info_plist_path)
puts "Couldn't find Info.plist for Plug-in #{plugin}"
next
end
info_plist = nil
File.open(info_plist_path, "r") do |f| info_plist = f.read end
if info_plist.include?(new_uuid)
puts "Plug-in #{plugin} already up to date"
next
end
replacement = "\\0
<string>#{new_uuid}</string>"
info_plist.gsub!(/(DVTPlugInCompatibilityUUIDs.*?<array>)/im, replacement)
File.open(info_plist_path, "w") do |f| f.write(info_plist) end
puts "Updated plug-in #{plugin}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment