class Fastlane::Actions::FivUpdateVersionAndBuildNoAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb, line 36
def self.authors
  %w[Fivethree]
end
available_options() click to toggle source
# File lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb, line 50
def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :ios,
      env_name: 'FIV_INCREMENT_BUILD_NO_IOS',
      description: '---',
      optional: false,
      type: Boolean
    ),
    FastlaneCore::ConfigItem.new(
      key: :pathToConfigXML,
      env_name: 'FIV_INCREMENT_BUILD_CONFIG',
      description: '---',
      optional: false,
      verify_block:
        proc do |value|
          unless File.exist?(value)
            UI.user_error!(
              'Couldnt find config.xml! Please change your path.'
            )
          end
        end,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :skip_version,
      env_name: 'FIV_SKIP_VERSION',
      description: '---',
      optional: true,
      default_value: false,
      type: Boolean
    )
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb, line 32
def self.description
  'Fastlane plugin for Ionic v4 Projects'
end
details() click to toggle source
# File lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb, line 45
def self.details
  # Optional:
  'Fastlane'
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb, line 85
def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
  #
  # [:ios, :mac, :android].include?(platform)
  true
end
return_value() click to toggle source
# File lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb, line 40
def self.return_value
  # If your method provides a return value, you can describe here what it does
  'returns object containing version and build_no'
end
run(params) click to toggle source
# File lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb, line 9
def self.run(params)
  version = ''
  if (params[:skip_version])
    puts('skiping version, just incrementing build no')
    old_version =
      sh "echo \"cat //*[local-name()='widget']/@version\" | xmllint --shell #{
           params[:pathToConfigXML]
         }|  awk -F'[=\"]' '!/>/{print $(NF-1)}'"
    version = old_version.delete!("\n")
  else
    version =
      Fastlane::Actions::FivUpdateVersionAction.run(
        pathToConfigXML: params[:pathToConfigXML]
      )
  end
  build_no =
    Fastlane::Actions::FivIncrementBuildNoAction.run(
      pathToConfigXML: params[:pathToConfigXML], ios: params[:ios]
    )

  return { version: version, build_no: build_no }
end