Skip to content

Commit 2486bf9

Browse files
author
Anis Kadri
committed
Merge branch 'tbd-support' of https://github.com/appden/node-xcode into appden-tbd-support
2 parents 35a6fb3 + 3613a96 commit 2486bf9

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

lib/pbxFile.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var FILETYPE_BY_EXTENSION = {
2323
plist: 'text.plist.xml',
2424
sh: 'text.script.sh',
2525
swift: 'sourcecode.swift',
26+
tbd: 'sourcecode.text-based-dylib-definition',
2627
xcassets: 'folder.assetcatalog',
2728
xcconfig: 'text.xcconfig',
2829
xcdatamodel: 'wrapper.xcdatamodel',
@@ -33,6 +34,7 @@ var FILETYPE_BY_EXTENSION = {
3334
GROUP_BY_FILETYPE = {
3435
'archive.ar': 'Frameworks',
3536
'compiled.mach-o.dylib': 'Frameworks',
37+
'sourcecode.text-based-dylib-definition': 'Frameworks',
3638
'wrapper.framework': 'Frameworks',
3739
'embedded.framework': 'Embed Frameworks',
3840
'sourcecode.c.h': 'Resources',
@@ -41,10 +43,12 @@ var FILETYPE_BY_EXTENSION = {
4143
},
4244
PATH_BY_FILETYPE = {
4345
'compiled.mach-o.dylib': 'usr/lib/',
46+
'sourcecode.text-based-dylib-definition': 'usr/lib/',
4447
'wrapper.framework': 'System/Library/Frameworks/'
4548
},
4649
SOURCETREE_BY_FILETYPE = {
4750
'compiled.mach-o.dylib': 'SDKROOT',
51+
'sourcecode.text-based-dylib-definition': 'SDKROOT',
4852
'wrapper.framework': 'SDKROOT'
4953
},
5054
ENCODING_BY_FILETYPE = {

test/pbxFile.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ exports['lastKnownFileType'] = {
3636
test.done();
3737
},
3838

39+
'should detect that a .tbd path means sourcecode.text-based-dylib-definition': function (test) {
40+
var sourceFile = new pbxFile('libsqlite3.tbd');
41+
42+
test.equal('sourcecode.text-based-dylib-definition', sourceFile.lastKnownFileType);
43+
test.done();
44+
},
45+
3946
'should detect that a .framework path means wrapper.framework': function (test) {
4047
var sourceFile = new pbxFile('MessageUI.framework');
4148

@@ -86,12 +93,24 @@ exports['group'] = {
8693
test.equal('Sources', dataModelFile.group);
8794
test.done();
8895
},
89-
'should be Frameworks for frameworks': function (test) {
96+
'should be Frameworks for dylibs': function (test) {
9097
var framework = new pbxFile('libsqlite3.dylib');
9198

9299
test.equal('Frameworks', framework.group);
93100
test.done();
94101
},
102+
'should be Frameworks for tbds': function (test) {
103+
var framework = new pbxFile('libsqlite3.tbd');
104+
105+
test.equal('Frameworks', framework.group);
106+
test.done();
107+
},
108+
'should be Frameworks for frameworks': function (test) {
109+
var framework = new pbxFile('MessageUI.framework');
110+
111+
test.equal('Frameworks', framework.group);
112+
test.done();
113+
},
95114
'should be Resources for all other files': function (test) {
96115
var headerFile = new pbxFile('Plugins/ChildBrowser.h'),
97116
xibFile = new pbxFile('Plugins/ChildBrowser.xib');
@@ -125,6 +144,13 @@ exports['sourceTree'] = {
125144
test.done();
126145
},
127146

147+
'should be SDKROOT for tbds': function (test) {
148+
var sourceFile = new pbxFile('libsqlite3.tbd');
149+
150+
test.equal('SDKROOT', sourceFile.sourceTree);
151+
test.done();
152+
},
153+
128154
'should be SDKROOT for frameworks': function (test) {
129155
var sourceFile = new pbxFile('MessageUI.framework');
130156

@@ -163,6 +189,13 @@ exports['path'] = {
163189
test.done();
164190
},
165191

192+
'should be "usr/lib" for tbds (relative to SDKROOT)': function (test) {
193+
var sourceFile = new pbxFile('libsqlite3.tbd');
194+
195+
test.equal('usr/lib/libsqlite3.tbd', sourceFile.path);
196+
test.done();
197+
},
198+
166199
'should be "System/Library/Frameworks" for frameworks': function (test) {
167200
var sourceFile = new pbxFile('MessageUI.framework');
168201

0 commit comments

Comments
 (0)