@@ -491,6 +491,49 @@ pbxProject.prototype.addToLibrarySearchPaths = function (file) {
491
491
}
492
492
}
493
493
494
+ pbxProject . prototype . removeFromHeaderSearchPaths = function ( file ) {
495
+ var configurations = nonComments ( this . pbxXCBuildConfigurationSection ( ) ) ,
496
+ INHERITED = '"$(inherited)"' ,
497
+ SEARCH_PATHS = 'HEADER_SEARCH_PATHS' ,
498
+ config , buildSettings , searchPaths ;
499
+ var new_path = searchPathForFile ( file , this ) ;
500
+
501
+ for ( config in configurations ) {
502
+ buildSettings = configurations [ config ] . buildSettings ;
503
+
504
+ if ( unquote ( buildSettings [ 'PRODUCT_NAME' ] ) != this . productName )
505
+ continue ;
506
+
507
+ if ( buildSettings [ SEARCH_PATHS ] ) {
508
+ var matches = buildSettings [ SEARCH_PATHS ] . filter ( function ( p ) {
509
+ return p . indexOf ( new_path ) > - 1 ;
510
+ } ) ;
511
+ matches . forEach ( function ( m ) {
512
+ var idx = buildSettings [ SEARCH_PATHS ] . indexOf ( m ) ;
513
+ buildSettings [ SEARCH_PATHS ] . splice ( idx , 1 ) ;
514
+ } ) ;
515
+ }
516
+
517
+ }
518
+ }
519
+ pbxProject . prototype . addToHeaderSearchPaths = function ( file ) {
520
+ var configurations = nonComments ( this . pbxXCBuildConfigurationSection ( ) ) ,
521
+ INHERITED = '"$(inherited)"' ,
522
+ config , buildSettings , searchPaths ;
523
+
524
+ for ( config in configurations ) {
525
+ buildSettings = configurations [ config ] . buildSettings ;
526
+
527
+ if ( unquote ( buildSettings [ 'PRODUCT_NAME' ] ) != this . productName )
528
+ continue ;
529
+
530
+ if ( ! buildSettings [ 'HEADER_SEARCH_PATHS' ] ) {
531
+ buildSettings [ 'HEADER_SEARCH_PATHS' ] = [ INHERITED ] ;
532
+ }
533
+
534
+ buildSettings [ 'HEADER_SEARCH_PATHS' ] . push ( searchPathForFile ( file , this ) ) ;
535
+ }
536
+ }
494
537
// a JS getter. hmmm
495
538
pbxProject . prototype . __defineGetter__ ( "productName" , function ( ) {
496
539
var configurations = nonComments ( this . pbxXCBuildConfigurationSection ( ) ) ,
0 commit comments