@@ -709,7 +709,7 @@ function pbxFileReferenceObj(file) {
709709 obj . lastKnownFileType = file . lastType ;
710710
711711 obj . name = "\"" + file . basename + "\"" ;
712- obj . path = "\"" + file . path + "\"" ;
712+ obj . path = "\"" + file . path . replace ( / \\ / g , '/' ) + "\"" ;
713713
714714 obj . sourceTree = file . sourceTree ;
715715
@@ -751,28 +751,22 @@ function longComment(file) {
751751
752752// respect <group> path
753753function correctForPluginsPath ( file , project ) {
754- var r_plugin_dir = / ^ P l u g i n s \/ / ;
755-
756- if ( project . pbxGroupByName ( 'Plugins' ) . path )
757- file . path = file . path . replace ( r_plugin_dir , '' ) ;
758-
759- return file ;
754+ return correctForPath ( file , project , 'Plugins' ) ;
760755}
761756
762757function correctForResourcesPath ( file , project ) {
763- var r_resources_dir = / ^ R e s o u r c e s \/ / ;
764-
765- if ( project . pbxGroupByName ( 'Resources' ) . path )
766- file . path = file . path . replace ( r_resources_dir , '' ) ;
767-
768- return file ;
758+ return correctForPath ( file , project , 'Resources' ) ;
769759}
770760
771761function correctForFrameworksPath ( file , project ) {
772- var r_resources_dir = / ^ F r a m e w o r k s \/ / ;
762+ return correctForPath ( file , project , 'Frameworks' ) ;
763+ }
764+
765+ function correctForPath ( file , project , group ) {
766+ var r_group_dir = new RegExp ( '^' + group + '[\\\\/]' ) ;
773767
774- if ( project . pbxGroupByName ( 'Frameworks' ) . path )
775- file . path = file . path . replace ( r_resources_dir , '' ) ;
768+ if ( project . pbxGroupByName ( group ) . path )
769+ file . path = file . path . replace ( r_group_dir , '' ) ;
776770
777771 return file ;
778772}
0 commit comments