Created
October 14, 2019 10:22
-
-
Save ppm/c7a9f7e3e9c1ba4aeec8a889f6a1c666 to your computer and use it in GitHub Desktop.
Use this in Bitrise's Ruby Script runner step to increment CURRENT_PROJECT_VERSION.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile: | |
# | |
# source 'https://rubygems.org' | |
# | |
# gem 'xcodeproj' | |
require 'xcodeproj' | |
project_path = 'Your.xcodeproj' | |
project = Xcodeproj::Project.open(project_path) | |
target = project.targets.find { |target| target.name == 'TargetName' } | |
target.build_configurations.each do |config| | |
new_version = (config.build_settings['CURRENT_PROJECT_VERSION'].to_i + 1).to_s | |
config.build_settings['CURRENT_PROJECT_VERSION'] = new_version | |
end | |
project.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment