Class: IosToolchain::ProjectAnalyzer
- Inherits:
-
Object
- Object
- IosToolchain::ProjectAnalyzer
- Defined in:
- lib/ios_toolchain/project_analyzer.rb
Instance Attribute Summary collapse
-
#project_file_path ⇒ Object
readonly
Returns the value of attribute project_file_path.
-
#project_root ⇒ Object
readonly
Returns the value of attribute project_root.
Instance Method Summary collapse
- #app_targets ⇒ Object
- #crashlytics_framework_path ⇒ Object
- #default_scheme ⇒ Object
- #default_sdk ⇒ Object
-
#initialize(project_root) ⇒ ProjectAnalyzer
constructor
A new instance of ProjectAnalyzer.
- #test_targets ⇒ Object
- #ui_test_targets ⇒ Object
Constructor Details
#initialize(project_root) ⇒ ProjectAnalyzer
Returns a new instance of ProjectAnalyzer.
8 9 10 11 12 13 14 15 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 8 def initialize(project_root) project_root_path = Pathname.new(project_root).realpath @project_root = project_root_path.to_s @absolute_project_path = find_project_path! @project_file_path = relative_from_root(@absolute_project_path) @project = Xcodeproj::Project.open(@absolute_project_path) end |
Instance Attribute Details
#project_file_path ⇒ Object (readonly)
Returns the value of attribute project_file_path.
6 7 8 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 6 def project_file_path @project_file_path end |
#project_root ⇒ Object (readonly)
Returns the value of attribute project_root.
6 7 8 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 6 def project_root @project_root end |
Instance Method Details
#app_targets ⇒ Object
29 30 31 32 33 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 29 def app_targets project.targets.map(&:name).find_all do |name| !name.include?('Tests') end end |
#crashlytics_framework_path ⇒ Object
24 25 26 27 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 24 def crashlytics_framework_path path = glob_excluding_carthage('**/Crashlytics.framework').first || return relative_from_root(path) end |
#default_scheme ⇒ Object
17 18 19 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 17 def default_scheme shared_schemes.find { |name| name == project_name } end |
#default_sdk ⇒ Object
21 22 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 21 def default_sdk end |
#test_targets ⇒ Object
35 36 37 38 39 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 35 def test_targets project.targets.map(&:name).find_all do |name| name.include?('Tests') && !name.include?('UITests') end end |
#ui_test_targets ⇒ Object
41 42 43 44 45 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 41 def ui_test_targets project.targets.map(&:name).find_all do |name| name.include?('UITests') end end |