Skip to content

Commit 7fcc0e7

Browse files
committed
Made xcdatamodeld group detection to be Sources
Added XCVersionGroup collection getter
1 parent fb0b35d commit 7fcc0e7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/pbxFile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,14 @@ function defaultEncoding(fileRef) {
9494
}
9595

9696
function detectGroup(fileRef) {
97-
var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
97+
var extension = path.extname(this.basename).substring(1),
98+
filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
9899
groupName = GROUP_BY_FILETYPE[unquoted(filetype)];
99100

101+
if (extension === 'xcdatamodeld') {
102+
return 'Sources';
103+
}
104+
100105
if (!groupName) {
101106
return DEFAULT_GROUP;
102107
}

lib/pbxProject.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,14 @@ pbxProject.prototype.pbxNativeTargetSection = function() {
805805
return this.hash.project.objects['PBXNativeTarget'];
806806
}
807807

808+
pbxProject.prototype.pbxVersionGroupSection = function () {
809+
if (typeof this.hash.project.objects['XCVersionGroup'] !== 'object') {
810+
this.hash.project.objects['XCVersionGroup'] = {};
811+
}
812+
813+
return this.hash.project.objects['XCVersionGroup'];
814+
}
815+
808816
pbxProject.prototype.pbxXCConfigurationList = function() {
809817
return this.hash.project.objects['XCConfigurationList'];
810818
}

0 commit comments

Comments
 (0)