Merge branch 'tbd-support' of https://github.com/appden/node-xcode into appden-tbd-support
diff --git a/lib/pbxFile.js b/lib/pbxFile.js
index b4e8bdd..0215bc3 100644
--- a/lib/pbxFile.js
+++ b/lib/pbxFile.js
@@ -23,6 +23,7 @@
plist: 'text.plist.xml',
sh: 'text.script.sh',
swift: 'sourcecode.swift',
+ tbd: 'sourcecode.text-based-dylib-definition',
xcassets: 'folder.assetcatalog',
xcconfig: 'text.xcconfig',
xcdatamodel: 'wrapper.xcdatamodel',
@@ -33,6 +34,7 @@
GROUP_BY_FILETYPE = {
'archive.ar': 'Frameworks',
'compiled.mach-o.dylib': 'Frameworks',
+ 'sourcecode.text-based-dylib-definition': 'Frameworks',
'wrapper.framework': 'Frameworks',
'embedded.framework': 'Embed Frameworks',
'sourcecode.c.h': 'Resources',
@@ -41,10 +43,12 @@
},
PATH_BY_FILETYPE = {
'compiled.mach-o.dylib': 'usr/lib/',
+ 'sourcecode.text-based-dylib-definition': 'usr/lib/',
'wrapper.framework': 'System/Library/Frameworks/'
},
SOURCETREE_BY_FILETYPE = {
'compiled.mach-o.dylib': 'SDKROOT',
+ 'sourcecode.text-based-dylib-definition': 'SDKROOT',
'wrapper.framework': 'SDKROOT'
},
ENCODING_BY_FILETYPE = {
diff --git a/test/pbxFile.js b/test/pbxFile.js
index 02b6664..a24f564 100644
--- a/test/pbxFile.js
+++ b/test/pbxFile.js
@@ -36,6 +36,13 @@
test.done();
},
+ 'should detect that a .tbd path means sourcecode.text-based-dylib-definition': function (test) {
+ var sourceFile = new pbxFile('libsqlite3.tbd');
+
+ test.equal('sourcecode.text-based-dylib-definition', sourceFile.lastKnownFileType);
+ test.done();
+ },
+
'should detect that a .framework path means wrapper.framework': function (test) {
var sourceFile = new pbxFile('MessageUI.framework');
@@ -86,12 +93,24 @@
test.equal('Sources', dataModelFile.group);
test.done();
},
- 'should be Frameworks for frameworks': function (test) {
+ 'should be Frameworks for dylibs': function (test) {
var framework = new pbxFile('libsqlite3.dylib');
test.equal('Frameworks', framework.group);
test.done();
},
+ 'should be Frameworks for tbds': function (test) {
+ var framework = new pbxFile('libsqlite3.tbd');
+
+ test.equal('Frameworks', framework.group);
+ test.done();
+ },
+ 'should be Frameworks for frameworks': function (test) {
+ var framework = new pbxFile('MessageUI.framework');
+
+ test.equal('Frameworks', framework.group);
+ test.done();
+ },
'should be Resources for all other files': function (test) {
var headerFile = new pbxFile('Plugins/ChildBrowser.h'),
xibFile = new pbxFile('Plugins/ChildBrowser.xib');
@@ -125,6 +144,13 @@
test.done();
},
+ 'should be SDKROOT for tbds': function (test) {
+ var sourceFile = new pbxFile('libsqlite3.tbd');
+
+ test.equal('SDKROOT', sourceFile.sourceTree);
+ test.done();
+ },
+
'should be SDKROOT for frameworks': function (test) {
var sourceFile = new pbxFile('MessageUI.framework');
@@ -163,6 +189,13 @@
test.done();
},
+ 'should be "usr/lib" for tbds (relative to SDKROOT)': function (test) {
+ var sourceFile = new pbxFile('libsqlite3.tbd');
+
+ test.equal('usr/lib/libsqlite3.tbd', sourceFile.path);
+ test.done();
+ },
+
'should be "System/Library/Frameworks" for frameworks': function (test) {
var sourceFile = new pbxFile('MessageUI.framework');