@@ -6,39 +6,54 @@ namespace UnityEditor.XCodeEditor
66 public class XCBuildConfiguration : PBXObject
77 {
88 protected const string BUILDSETTINGS_KEY = "buildSettings" ;
9- protected const string HEADER_SEARCH_PATH_KEY = "HEADER_SEARCH_PATH " ;
10- protected const string LIBRARY_SEARCH_PATH_KEY = "LIBRARY_SEARCH_PATH " ;
9+ protected const string HEADER_SEARCH_PATHS_KEY = "HEADER_SEARCH_PATHS " ;
10+ protected const string LIBRARY_SEARCH_PATHS_KEY = "LIBRARY_SEARCH_PATHS " ;
1111 protected const string OTHER_C_FLAGS_KEY = "OTHER_CFLAGS" ;
1212
13- public bool AddSearchPaths ( string path , string basePath , string key , bool recursive = true )
13+ public XCBuildConfiguration ( string guid , PBXDictionary dictionary ) : base ( guid , dictionary )
14+ {
15+
16+ }
17+
18+ public PBXDictionary buildSettings {
19+ get {
20+ if ( ContainsKey ( BUILDSETTINGS_KEY ) )
21+ return ( PBXDictionary ) this [ BUILDSETTINGS_KEY ] ;
22+
23+ Debug . Log ( "strano" ) ;
24+ return null ;
25+ }
26+ }
27+
28+ protected bool AddSearchPaths ( string path , string key , bool recursive = true )
1429 {
1530 PBXList paths = new PBXList ( ) ;
1631 paths . Add ( path ) ;
17- return AddSearchPaths ( paths , basePath , key , recursive ) ;
32+ return AddSearchPaths ( paths , key , recursive ) ;
1833 }
1934
20- public bool AddSearchPaths ( PBXList paths , string basePath , string key , bool recursive = true )
21- {
35+ protected bool AddSearchPaths ( PBXList paths , string key , bool recursive = true )
36+ {
2237 bool modified = false ;
2338
24- if ( ! ContainsKey ( basePath ) )
25- this . Add ( basePath , new PBXDictionary ( ) ) ;
39+ if ( ! ContainsKey ( BUILDSETTINGS_KEY ) )
40+ this . Add ( BUILDSETTINGS_KEY , new PBXDictionary ( ) ) ;
2641
2742 foreach ( string path in paths ) {
2843 string currentPath = path ;
2944 if ( recursive && ! path . EndsWith ( "/**" ) )
3045 currentPath += "**" ;
3146
32- if ( ! ( ( PBXDictionary ) this [ basePath ] ) . ContainsKey ( key ) ) {
33- ( ( PBXDictionary ) this [ basePath ] ) . Add ( key , new PBXList ( ) ) ;
47+ if ( ! ( ( PBXDictionary ) this [ BUILDSETTINGS_KEY ] ) . ContainsKey ( key ) ) {
48+ ( ( PBXDictionary ) this [ BUILDSETTINGS_KEY ] ) . Add ( key , new PBXList ( ) ) ;
3449 }
35- else if ( ( ( PBXDictionary ) this [ basePath ] ) [ key ] is string ) {
50+ else if ( ( ( PBXDictionary ) this [ BUILDSETTINGS_KEY ] ) [ key ] is string ) {
3651 PBXList list = new PBXList ( ) ;
37- list . Add ( ( ( PBXDictionary ) this [ basePath ] ) [ key ] ) ;
38- ( ( PBXDictionary ) this [ basePath ] ) [ key ] = list ;
52+ list . Add ( ( ( PBXDictionary ) this [ BUILDSETTINGS_KEY ] ) [ key ] ) ;
53+ ( ( PBXDictionary ) this [ BUILDSETTINGS_KEY ] ) [ key ] = list ;
3954 }
4055
41- if ( ( ( PBXList ) ( ( PBXDictionary ) this [ basePath ] ) [ key ] ) . Add ( "\" " + currentPath + "\" " ) >= 0 ) {
56+ if ( ( ( PBXList ) ( ( PBXDictionary ) this [ BUILDSETTINGS_KEY ] ) [ key ] ) . Add ( "\" " + currentPath + "\" " ) >= 0 ) {
4257 modified = true ;
4358 }
4459 }
@@ -48,23 +63,26 @@ public bool AddSearchPaths( PBXList paths, string basePath, string key, bool rec
4863
4964 public bool AddHeaderSearchPaths ( PBXList paths , bool recursive = true )
5065 {
51- return this . AddSearchPaths ( paths , "buildSettings" , "HEADER_SEARCH_PATHS" , recursive ) ;
66+ return this . AddSearchPaths ( paths , HEADER_SEARCH_PATHS_KEY , recursive ) ;
5267 }
5368
54- public bool AddLibrarySearchPath ( PBXList paths , bool recursive = true )
69+ public bool AddLibrarySearchPaths ( PBXList paths , bool recursive = true )
5570 {
56- return this . AddSearchPaths ( paths , "buildSettings" , "LIBRARY_SEARCH_PATHS" , recursive ) ;
71+ return this . AddSearchPaths ( paths , LIBRARY_SEARCH_PATHS_KEY , recursive ) ;
5772 }
5873
5974 public bool AddOtherCFlags ( string flag )
6075 {
76+ Debug . Log ( "INIZIO 1" ) ;
6177 PBXList flags = new PBXList ( ) ;
6278 flags . Add ( flag ) ;
6379 return AddOtherCFlags ( flags ) ;
6480 }
6581
6682 public bool AddOtherCFlags ( PBXList flags )
6783 {
84+ Debug . Log ( "INIZIO 2" ) ;
85+
6886 bool modified = false ;
6987
7088 if ( ! ContainsKey ( BUILDSETTINGS_KEY ) )
0 commit comments