Skip to content

Commit

Permalink
Added handler for :xcodeproj in launch options
Browse files Browse the repository at this point in the history
  • Loading branch information
ark-konopacki committed Oct 13, 2016
1 parent fb72e8e commit 454bf04
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions lib/run_loop/detect_aut/detect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ module RunLoop

# @!visibility private
module DetectAUT
@@xcodeproj = nil

def self.xcodeproj
@@xcodeproj
end

# @!visibility private
def self.detect_app_under_test(options)
@@xcodeproj = xcodeproj_from_options(options)
app = self.detect_app(options)
if app.is_a?(RunLoop::App) || app.is_a?(RunLoop::Ipa)
{
Expand Down Expand Up @@ -124,6 +130,16 @@ def globs_for_app_search(base_dir)

private

# @!visibility private
def self.xcodeproj_from_options(options)
value = options[:xcodeproj]
if value.nil? || value == ""
nil
else
File.expand_path(value)
end
end

# @!visibility private
def self.app_from_options(options)
options[:app] || options[:bundle_id]
Expand Down
4 changes: 2 additions & 2 deletions lib/run_loop/detect_aut/xcode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def xcode_project?
end

# @!visibility private
def xcodeproj
xcodeproj = RunLoop::Environment.xcodeproj
def xcodeproj(options = {})
xcodeproj = RunLoop::Environment.xcodeproj || RunLoop::DetectAUT.xcodeproj

if xcodeproj && !File.directory?(xcodeproj)
raise_xcodeproj_missing(xcodeproj)
Expand Down

0 comments on commit 454bf04

Please sign in to comment.