From ec07ec3758d364a830f87f6c3ce4af089a36f9fa Mon Sep 17 00:00:00 2001 From: Alex Kiritsa Date: Wed, 29 Dec 2021 16:38:39 +0200 Subject: [PATCH] Fix increment_build_number_in_xcodeproj --- .../actions/increment_build_number_in_xcodeproj.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/versioning/actions/increment_build_number_in_xcodeproj.rb b/lib/fastlane/plugin/versioning/actions/increment_build_number_in_xcodeproj.rb index dc1089e..b94a8b3 100644 --- a/lib/fastlane/plugin/versioning/actions/increment_build_number_in_xcodeproj.rb +++ b/lib/fastlane/plugin/versioning/actions/increment_build_number_in_xcodeproj.rb @@ -59,10 +59,16 @@ def self.set_build_number_using_target(params, next_build_number) target = project.targets[0] if target.nil? end - target.build_configurations.each do |config| + if params[:build_configuration_name] + config = target.build_configurations.detect { |c| c.name == params[:build_configuration_name]} + UI.message "updating #{config.name} to build #{next_build_number}" + config.build_settings["CURRENT_PROJECT_VERSION"] = next_build_number + else + target.build_configurations.each do |config| UI.message "updating #{config.name} to build #{next_build_number}" config.build_settings["CURRENT_PROJECT_VERSION"] = next_build_number end unless target.nil? + end project.save end