Class: Fastlane::Actions::ApplitoolsifyAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



30
31
32
# File 'lib/fastlane/plugin/applitoolsify/actions/applitoolsify_action.rb', line 30

def self.authors
  ["Serhii Ovchynnyk"]
end

.available_optionsObject



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

def self.available_options
  [
    # FastlaneCore::ConfigItem.new(key: :your_option,
    #                         env_name: "APPLITOOLSIFY_YOUR_OPTION",
    #                      description: "A description of your option",
    #                         optional: false,
    #                             type: String)
    FastlaneCore::ConfigItem.new(key: :applitoolsify_input,
                                 env_name: "APPLITOOLSIFY_INPUT",
                                 description: "Path to your original file to modify",
                                 optional: false,
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Could not find file at path '#{File.expand_path(value)}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be an valid file") unless value.end_with?(".ipa") || value.end_with?(".app")
                                 end),
    FastlaneCore::ConfigItem.new(key: :applitoolsify_output,
                                 env_name: "APPLITOOLSIFY_OUTPUT_NAME",
                                 description: "The name of the resulting file",
                                 optional: true,
                                 type: String),
  ]
end

.descriptionObject



26
27
28
# File 'lib/fastlane/plugin/applitoolsify/actions/applitoolsify_action.rb', line 26

def self.description
  "Add Applitools SDKs to ipa and app iOS apps as fastlane-plugin"
end

.detailsObject



38
39
40
41
# File 'lib/fastlane/plugin/applitoolsify/actions/applitoolsify_action.rb', line 38

def self.details
  # Optional:
  "Add Applitools SDKs to ipa and app iOS apps as fastlane-plugin"
end

.is_supported?(platform) ⇒ Boolean



67
68
69
70
71
72
73
# File 'lib/fastlane/plugin/applitoolsify/actions/applitoolsify_action.rb', line 67

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



34
35
36
# File 'lib/fastlane/plugin/applitoolsify/actions/applitoolsify_action.rb', line 34

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

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fastlane/plugin/applitoolsify/actions/applitoolsify_action.rb', line 7

def self.run(params)
  UI.message("The applitoolsify plugin is working!")
  UI.message("Parameter Input Path: #{params[:applitoolsify_input]} >")

  input = params[:applitoolsify_input]
  output = params[:applitoolsify_output]
  if output.nil?
    output = input
    UI.message("Parameter Output Empty using Input to Overwrite: > #{output}")
  else
    UI.message("Parameter Output Path: > #{params[:applitoolsify_output]}")
    FileUtils.cp(input, output)
  end

  app_name = File.basename(input)
  Helper::ApplitoolsifyHelper.applitoolsify(output, app_name)
  UI.message("The applitoolsify plugin finish working!")
end