Add helper filetypeForProducttype() method for resolving filetypes for product types.
diff --git a/lib/pbxProject.js b/lib/pbxProject.js
index 1f0c330..3e76e4b 100644
--- a/lib/pbxProject.js
+++ b/lib/pbxProject.js
@@ -1300,6 +1300,24 @@
return PRODUCTTYPE_BY_TARGETTYPE[targetType]
}
+function filetypeForProducttype (productType) {
+
+ FILETYPE_BY_PRODUCTTYPE = {
+ 'com.apple.product-type.application': '"wrapper.application"',
+ 'com.apple.product-type.app-extension': '"wrapper.app-extension"',
+ 'com.apple.product-type.bundle': '"wrapper.plug-in"',
+ 'com.apple.product-type.tool': '"compiled.mach-o.dylib"',
+ 'com.apple.product-type.library.dynamic': '"compiled.mach-o.dylib"',
+ 'com.apple.product-type.framework': '"wrapper.framework"',
+ 'com.apple.product-type.library.static': '"archive.ar"',
+ 'com.apple.product-type.bundle.unit-test': '"wrapper.cfbundle"',
+ 'com.apple.product-type.application.watchapp': '"wrapper.application"',
+ 'com.apple.product-type.watchkit-extension': '"wrapper.app-extension"'
+ };
+
+ return FILETYPE_BY_PRODUCTTYPE[productType]
+}
+
pbxProject.prototype.getFirstProject = function() {
// Get pbxProject container