Module: HighFive::IosHelper

Included in:
Thor::Tasks::Distribution, Thor::Tasks::IosTasks
Defined in:
lib/high_five/ios_helper.rb

Instance Method Summary collapse

Instance Method Details

#info_plist_path(target = nil) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/high_five/ios_helper.rb', line 15

def info_plist_path(target=nil)
  root_dir = File.dirname(xcodeproj_path)
  target = "*" if target.nil?
  info =  Dir["#{root_dir}/**/#{target}-Info.plist"].first
  raise "Couldn't find infoplist" if info.nil?
  return info
end

#xcodeproj_path ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/high_five/ios_helper.rb', line 23

def xcodeproj_path
  platform_config = base_config.build_platform_config(:ios)
  destination_dir = platform_config.destination
  root_dir = destination_dir
  while true
    glob = Dir[File.join(root_dir, "*.xcodeproj")]
    return glob.first if (glob.length > 0)
    root_dir = File.expand_path("..", root_dir)
    raise "Couldn't find xcodeproj near #{destination_dir}" if root_dir == '/'
  end
end