Class: IosToolchain::ProjectAnalyzer
- Inherits:
-
Object
- Object
- IosToolchain::ProjectAnalyzer
- Defined in:
- lib/ios_toolchain/project_analyzer.rb
Instance Attribute Summary collapse
-
#project_path ⇒ Object
readonly
Returns the value of attribute project_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 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 8 def initialize(project_root) @project_root = Pathname.new(project_root).realpath.to_s @project_path = find_project_path! @project = Xcodeproj::Project.open(@project_path) end |
Instance Attribute Details
#project_path ⇒ Object (readonly)
Returns the value of attribute project_path.
6 7 8 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 6 def project_path @project_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
25 26 27 28 29 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 25 def app_targets project.targets.map(&:name).find_all do |name| !name.include?('Tests') end end |
#crashlytics_framework_path ⇒ Object
21 22 23 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 21 def crashlytics_framework_path Dir.glob("#{project_root}/**/Crashlytics.framework").first end |
#default_scheme ⇒ Object
14 15 16 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 14 def default_scheme shared_schemes.find { |name| name == project_name } end |
#default_sdk ⇒ Object
18 19 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 18 def default_sdk end |
#test_targets ⇒ Object
31 32 33 34 35 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 31 def test_targets project.targets.map(&:name).find_all do |name| name.include?('Tests') && !name.include?('UITests') end end |
#ui_test_targets ⇒ Object
37 38 39 40 41 |
# File 'lib/ios_toolchain/project_analyzer.rb', line 37 def ui_test_targets project.targets.map(&:name).find_all do |name| name.include?('UITests') end end |