Thx to https://stackoverflow.com/a/56179405/5790492 and https://nshipster.com/xcconfig/
I've created the xcconfig file, added it to project in Info tab. For fastlane added this plugin to work with xcconfig. And now it looks like:
def bumpMinorVersionNumber
currentVersion = get_xcconfig_value(path: 'fastlane/VersionsConfig.xcconfig',
name: 'FC_VERSION')
versionArray = currentVersion.split(".").map(&:to_i)
versionArray[2] = (versionArray[2] || 0) + 1
newVersion = versionArray.join(".")
update_xcconfig_value(path: 'fastlane/VersionsConfig.xcconfig',
name: 'FC_VERSION',
value: newVersion.to_s)
UI.important("Old version: #{currentVersion}. Version bumped to: #{newVersion}")
end
def bumpBuildNumber
currentBuildNumber = get_xcconfig_value(path: 'fastlane/VersionsConfig.xcconfig',
name: 'FC_BUILD')
newBuildNumber = currentBuildNumber.to_i + 1
update_xcconfig_value(path: 'fastlane/VersionsConfig.xcconfig',
name: 'FC_BUILD',
value: newBuildNumber.to_s)
UI.important("Old build number: #{currentBuildNumber}. Build number bumped to: #{newBuildNumber}")
end
