@@ -653,7 +653,7 @@ function pbxFileReferenceObj(file) {
653653 obj . lastKnownFileType = file . lastType ;
654654
655655 obj . name = "\"" + file . basename + "\"" ;
656- obj . path = "\"" + file . path + "\"" ;
656+ obj . path = "\"" + file . path . replace ( / \\ / g , '/' ) + "\"" ;
657657
658658 obj . sourceTree = file . sourceTree ;
659659
@@ -695,28 +695,22 @@ function longComment(file) {
695695
696696// respect <group> path
697697function correctForPluginsPath ( file , project ) {
698- var r_plugin_dir = / ^ P l u g i n s \/ / ;
699-
700- if ( project . pbxGroupByName ( 'Plugins' ) . path )
701- file . path = file . path . replace ( r_plugin_dir , '' ) ;
702-
703- return file ;
698+ return correctForPath ( file , project , 'Plugins' ) ;
704699}
705700
706701function correctForResourcesPath ( file , project ) {
707- var r_resources_dir = / ^ R e s o u r c e s \/ / ;
708-
709- if ( project . pbxGroupByName ( 'Resources' ) . path )
710- file . path = file . path . replace ( r_resources_dir , '' ) ;
711-
712- return file ;
702+ return correctForPath ( file , project , 'Resources' ) ;
713703}
714704
715705function correctForFrameworksPath ( file , project ) {
716- var r_resources_dir = / ^ F r a m e w o r k s \/ / ;
706+ return correctForPath ( file , project , 'Frameworks' ) ;
707+ }
708+
709+ function correctForPath ( file , project , group ) {
710+ var r_group_dir = new RegExp ( '^' + group + '[\\\\/]' ) ;
717711
718- if ( project . pbxGroupByName ( 'Frameworks' ) . path )
719- file . path = file . path . replace ( r_resources_dir , '' ) ;
712+ if ( project . pbxGroupByName ( group ) . path )
713+ file . path = file . path . replace ( r_group_dir , '' ) ;
720714
721715 return file ;
722716}
0 commit comments