1
1
var $path = require ( 'path' ) ,
2
2
util = require ( 'util' ) ,
3
3
M_EXTENSION = / [ . ] m $ / , SOURCE_FILE = 'sourcecode.c.objc' ,
4
+ C_EXTENSION = / [ . ] c $ / , C_SOURCE_FILE = 'sourcecode.c' ,
4
5
H_EXTENSION = / [ . ] h $ / , HEADER_FILE = 'sourcecode.c.h' ,
6
+ MM_EXTENSION = / [ . ] m m $ / , MM_SOURCE_FILE = 'sourcecode.cpp.objcpp' ,
7
+ HPP_EXTENSION = / [ . ] ( h p p | h x x | h \+ \+ | h h ) $ / , CPP_HEADER_FILE = 'sourcecode.cpp.h' ,
8
+ CPP_EXTENSION = / [ . ] ( c p p | c x x | c \+ \+ | c c ) $ / , CPP_SOURCE_FILE = 'sourcecode.cpp.cpp' ,
5
9
BUNDLE_EXTENSION = / [ . ] b u n d l e $ / , BUNDLE = '"wrapper.plug-in"' ,
6
10
XIB_EXTENSION = / [ . ] x i b $ / , XIB_FILE = 'file.xib' ,
7
11
DYLIB_EXTENSION = / [ . ] d y l i b $ / , DYLIB = '"compiled.mach-o.dylib"' ,
@@ -13,24 +17,40 @@ var $path = require('path'),
13
17
14
18
function fileTypes ( ) {
15
19
return {
16
- SOURCE_FILE : SOURCE_FILE ,
17
- HEADER_FILE : HEADER_FILE ,
18
- BUNDLE : BUNDLE ,
19
- XIB_FILE : XIB_FILE ,
20
- FRAMEWORK : FRAMEWORK ,
21
- DYLIB : DYLIB ,
22
- ARCHIVE : ARCHIVE ,
23
- PNG_IMAGE : PNG_IMAGE
20
+ SOURCE_FILE ,
21
+ C_SOURCE_FILE ,
22
+ HEADER_FILE ,
23
+ MM_SOURCE_FILE ,
24
+ CPP_HEADER_FILE ,
25
+ CPP_SOURCE_FILE ,
26
+ BUNDLE ,
27
+ XIB_FILE ,
28
+ FRAMEWORK ,
29
+ DYLIB ,
30
+ ARCHIVE ,
31
+ PNG_IMAGE ,
24
32
}
25
33
}
26
34
27
35
function detectLastType ( path ) {
28
36
if ( M_EXTENSION . test ( path ) )
29
37
return SOURCE_FILE ;
30
38
39
+ if ( C_EXTENSION . test ( path ) )
40
+ return C_SOURCE_FILE ;
41
+
31
42
if ( H_EXTENSION . test ( path ) )
32
43
return HEADER_FILE ;
33
44
45
+ if ( MM_EXTENSION . test ( path ) )
46
+ return MM_SOURCE_FILE ;
47
+
48
+ if ( CPP_EXTENSION . test ( path ) )
49
+ return CPP_SOURCE_FILE ;
50
+
51
+ if ( HPP_EXTENSION . test ( path ) )
52
+ return CPP_HEADER_FILE ;
53
+
34
54
if ( BUNDLE_EXTENSION . test ( path ) )
35
55
return BUNDLE ;
36
56
@@ -45,10 +65,10 @@ function detectLastType(path) {
45
65
46
66
if ( ARCHIVE_EXTENSION . test ( path ) )
47
67
return ARCHIVE ;
48
-
68
+
49
69
if ( PNG_EXTENSION . test ( path ) )
50
70
return PNG_IMAGE ;
51
-
71
+
52
72
// dunno
53
73
return 'unknown' ;
54
74
}
@@ -105,7 +125,7 @@ function pbxFile(filepath, opt) {
105
125
this . sourceTree = opt . sourceTree || defaultSourceTree ( this ) ;
106
126
this . fileEncoding = opt . fileEncoding || fileEncoding ( this ) ;
107
127
108
- if ( opt . weak && opt . weak === true )
128
+ if ( opt . weak && opt . weak === true )
109
129
this . settings = { ATTRIBUTES : [ 'Weak' ] } ;
110
130
111
131
if ( opt . compilerFlags ) {
0 commit comments