XcodeEditor icon indicating copy to clipboard operation
XcodeEditor copied to clipboard

RootGroup isn't correctly resolved for project

Open PaulTaykalo opened this issue 14 years ago • 1 comments

I have an Xcode project, for which current library will return (null) for root group. Xcode project successfully parsing

it has next structure:

Groups of project,

      for (xcode_Group * group in [_xcodeProject groups]) {
         NSLog(@"Groupd : %@  : %@ : %@ : %@", 
            [group pathRelativeToParent], 
            [group alias], 
            [group key], 
            [[group parentGroup] key]);
      }

Group (null) : Products : 32005DD2DD4BE82AFAA88C83 : (null) Group (null) : Products : 320CC833B8AF0ACFD35E6223 : (null) Group (null) : Products : 3201088596B4756681693703 : (null) Group (null) : Products : 44B36DE71303E461005FD12F : (null) Group (null) : core : 44B36B581303DF6D005FD12F : 44B35F971303DE12005FD12F Group (null) : Products : 320A737074758E53BA54BE93 : (null) Group (null) : Bundles : 29B97317FDCFA39411CA2CEA : 29B97314FDCFA39411CA2CEA Group (null) : Resources : 4459EE0F13040CD200AD8ACE : 29B97314FDCFA39411CA2CEA Group (null) : Products : 320A2827FEC940B25BC42C63 : (null) Group (null) : Products : 320D7DCCE32703ACAB9A45E3 : (null) Group (null) : Products : 19C28FACFE9D520D11CA2CBB : 29B97314FDCFA39411CA2CEA Group (null) : Products : 44B36DC31303E3DB005FD12F : (null) Group Libs/core/Libs/iphone-news-library/Libs/GData : GData : 44B36F921303E56C005FD12F : 44B36C041303E126005FD12F Group Libs : (null) : 44B35F971303DE12005FD12F : 29B97314FDCFA39411CA2CEA Group Config : (null) : 442E0403130E93A100A65FDB : 29B97314FDCFA39411CA2CEA Group Classes : (null) : 080E96DDFE201D6D7F000001 : 29B97314FDCFA39411CA2CEA Group (null) : CustomTemplate : 29B97314FDCFA39411CA2CEA : (null) Group (null) : Products : 320F2C48872C2E2C4DF86203 : (null) Group Libs/core/Libs/Flurry : Flurry : 44B36DD51303E433005FD12F : 44B36C041303E126005FD12F Group (null) : Core : E4493B5E155D358B007682BE : 29B97314FDCFA39411CA2CEA Group (null) : Products : 44B36E091303E4A7005FD12F : (null) Group (null) : Frameworks : 44B36C041303E126005FD12F : 29B97314FDCFA39411CA2CEA Group (null) : Products : 320A5A189C235877202780D3 : (null) Group (null) : Other Sources : 29B97315FDCFA39411CA2CEA : 29B97314FDCFA39411CA2CEA

It seems, that root group can have Alias (CustomTemplate in this example), and one or both items should be fixed:

- (BOOL) isRootGroup {
    return [self pathRelativeToParent] == nil && [self displayName] == nil;
}


- (NSString*) displayName {
    if (_pathRelativeToParent == nil) {  
        return _alias;
    }
    else {
        return [_pathRelativeToParent lastPathComponent];
    }
}

Sorry, cannot provide a .xcodeproj file

PaulTaykalo avatar May 11 '12 12:05 PaulTaykalo

Would you like to create an issue? I'm not sure i will have time to look at it right away :(

I will certainly accept a pull request of you have the time.

Otherwise will address ASAP.

Sent from my iPod

On May 11, 2012, at 8:19 PM, "tt.kilew"[email protected] wrote:

I have an Xcode project, for which current library will return (null) for root group. Xcode project successfully parsing

it has next structure:

Groups of project,

     for (xcode_Group * group in [_xcodeProject groups]) {
        NSLog(@"Groupd : %@  : %@ : %@ : %@", 
           [group pathRelativeToParent], 
           [group alias], 
           [group key], 
           [[group parentGroup] key]);
     }

Group (null) : Products : 32005DD2DD4BE82AFAA88C83 : (null) Group (null) : Products : 320CC833B8AF0ACFD35E6223 : (null) Group (null) : Products : 3201088596B4756681693703 : (null) Group (null) : Products : 44B36DE71303E461005FD12F : (null) Group (null) : core : 44B36B581303DF6D005FD12F : 44B35F971303DE12005FD12F Group (null) : Products : 320A737074758E53BA54BE93 : (null) Group (null) : Bundles : 29B97317FDCFA39411CA2CEA : 29B97314FDCFA39411CA2CEA Group (null) : Resources : 4459EE0F13040CD200AD8ACE : 29B97314FDCFA39411CA2CEA Group (null) : Products : 320A2827FEC940B25BC42C63 : (null) Group (null) : Products : 320D7DCCE32703ACAB9A45E3 : (null) Group (null) : Products : 19C28FACFE9D520D11CA2CBB : 29B97314FDCFA39411CA2CEA Group (null) : Products : 44B36DC31303E3DB005FD12F : (null) Group Libs/core/Libs/iphone-news-library/Libs/GData : GData : 44B36F921303E56C005FD12F : 44B36C041303E126005FD12F Group Libs : (null) : 44B35F971303DE12005FD12F : 29B97314FDCFA39411CA2CEA Group Config : (null) : 442E0403130E93A100A65FDB : 29B97314FDCFA39411CA2CEA Group Classes : (null) : 080E96DDFE201D6D7F000001 : 29B97314FDCFA39411CA2CEA Group (null) : CustomTemplate : 29B97314FDCFA39411CA2CEA : (null) Group (null) : Products : 320F2C48872C2E2C4DF86203 : (null) Group Libs/core/Libs/Flurry : Flurry : 44B36DD51303E433005FD12F : 44B36C041303E126005FD12F Group (null) : Core : E4493B5E155D358B007682BE : 29B97314FDCFA39411CA2CEA Group (null) : Products : 44B36E091303E4A7005FD12F : (null) Group (null) : Frameworks : 44B36C041303E126005FD12F : 29B97314FDCFA39411CA2CEA Group (null) : Products : 320A5A189C235877202780D3 : (null) Group (null) : Other Sources : 29B97315FDCFA39411CA2CEA : 29B97314FDCFA39411CA2CEA

It seems, that root group can have Alias (CustomTemplate in this example), and one or both items should be fixed:

- (BOOL) isRootGroup {
   return [self pathRelativeToParent] == nil && [self displayName] == nil;
}


- (NSString*) displayName {
   if (_pathRelativeToParent == nil) {  
       return _alias;
   }
   else {
       return [_pathRelativeToParent lastPathComponent];
   }
}

Sorry, cannot provide a .xcodeproj file


Reply to this email directly or view it on GitHub: https://github.com/expanz/xcode-editor/issues/12

jasperblues avatar May 12 '12 22:05 jasperblues