Class: XCProject::XcodeprojManager

Inherits:
Object
  • Object
show all
Defined in:
lib/core_blur/check/xcodeproj.rb

Constant Summary collapse

@@instance =
XcodeprojManager.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeXcodeprojManager

Returns a new instance of XcodeprojManager.



6
7
8
# File 'lib/core_blur/check/xcodeproj.rb', line 6

def initialize
  @module_frameworks = {}
end

Instance Attribute Details

#module_frameworksObject (readonly)

Returns the value of attribute module_frameworks.



5
6
7
# File 'lib/core_blur/check/xcodeproj.rb', line 5

def module_frameworks
  @module_frameworks
end

Class Method Details

.share_managerObject



10
11
12
# File 'lib/core_blur/check/xcodeproj.rb', line 10

def self.share_manager
  @@instance
end

Instance Method Details

#get_app_targetsObject



37
38
39
40
# File 'lib/core_blur/check/xcodeproj.rb', line 37

def get_app_targets
  project = self.get_shell_project
  project.root_object.targets
end

#get_pods_projectObject



41
42
43
44
45
46
47
# File 'lib/core_blur/check/xcodeproj.rb', line 41

def get_pods_project
  xcodeproj_path = "#{Dir.pwd}/Pods/Pods.xcodeproj"
  unless File.exist?(xcodeproj_path)
    return nil
  end
  Xcodeproj::Project.open(xcodeproj_path)
end

#get_shell_projectObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/core_blur/check/xcodeproj.rb', line 14

def get_shell_project
  xcodeproj_file = nil
  Dir.foreach(Dir.pwd) do |file|
    if file.end_with?(".xcodeproj")
      xcodeproj_file = file
      break
    end
  end
  xcodeproj_path = "#{Dir.pwd}/#{xcodeproj_file}"
  unless File.exist?(xcodeproj_path)
    return nil
  end
  Xcodeproj::Project.open(xcodeproj_path)
end

#get_shell_targetsObject



28
29
30
31
32
33
34
35
36
# File 'lib/core_blur/check/xcodeproj.rb', line 28

def get_shell_targets
  results = []
  project = self.get_shell_project
  targets = project.root_object.targets
  targets.each do |target|
    results << target.name
  end
  results
end