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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/xcov/options.rb', line 7
def self.available_options
containing = FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.'
[
FastlaneCore::ConfigItem.new(key: :workspace,
short_option: "-w",
env_name: "XCOV_WORKSPACE",
optional: true,
description: "Path the workspace file",
verify_block: proc do |value|
v = File.expand_path(value.to_s)
raise "Workspace file not found at path '#{v}'".red unless File.exist?(v)
raise "Workspace file invalid".red unless File.directory?(v)
raise "Workspace file is not a workspace, must end with .xcworkspace".red unless v.include?(".xcworkspace")
end),
FastlaneCore::ConfigItem.new(key: :project,
short_option: "-p",
optional: true,
env_name: "XCOV_PROJECT",
description: "Path the project file",
verify_block: proc do |value|
v = File.expand_path(value.to_s)
raise "Project file not found at path '#{v}'".red unless File.exist?(v)
raise "Project file invalid".red unless File.directory?(v)
raise "Project file is not a project file, must end with .xcodeproj".red unless v.include?(".xcodeproj")
end),
FastlaneCore::ConfigItem.new(key: :scheme,
short_option: "-s",
optional: true,
env_name: "XCOV_SCHEME",
description: "The project's scheme. Make sure it's marked as `Shared`"),
FastlaneCore::ConfigItem.new(key: :derived_data_path,
short_option: "-j",
env_name: "XCOV_DERIVED_DATA_PATH",
description: "The directory where build products and other derived data will go",
optional: true),
FastlaneCore::ConfigItem.new(key: :output_directory,
short_option: "-o",
env_name: "XCOV_OUTPUT_DIRECTORY",
description: "The directory in which all reports will be stored",
default_value: File.join(containing, "xcov_report")),
FastlaneCore::ConfigItem.new(key: :minimum_coverage_percentage,
short_option: "-m",
env_name: "XCOV_MINIMUM_COVERAGE_PERCENTAGE",
description: "Raise exception if overall coverage percentage is under this value (ie. 75)",
type: Float,
default_value: 0),
FastlaneCore::ConfigItem.new(key: :ignore_file_path,
short_option: "-x",
env_name: "XCOV_IGNORE_FILE_PATH",
description: "Relative or absolute path to the file containing the list of ignored files",
default_value: File.join(containing, ".xcovignore")),
FastlaneCore::ConfigItem.new(key: :include_test_targets,
env_name: "XCOV_INCLUDE_TEST_TARGETS",
description: "Enables coverage reports for .xctest targets",
is_string: false,
default_value: false),
FastlaneCore::ConfigItem.new(key: :slack_url,
short_option: "-i",
env_name: "SLACK_URL",
description: "Create an Incoming WebHook for your Slack group to post results there",
optional: true,
verify_block: proc do |value|
raise "Invalid URL, must start with https://" unless value.start_with? "https://"
end),
FastlaneCore::ConfigItem.new(key: :slack_channel,
short_option: "-e",
env_name: "XCOV_SLACK_CHANNEL",
description: "#channel or @username",
optional: true),
FastlaneCore::ConfigItem.new(key: :skip_slack,
description: "Don't publish to slack, even when an URL is given",
is_string: false,
default_value: false),
FastlaneCore::ConfigItem.new(key: :exclude_targets,
optional: true,
description: "Comma separated list of targets to exclude from coverage report")
]
end
|