Class: Trainer::Options

Inherits:
Object
  • Object
show all
Defined in:
trainer/lib/trainer/options.rb

Class Method Summary collapse

Class Method Details

.available_optionsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'trainer/lib/trainer/options.rb', line 7

def self.available_options
  @options ||= [
    FastlaneCore::ConfigItem.new(key: :path,
                                 short_option: "-p",
                                 env_name: "TRAINER_PATH",
                                 default_value: ".",
                                 description: "Path to the directory that should be converted",
                                 verify_block: proc do |value|
                                   v = File.expand_path(value.to_s)
                                   if v.end_with?(".plist")
                                     UI.user_error!("Can't find file at path #{v}") unless File.exist?(v)
                                   else
                                     UI.user_error!("Path '#{v}' is not a directory or can't be found") unless File.directory?(v)
                                   end
                                 end),
    FastlaneCore::ConfigItem.new(key: :extension,
                                 short_option: "-e",
                                 env_name: "TRAINER_EXTENSION",
                                 default_value: ".xml",
                                 description: "The extension for the newly created file. Usually .xml or .junit",
                                 verify_block: proc do |value|
                                   UI.user_error!("extension must contain a `.`") unless value.include?(".")
                                 end),
    FastlaneCore::ConfigItem.new(key: :output_directory,
                                 short_option: "-o",
                                 env_name: "TRAINER_OUTPUT_DIRECTORY",
                                 default_value: nil,
                                 optional: true,
                                 description: "Directory in which the xml files should be written to. Same directory as source by default"),
    FastlaneCore::ConfigItem.new(key: :output_filename,
                                 short_option: "-f",
                                 env_name: "TRAINER_OUTPUT_FILENAME",
                                 default_value: nil,
                                 optional: true,
                                 description: "Filename the xml file should be written to. Defaults to name of input file. (Only works if one input file is used)"),
    FastlaneCore::ConfigItem.new(key: :fail_build,
                                 env_name: "TRAINER_FAIL_BUILD",
                                 description: "Should this step stop the build if the tests fail? Set this to false if you're handling this with a test reporter",
                                 is_string: false,
                                 default_value: true),
    FastlaneCore::ConfigItem.new(key: :xcpretty_naming,
                                 short_option: "-x",
                                 env_name: "TRAINER_XCPRETTY_NAMING",
                                 description: "Produces class name and test name identical to xcpretty naming in junit file",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :silent,
                                 env_name: "TRAINER_SILENT",
                                 description: "Silences all output",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :output_remove_retry_attempts,
                                 env_name: "TRAINER_OUTPUT_REMOVE_RETRY_ATTEMPTS",
                                 description: "Doesn't include retry attempts in the output",
                                 is_string: false,
                                 default_value: false)
  ]
end