Created
September 29, 2016 11:49
-
-
Save davidahouse/18dd78bef7ae543117c396f8c950ccfe to your computer and use it in GitHub Desktop.
Run the Swift 3 migrator for a project manually from the command line rather than letting Xcode do it
This file contains hidden or 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 'find' | |
require 'pp' | |
swift_file_paths = [] | |
Find.find('./') do |path| | |
if path =~ /.*\.swift$/ and !path.start_with? "./Carthage" | |
swift_file_paths << path | |
cmd = "xcrun swift-update -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -target arm64-apple-ios9 #{path} > convert.swift" | |
system cmd | |
cmd = "cp convert.swift #{path}" | |
system cmd | |
cmd = "rm convert.swift" | |
system cmd | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment