lib/gym/detect_values.rb in gym-0.3.4 vs lib/gym/detect_values.rb in gym-0.4.0
- old
+ new
@@ -15,10 +15,11 @@
if config[:workspace].to_s.length == 0 and config[:project].to_s.length == 0
raise "No project/workspace found in the current directory.".red
end
Gym.project = Project.new(config)
+ detect_platform
detect_provisioning_profile
# Go into the project's folder
Dir.chdir(File.expand_path("..", Gym.project.path)) do
config.load_configuration_file(Gym.gymfile_name)
@@ -121,9 +122,17 @@
config[:scheme] = choose(*(proj_schemes))
end
else
raise "Couldn't find any schemes in this project".red
end
+ end
+
+ # Is it an iOS device or a Mac?
+ def self.detect_platform
+ return if Gym.config[:destination]
+ platform = Gym.project.build_settings("PLATFORM_DISPLAY_NAME") # either `iOS` or `OS X`
+
+ Gym.config[:destination] = "generic/platform=#{platform}"
end
# Detects the available configurations (e.g. Debug, Release)
def self.detect_configuration
config = Gym.config