Skip to content

Commit

Permalink
[#228] fix intentdefinition classification (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasrostan authored Jan 18, 2023
1 parent f431d44 commit 1a034c6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xcake/path_classifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class PathClassifier
EXTENSION_MAPPINGS = {
PBXFrameworksBuildPhase: %w(.a .dylib .so .framework).freeze,
PBXHeadersBuildPhase: %w(.h .hpp).freeze,
PBXSourcesBuildPhase: %w(.c .m .mm .cpp .cc .swift .xcdatamodeld .java).freeze,
PBXSourcesBuildPhase: %w(.c .m .mm .cpp .cc .swift .xcdatamodeld .intentdefinition .java).freeze,
PBXResourcesBuildPhase: %w(.xcassets).freeze
}.freeze

Expand Down
17 changes: 17 additions & 0 deletions spec/path_classifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,23 @@ module Xcake
end
end

context 'for an intent definition' do
it 'should include intent definition' do
should_install = PathClassifier.should_include_path?('./Model.intentdefinition')
expect(should_install).to be(true)
end

it 'should not include files inside' do
should_install = PathClassifier.should_include_path?('./Model.intentdefinition/Model.intentdefinition')
expect(should_install).to be(false)
end

it 'should classify as PBXSourcesBuildPhase' do
classification = PathClassifier.classification_for_path('./Model.intentdefinition')
expect(classification).to be(:PBXSourcesBuildPhase)
end
end

context 'for a xcassets folder' do
it 'should include xcassets folder' do
should_install = PathClassifier.should_include_path?('./Assets.xcassets')
Expand Down

0 comments on commit 1a034c6

Please sign in to comment.