class Fastlane::Actions::IosGetBuildNumberAction
Public Class Methods
available_options()
click to toggle source
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 39 def self.available_options [ FastlaneCore::ConfigItem.new(key: :xcodeproj, env_name: "FL_IOS_GET_BUILD_NUMBER_XCODEPROJ", description: "(optional) Specify the path to your main Xcode project if it isn't in the project root directory", optional: true, verify_block: proc do |value| UI.user_error!("Please specify the path to the project, not workspace") if value.end_with? ".xcworkspace" UI.user_error!("Could not find Xcode project") unless File.exist?(value) end) ] end
description()
click to toggle source
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 27 def self.description "Get the Build Number of your iOS project" end
details()
click to toggle source
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 31 def self.details [ "This action will return current Build Number of your iOS project.", "You have to set up your Xcode project to use AGV. For more info:", "https://developer.apple.com/library/ios/qa/qa1827/_index.html" ].join(' ') end
example_code()
click to toggle source
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 70 def self.example_code [ 'build_number = ios_get_build_number # Xcode project is in the project root directory', 'build_number = ios_get_build_number(xcodeproj: "/path/to/Project.xcodeproj")' ] end
is_supported?(platform)
click to toggle source
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 66 def self.is_supported?(platform) [:ios].include? platform end
output()
click to toggle source
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 52 def self.output [ ['IOS_BUILD_NUMBER', 'The Build Number of your iOS project'] ] end
return_value()
click to toggle source
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 58 def self.return_value "The Build Number of your iOS project" end
run(params)
click to toggle source
More information about how to set up your project and how it works: developer.apple.com/library/ios/qa/qa1827/_index.html Attention: This is NOT the Version - but the Build Number
# File lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb, line 12 def self.run(params) xcodeproj = params[:xcodeproj] command_get = Helper::VersioningIosHelper.get_build_number_command(xcodeproj) Helper::VersioningIosHelper.is_agv_enabled(xcodeproj) build_number = Helper.test? ? `#{command_get}` : (Actions.sh command_get) build_number = Helper::VersioningIosHelper.parse_build_number(build_number) UI.success("👍 Current Build Number is: #{build_number}") # Store the Build Number in the shared hash Actions.lane_context[SharedValues::IOS_BUILD_NUMBER] = build_number end