Class: Snapshot::TestCommandGeneratorBase
- Inherits:
-
Object
- Object
- Snapshot::TestCommandGeneratorBase
show all
- Defined in:
- snapshot/lib/snapshot/test_command_generator_base.rb
Class Method Summary
collapse
Class Method Details
.actions ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 40
def actions
actions = []
if Snapshot.config[:test_without_building]
actions << "test-without-building"
else
actions << :clean if Snapshot.config[:clean]
actions << :build actions << :test
end
return actions
end
|
.build_settings ⇒ Object
30
31
32
33
34
35
36
37
38
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 30
def build_settings
config = Snapshot.config
build_settings = []
build_settings << "FASTLANE_SNAPSHOT=YES"
build_settings << "TEST_TARGET_NAME=#{config[:test_target_name].shellescape}" if config[:test_target_name]
return build_settings
end
|
.derived_data_path ⇒ Object
79
80
81
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 79
def derived_data_path
Snapshot.cache[:derived_data_path] ||= (Snapshot.config[:derived_data_path] || Dir.mktmpdir("snapshot_derived"))
end
|
.destination(device_name) ⇒ Object
91
92
93
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 91
def destination(device_name)
not_implemented(__method__)
end
|
.device_udid(device_name, os_version = ) ⇒ Object
73
74
75
76
77
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 73
def device_udid(device_name, os_version = Snapshot.config[:ios_version])
device = find_device(device_name, os_version)
return device ? device.udid : nil
end
|
.find_device(device_name, os_version = ) ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 56
def find_device(device_name, os_version = Snapshot.config[:ios_version])
simulators = FastlaneCore::DeviceManager.simulators
name_matches = simulators.find_all { |sim| sim.name.strip == device_name.strip }
.sort_by { |sim| Gem::Version.new(sim.os_version) }
.reverse
return name_matches.find { |sim| sim.os_version == os_version } || name_matches.first
end
|
.initialize ⇒ Object
83
84
85
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 83
def initialize
not_implemented(__method__)
end
|
.options ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 20
def options
config = Snapshot.config
options = []
options += project_path_array
options << "-sdk '#{config[:sdk]}'" if config[:sdk]
options << "-derivedDataPath '#{derived_data_path}'"
options << config[:xcargs] if config[:xcargs]
return options
end
|
.pipe(device_type, language, locale) ⇒ Object
87
88
89
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 87
def pipe(device_type, language, locale)
not_implemented(__method__)
end
|
.prefix ⇒ Object
7
8
9
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 7
def prefix
["set -o pipefail &&"]
end
|
.project_path_array ⇒ Array
Path to the project or workspace as parameter This will also include the scheme (if given)
14
15
16
17
18
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 14
def project_path_array
proj = Snapshot.project.xcodebuild_parameters
return proj if proj.count > 0
UI.user_error!("No project/workspace found")
end
|
.suffix ⇒ Object
52
53
54
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 52
def suffix
return []
end
|
.xcodebuild_log_path(device_type: nil, language: nil, locale: nil) ⇒ Object
95
96
97
|
# File 'snapshot/lib/snapshot/test_command_generator_base.rb', line 95
def xcodebuild_log_path(device_type: nil, language: nil, locale: nil)
not_implemented(__method__)
end
|