Skip to content

Commit a19508c

Browse files
committed
Add helper: productTypeForTargettype()
1 parent fc4473b commit a19508c

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
@@ -1165,6 +1165,24 @@ function unquote(str) {
11651165
if (str) return str.replace(/^"(.*)"$/, "$1");
11661166
}
11671167

1168+
function producttypeForTargettype (targetType) {
1169+
1170+
PRODUCTTYPE_BY_TARGETTYPE = {
1171+
application: 'com.apple.product-type.application',
1172+
app_extension: 'com.apple.product-type.app-extension',
1173+
bundle: 'com.apple.product-type.bundle',
1174+
command_line_tool: 'com.apple.product-type.tool',
1175+
dynamic_library: 'com.apple.product-type.library.dynamic',
1176+
framework: 'com.apple.product-type.framework',
1177+
static_library: 'com.apple.product-type.library.static',
1178+
unit_test_bundle: 'com.apple.product-type.bundle.unit-test',
1179+
watch_app: 'com.apple.product-type.application.watchapp',
1180+
watch_extension: 'com.apple.product-type.watchkit-extension'
1181+
};
1182+
1183+
return PRODUCTTYPE_BY_TARGETTYPE[targetType]
1184+
}
1185+
11681186
pbxProject.prototype.getFirstProject = function() {
11691187

11701188
// Get pbxProject container

0 commit comments

Comments
 (0)