Skip to content

Commit 454bf04

Browse files
committed
Added handler for :xcodeproj in launch options
1 parent fb72e8e commit 454bf04

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lib/run_loop/detect_aut/detect.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ module RunLoop
22

33
# @!visibility private
44
module DetectAUT
5+
@@xcodeproj = nil
6+
7+
def self.xcodeproj
8+
@@xcodeproj
9+
end
510

611
# @!visibility private
712
def self.detect_app_under_test(options)
13+
@@xcodeproj = xcodeproj_from_options(options)
814
app = self.detect_app(options)
915
if app.is_a?(RunLoop::App) || app.is_a?(RunLoop::Ipa)
1016
{
@@ -124,6 +130,16 @@ def globs_for_app_search(base_dir)
124130

125131
private
126132

133+
# @!visibility private
134+
def self.xcodeproj_from_options(options)
135+
value = options[:xcodeproj]
136+
if value.nil? || value == ""
137+
nil
138+
else
139+
File.expand_path(value)
140+
end
141+
end
142+
127143
# @!visibility private
128144
def self.app_from_options(options)
129145
options[:app] || options[:bundle_id]

lib/run_loop/detect_aut/xcode.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def xcode_project?
1010
end
1111

1212
# @!visibility private
13-
def xcodeproj
14-
xcodeproj = RunLoop::Environment.xcodeproj
13+
def xcodeproj(options = {})
14+
xcodeproj = RunLoop::Environment.xcodeproj || RunLoop::DetectAUT.xcodeproj
1515

1616
if xcodeproj && !File.directory?(xcodeproj)
1717
raise_xcodeproj_missing(xcodeproj)

0 commit comments

Comments
 (0)