Class: Xcake::PathClassifier
- Inherits:
-
Object
- Object
- Xcake::PathClassifier
- Defined in:
- lib/xcake/path_classifier.rb
Overview
This class handles classifing the files and how Xcake should handle them.
Constant Summary collapse
- EXTENSION_MAPPINGS =
{ PBXFrameworksBuildPhase: %w(.a .dylib .so .framework).freeze, PBXHeadersBuildPhase: %w(.h .hpp).freeze, PBXSourcesBuildPhase: %w(.c .m .mm .cpp .cc .swift .xcdatamodeld .intentdefinition .java).freeze, PBXResourcesBuildPhase: %w(.xcassets).freeze }.freeze
Class Method Summary collapse
- .classification_for_path(path) ⇒ Object
- .should_create_build_phase_for_classification?(classification) ⇒ Boolean
-
.should_include_path?(path) ⇒ Boolean
by subclasses.
Class Method Details
.classification_for_path(path) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/xcake/path_classifier.rb', line 29 def self.classification_for_path(path) classification = EXTENSION_MAPPINGS.detect do |_key, ext_group| ext_group.any? { |ext| File.extname(path) == ext } end return :PBXResourcesBuildPhase if classification.nil? classification.first end |
.should_create_build_phase_for_classification?(classification) ⇒ Boolean
39 40 41 |
# File 'lib/xcake/path_classifier.rb', line 39 def self.should_create_build_phase_for_classification?(classification) classification != :PBXHeadersBuildPhase end |
.should_include_path?(path) ⇒ Boolean
Note:
This should be overidden
by subclasses.
into the project
22 23 24 25 26 27 |
# File 'lib/xcake/path_classifier.rb', line 22 def self.should_include_path?(path) return false if locale_container?(path) return false if inside_classified_container?(path) true end |