Merge pull request 'use xcodes for Xcode version selection' (#14) from feature/xcode_version_selection_via_xcodes into master
Reviewed-on: #14
This commit is contained in:
commit
70c2899bf0
|
|
@ -160,25 +160,13 @@ private_lane :buildArchive do |options|
|
|||
lane_name = options[:lane_name]
|
||||
configuration = options[:configuration]
|
||||
xcodeproj_path = options[:xcodeproj_path]
|
||||
xcode_version = options[:xcodeVersion]
|
||||
|
||||
cmd = 'system_profiler -json SPDeveloperToolsDataType'
|
||||
cmd_result = `#{cmd}`
|
||||
spdeveloperToolsDataType = JSON.parse(cmd_result)['SPDeveloperToolsDataType']
|
||||
sortedSPDeveloperToolsDataType = spdeveloperToolsDataType.sort_by { |hash| hash['spdevtools_version'].split(' ').first.to_i } # sort by increasing the version of xcode
|
||||
default_xcode_version = sortedSPDeveloperToolsDataType.last['spdevtools_version'] # take the largest version in format: "13.0 (13A5212g)"
|
||||
default_xcode_version_number = default_xcode_version.split(' ').first # take version number
|
||||
xcodes(select_for_current_build_only: true)
|
||||
|
||||
if configuration != "AppStore" # AppStore uses xcconfig choosen in Xcode
|
||||
set_xcconfig_for_configuration_of_project(lane_name, configuration, xcodeproj_path)
|
||||
end
|
||||
|
||||
if xcode_version.nil?
|
||||
xcversion(version: default_xcode_version_number)
|
||||
else
|
||||
xcversion(version: xcode_version)
|
||||
end
|
||||
|
||||
gym(
|
||||
clean: true,
|
||||
workspace: options[:workspace],
|
||||
|
|
|
|||
Loading…
Reference in New Issue