Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added handler for :xcodeproj in launch options #514

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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