Skip to content

Commit

Permalink
[Rakefile] Don't use platform=OS X for -destination option of `xc…
Browse files Browse the repository at this point in the history
…odebuild`

That can't be used on Xcode 8 (`platform=macOS` should be used instead). So removes `platform=` from `-destination` option and specifies `-sdk` option instead.
  • Loading branch information
ikesyo committed Jul 12, 2016
1 parent a14d0ef commit b4d2bb1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

desc 'Build an iOS scheme'
task :ios, [:scheme, :ios_version, :action] do |_,args|
destination = "platform=iOS Simulator,name=iPhone 5,OS=#{args.ios_version}"
build("OHHTTPStubs #{args.scheme}", destination, args.action)
destination = "name=iPhone 5,OS=#{args.ios_version}"
build("OHHTTPStubs #{args.scheme}", "iphonesimulator", destination, args.action)
end

desc 'Build an OSX scheme'
task :osx, [:scheme, :arch, :action] do |_,args|
destination = "platform=OS X,arch=#{args.arch}"
build("OHHTTPStubs #{args.scheme}", destination, args.action)
destination = "arch=#{args.arch}"
build("OHHTTPStubs #{args.scheme}", "macosx", destination, args.action)
end

desc 'Build a tvOS scheme'
task :tvos, [:scheme, :tvos_version, :action] do |_,args|
destination = "platform=tvOS Simulator,name=Apple TV 1080p,OS=#{args.tvos_version}"
build("OHHTTPStubs #{args.scheme}", destination, args.action)
destination = "name=Apple TV 1080p,OS=#{args.tvos_version}"
build("OHHTTPStubs #{args.scheme}", "appletvsimulator", destination, args.action)
end


Expand All @@ -37,10 +37,11 @@ end


# Build the xcodebuild command and run it
def build(scheme, destination, action)
def build(scheme, sdk, destination, action)
puts <<-ANNOUNCE
=============================
| Action: #{action}
| SDK : #{sdk}
| Scheme: "#{scheme}"
| #{destination}
=============================
Expand All @@ -51,6 +52,7 @@ def build(scheme, destination, action)
xcodebuild
-workspace OHHTTPStubs/OHHTTPStubs.xcworkspace
-scheme "#{scheme}"
-sdk #{sdk}
-configuration Debug
ONLY_ACTIVE_ARCH=NO
-destination '#{destination}'
Expand Down

0 comments on commit b4d2bb1

Please sign in to comment.