class Fastlane::Actions::SetVersionAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/version/actions/set_version_action.rb, line 31
def self.authors
  ["Jason Nam"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/version/actions/set_version_action.rb, line 35
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :plist,
                        short_option: "-p",
                         description: "Path for the plist to update",
                                type: String),
    FastlaneCore::ConfigItem.new(key: :version,
                        short_option: "-v",
                         description: "Short version (CFBundleShortVersionString)",
                            optional: true,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :build_version,
                        short_option: "-b",
                         description: "Build version (CFBundleVersion)",
                            optional: true,
                                type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/version/actions/set_version_action.rb, line 27
def self.description
  "Set version"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/version/actions/set_version_action.rb, line 54
def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end
run(params) click to toggle source
# File lib/fastlane/plugin/version/actions/set_version_action.rb, line 6
def self.run(params)
  plist = params[:plist]
  version = params[:version]
  build_version = params[:build_version]

  if version
    Actions::SetInfoPlistValueAction.run(
      path: plist,
      key: "CFBundleShortVersionString",
      value: version
    )
  end
  if build_version
    Actions::SetInfoPlistValueAction.run(
      path: plist,
      key: "CFBundleVersion",
      value: build_version
    )
  end
end