Class: Fastlane::Actions::FivUpdateVersionAndBuildNoAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb

Class Method Summary collapse

Class Method Details

.authorsObject



31
32
33
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb', line 31

def self.authors
  ["Fivethree"]
end

.available_optionsObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb', line 45

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 |
      UI.user_error!("Couldnt find config.xml! Please change your path.") unless File.exist?(value)
    end  ,
        type: String),
        FastlaneCore::ConfigItem.new(key: :skip_version,
                                env_name: "FIV_SKIP_VERSION",
                                description: "---",
                                optional: false,
                                    type: Boolean)
  ]
end

.descriptionObject



27
28
29
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb', line 27

def self.description
  "Fastlane plugin for Ionic v4 Projects"
end

.detailsObject



40
41
42
43
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb', line 40

def self.details
  # Optional:
  "Fastlane"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


68
69
70
71
72
73
74
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb', line 68

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_valueObject



35
36
37
38
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb', line 35

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) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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