Changeset 236
- Timestamp:
- 07/10/07 11:36:35 (2 years ago)
- Files:
-
- trunk/cocoa/mogenerator/mogenerator.m (modified) (4 diffs)
- trunk/cocoa/mogenerator/mogenerator.xcodeproj/wolf.mode1 (modified) (12 diffs)
- trunk/cocoa/mogenerator/mogenerator.xcodeproj/wolf.pbxuser (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cocoa/mogenerator/mogenerator.m
r228 r236 138 138 139 139 NSString *ApplicationSupportSubdirectoryName = @"mogenerator"; 140 NSString *gTemplatePath = nil; 140 141 static NSString* appSupportFileNamed(NSString *fileName_) { 141 NSArray *appSupportDirectories = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask+NSLocalDomainMask, YES);142 assert(appSupportDirectories);143 144 142 NSFileManager *fileManager = [NSFileManager defaultManager]; 145 143 BOOL isDirectory; 146 144 147 nsenumerate (appSupportDirectories, NSString*, appSupportDirectory) { 148 if ([fileManager fileExistsAtPath:appSupportDirectory isDirectory:&isDirectory]) { 149 NSString *appSupportSubdirectory = [appSupportDirectory stringByAppendingPathComponent:ApplicationSupportSubdirectoryName]; 150 if ([fileManager fileExistsAtPath:appSupportSubdirectory isDirectory:&isDirectory] && isDirectory) { 151 NSString *appSupportFile = [appSupportSubdirectory stringByAppendingPathComponent:fileName_]; 152 if ([fileManager fileExistsAtPath:appSupportFile isDirectory:&isDirectory] && !isDirectory) { 153 return appSupportFile; 145 if (gTemplatePath) { 146 if ([fileManager fileExistsAtPath:gTemplatePath isDirectory:&isDirectory] && isDirectory) { 147 return [gTemplatePath stringByAppendingPathComponent:fileName_]; 148 } 149 } else { 150 NSArray *appSupportDirectories = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask+NSLocalDomainMask, YES); 151 assert(appSupportDirectories); 152 153 nsenumerate (appSupportDirectories, NSString*, appSupportDirectory) { 154 if ([fileManager fileExistsAtPath:appSupportDirectory isDirectory:&isDirectory]) { 155 NSString *appSupportSubdirectory = [appSupportDirectory stringByAppendingPathComponent:ApplicationSupportSubdirectoryName]; 156 if ([fileManager fileExistsAtPath:appSupportSubdirectory isDirectory:&isDirectory] && isDirectory) { 157 NSString *appSupportFile = [appSupportSubdirectory stringByAppendingPathComponent:fileName_]; 158 if ([fileManager fileExistsAtPath:appSupportFile isDirectory:&isDirectory] && !isDirectory) { 159 return appSupportFile; 160 } 154 161 } 155 162 } … … 171 178 opt_model, 172 179 opt_baseClass, 173 opt_includem 180 opt_includem, 181 opt_templatePath 174 182 }; 175 183 … … 188 196 LONG_OPT(opt_baseClass, required_argument), 189 197 LONG_OPT(opt_includem, required_argument), 198 LONG_OPT(opt_templatePath, required_argument), 190 199 LONG_OPT_LAST 191 200 }; … … 225 234 break; 226 235 case opt_version: 227 printf("mogenerator 1.2. By Jonathan 'Wolf' Rentzsch + friends.\n"); 236 printf("mogenerator 1.3. By Jonathan 'Wolf' Rentzsch + friends.\n"); 237 break; 238 case opt_templatePath: 239 gTemplatePath = [NSString stringWithUTF8String:optarg]; 228 240 break; 229 241 case opt_help: 230 242 default: 231 printf("mogenerator [-model /path/to/file.xcdatamodel] [-baseClass MyBaseClassMO] [-includem include.m] [-version] [- help]\n");243 printf("mogenerator [-model /path/to/file.xcdatamodel] [-baseClass MyBaseClassMO] [-includem include.m] [-version] [-templatePath] [-help]\n"); 232 244 printf("Implements generation gap codegen pattern for Core Data. Inspired by eogenerator.\n"); 233 245 } trunk/cocoa/mogenerator/mogenerator.xcodeproj/wolf.mode1
r228 r236 264 264 <array> 265 265 <array> 266 <integer>12</integer> 267 <integer>11</integer> 266 <integer>2</integer> 267 <integer>1</integer> 268 <integer>0</integer> 268 269 </array> 269 270 </array> … … 288 289 </array> 289 290 <key>RubberWindowFrame</key> 290 <string> 1572 956 690 397 0 0 2560 1578 </string>291 <string>881 554 690 397 0 0 1680 1028 </string> 291 292 </dict> 292 293 <key>Module</key> … … 325 326 <string>{{0, 0}, {376, 0}}</string> 326 327 <key>RubberWindowFrame</key> 327 <string> 1572 956 690 397 0 0 2560 1578 </string>328 <string>881 554 690 397 0 0 1680 1028 </string> 328 329 </dict> 329 330 <key>Module</key> … … 345 346 <string>{{0, 5}, {376, 351}}</string> 346 347 <key>RubberWindowFrame</key> 347 <string> 1572 956 690 397 0 0 2560 1578 </string>348 <string>881 554 690 397 0 0 1680 1028 </string> 348 349 </dict> 349 350 <key>Module</key> … … 369 370 <key>TableOfContents</key> 370 371 <array> 371 <string>79 1B1CD70BD8838600537AB8</string>372 <string>793FF9560C43E2AE00E68F6D</string> 372 373 <string>1CE0B1FE06471DED0097A5F4</string> 373 <string>79 1B1CD80BD8838600537AB8</string>374 <string>793FF9570C43E2AE00E68F6D</string> 374 375 <string>1CE0B20306471E060097A5F4</string> 375 376 <string>1CE0B20506471E060097A5F4</string> … … 509 510 </array> 510 511 <key>WindowString</key> 511 <string> 1572 956 690 397 0 0 2560 1578 </string>512 <string>881 554 690 397 0 0 1680 1028 </string> 512 513 <key>WindowTools</key> 513 514 <array> … … 530 531 <string>1CD0528F0623707200166675</string> 531 532 <key>PBXProjectModuleLabel</key> 532 <string> </string>533 <string><No Editor></string> 533 534 <key>StatusBarVisibility</key> 534 535 <true/> … … 539 540 <string>{{0, 0}, {500, 218}}</string> 540 541 <key>RubberWindowFrame</key> 541 <string> 79 1008 500 500 0 0 2560 1578 </string>542 <string>45 495 500 500 0 0 1680 1028 </string> 542 543 </dict> 543 544 <key>Module</key> … … 547 548 </dict> 548 549 <dict> 549 <key>BecomeActive</key>550 <true/>551 550 <key>ContentConfiguration</key> 552 551 <dict> 553 <key>PBXBuildLogShowsTranscriptDefaultKey</key>554 <string>{{0, 82}, {500, 154}}</string>555 552 <key>PBXProjectModuleGUID</key> 556 553 <string>XCMainBuildResultsModuleGUID</string> … … 567 564 <string>{{0, 223}, {500, 236}}</string> 568 565 <key>RubberWindowFrame</key> 569 <string> 79 1008 500 500 0 0 2560 1578 </string>566 <string>45 495 500 500 0 0 1680 1028 </string> 570 567 </dict> 571 568 <key>Module</key> … … 590 587 <array> 591 588 <string>79D2BF1B0ACFAF4A00F3F141</string> 592 <string>79 1B1CD60BD8837E00537AB8</string>589 <string>793FF9660C43E7F400E68F6D</string> 593 590 <string>1CD0528F0623707200166675</string> 594 591 <string>XCMainBuildResultsModuleGUID</string> … … 597 594 <string>xcode.toolbar.config.build</string> 598 595 <key>WindowString</key> 599 <string> 79 1008 500 500 0 0 2560 1578 </string>596 <string>45 495 500 500 0 0 1680 1028 </string> 600 597 <key>WindowToolGUID</key> 601 598 <string>79D2BF1B0ACFAF4A00F3F141</string> trunk/cocoa/mogenerator/mogenerator.xcodeproj/wolf.pbxuser
r228 r236 73 73 ); 74 74 }; 75 PBXPerProjectTemplateStateSaveDate = 198731122;76 PBXWorkspaceStateSaveDate = 198731122;75 PBXPerProjectTemplateStateSaveDate = 205775531; 76 PBXWorkspaceStateSaveDate = 205775531; 77 77 }; 78 78 sourceControlManager = 79D2BF0B0ACFAE0700F3F141 /* Source Control */; … … 82 82 08FB7796FE84155DC02AAC07 /* mogenerator.m */ = { 83 83 uiCtxt = { 84 sepNavIntBoundsRect = "{{0, 0}, {1057, 4 704}}";85 sepNavSelRange = "{ 0, 0}";84 sepNavIntBoundsRect = "{{0, 0}, {1057, 4872}}"; 85 sepNavSelRange = "{4598, 0}"; 86 86 sepNavVisRect = "{{0, 0}, {1057, 777}}"; 87 sepNavWindowFrame = "{{ 1444, 743}, {1096, 835}}";87 sepNavWindowFrame = "{{542, 178}, {1096, 835}}"; 88 88 }; 89 89 };
