Skip to content

Commit 5142def

Browse files
committed
Add helper filetypeForProducttype() method for resolving filetypes for product types.
1 parent 9bc7077 commit 5142def

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/pbxProject.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,24 @@ function producttypeForTargettype (targetType) {
13001300
return PRODUCTTYPE_BY_TARGETTYPE[targetType]
13011301
}
13021302

1303+
function filetypeForProducttype (productType) {
1304+
1305+
FILETYPE_BY_PRODUCTTYPE = {
1306+
'com.apple.product-type.application': '"wrapper.application"',
1307+
'com.apple.product-type.app-extension': '"wrapper.app-extension"',
1308+
'com.apple.product-type.bundle': '"wrapper.plug-in"',
1309+
'com.apple.product-type.tool': '"compiled.mach-o.dylib"',
1310+
'com.apple.product-type.library.dynamic': '"compiled.mach-o.dylib"',
1311+
'com.apple.product-type.framework': '"wrapper.framework"',
1312+
'com.apple.product-type.library.static': '"archive.ar"',
1313+
'com.apple.product-type.bundle.unit-test': '"wrapper.cfbundle"',
1314+
'com.apple.product-type.application.watchapp': '"wrapper.application"',
1315+
'com.apple.product-type.watchkit-extension': '"wrapper.app-extension"'
1316+
};
1317+
1318+
return FILETYPE_BY_PRODUCTTYPE[productType]
1319+
}
1320+
13031321
pbxProject.prototype.getFirstProject = function() {
13041322

13051323
// Get pbxProject container

0 commit comments

Comments
 (0)