gym/lib/gym/detect_values.rb in fastlane-2.60.0.beta.20170928010003 vs gym/lib/gym/detect_values.rb in fastlane-2.60.0.beta.20170929010003
- old
+ new
@@ -12,19 +12,18 @@
# Detect the project
FastlaneCore::Project.detect_projects(config)
Gym.project = FastlaneCore::Project.new(config)
- detect_selected_provisioning_profiles
-
# Go into the project's folder, as there might be a Gymfile there
Dir.chdir(File.expand_path("..", Gym.project.path)) do
config.load_configuration_file(Gym.gymfile_name)
end
detect_scheme
detect_platform # we can only do that *after* we have the scheme
+ detect_selected_provisioning_profiles # we can only do that *aftet* we have the platform
detect_configuration
detect_toolchain
config[:output_name] ||= Gym.project.app_name
@@ -35,25 +34,29 @@
def self.archive_path_from_local_xcode_preferences
day = Time.now.strftime("%F") # e.g. 2015-08-07
archive_path = File.expand_path("~/Library/Developer/Xcode/Archives/#{day}/")
- path = xcode_preference_plist_path
- return archive_path unless File.exist?(path.to_s) # this file only exists when you edit the Xcode preferences to set custom values
+ return archive_path unless has_xcode_preferences_plist?
- custom_archive_path = xcode_preferences_dictionary(path)['IDECustomDistributionArchivesLocation']
+ custom_archive_path = xcode_preferences_dictionary['IDECustomDistributionArchivesLocation']
return archive_path if custom_archive_path.to_s.length == 0
return File.join(custom_archive_path, day)
end
# Helper Methods
+ # this file only exists when you edit the Xcode preferences to set custom values
+ def self.has_xcode_preferences_plist?
+ File.exist?(xcode_preference_plist_path)
+ end
+
def self.xcode_preference_plist_path
File.expand_path("~/Library/Preferences/com.apple.dt.Xcode.plist")
end
- def self.xcode_preferences_dictionary(path)
+ def self.xcode_preferences_dictionary(path = xcode_preference_plist_path)
CFPropertyList.native_types(CFPropertyList::List.new(file: path).value)
end
# Since Xcode 9 you need to provide the explicit mapping of what provisioning profile to use for
# each target of your app