From 404effa7509acca71065e56838f820d3d141b564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Rost=C3=A1n?= Date: Mon, 9 Jan 2023 11:33:52 -0300 Subject: [PATCH] [#228] fix intentdefinition classification --- lib/xcake/path_classifier.rb | 2 +- spec/path_classifier_spec.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/xcake/path_classifier.rb b/lib/xcake/path_classifier.rb index f2b340c2..31172575 100644 --- a/lib/xcake/path_classifier.rb +++ b/lib/xcake/path_classifier.rb @@ -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 diff --git a/spec/path_classifier_spec.rb b/spec/path_classifier_spec.rb index cd398289..685c4d0e 100644 --- a/spec/path_classifier_spec.rb +++ b/spec/path_classifier_spec.rb @@ -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')