Skip to content
Permalink
Browse files
Merge branch 'appden-tbd-support'
  • Loading branch information
Anis Kadri committed Jun 1, 2016
2 parents 35a6fb3 + 2486bf9 commit a8177c5e8a2472a12a561ee76a58b8818e6c77d0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
@@ -23,6 +23,7 @@ var FILETYPE_BY_EXTENSION = {
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 @@ var FILETYPE_BY_EXTENSION = {
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 @@ var FILETYPE_BY_EXTENSION = {
},
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 = {
@@ -36,6 +36,13 @@ exports['lastKnownFileType'] = {
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 @@ exports['group'] = {
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 @@ exports['sourceTree'] = {
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 @@ exports['path'] = {
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');

0 comments on commit a8177c5

Please sign in to comment.