Class: Fastlane::Actions::FivVersionAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



103
104
105
106
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_version.rb', line 103

def self.authors
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
  ["garygrossgarten"]
end

.available_optionsObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_version.rb', line 41

def self.available_options
  # Define all options your action supports. 
  
  # Below a few examples
  [
    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: :local_branch,
                                 env_name: "FL_GIT_PUSH_LOCAL_BRANCH",
                                 description: "The local branch to push from. Defaults to the current branch",
                                 default_value_dynamic: true,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :remote_branch,
                                 env_name: "FL_GIT_PUSH_REMOTE_BRANCH",
                                 description: "The remote branch to push to. Defaults to the local branch",
                                 default_value_dynamic: true,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :force,
                                 env_name: "FL_PUSH_GIT_FORCE",
                                 description: "Force push to remote",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :tags,
                                 env_name: "FL_PUSH_GIT_TAGS",
                                 description: "Whether tags are pushed to remote",
                                 is_string: false,
                                 default_value: true),
    FastlaneCore::ConfigItem.new(key: :remote,
                                 env_name: "FL_GIT_PUSH_REMOTE",
                                 description: "The remote to push to",
                                 default_value: 'origin'),
    FastlaneCore::ConfigItem.new(key: :skip_version,
                                env_name: "FIV_SKIP_VERSION",
                                description: "---",
                                optional: false,
                                    type: Boolean),
  ]
end

.descriptionObject



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

def self.description
  "A short description with <= 80 characters of what this action does"
end

.detailsObject



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

def self.details
  # Optional:
  # this is your chance to provide a more detailed description of this action
  "You can use this action to do cool things..."
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


108
109
110
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_version.rb', line 108

def self.is_supported?(platform)
 platform == :android
end

.outputObject



91
92
93
94
95
96
97
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_version.rb', line 91

def self.output
  # Define the shared values you are going to provide
  # Example
  [
    ['FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE', 'A description of what this value contains']
  ]
end

.return_valueObject



99
100
101
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_version.rb', line 99

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



8
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_version.rb', line 8

def self.run(params)
  version_and_build_no = Fastlane::Actions::FivUpdateVersionAndBuildNoAction.run(ios: params[:ios],pathToConfigXML: params[:pathToConfigXML],skip_version: params[:skip_version])
  
  Fastlane::Actions::FivBumpVersionAction.run(
    message: "fastlane(#{params[:ios] ? "ios" : "android"}): build #{version_and_build_no[:build_no]}, version: #{version_and_build_no[:version]}"
    )


  Fastlane::Actions::PushToGitRemoteAction.run(
    remote: params[:remote],
    local_branch: params[:local_branch],
    remote_branch: params[:remote_branch],
    force: params[:force],
    tags: params[:tags]
  )

  return version_and_build_no
end