Changeset 290
- Timestamp:
- 02/03/08 10:07:22 (1 year ago)
- Files:
-
- trunk/cocoa/mogenerator/Xmod/Xmod.applescript (modified) (2 diffs)
- trunk/cocoa/mogenerator/Xmod/Xmod.m (modified) (4 diffs)
- trunk/cocoa/mogenerator/Xmod/Xmod.xcodeproj/wolf.mode1v3 (modified) (7 diffs)
- trunk/cocoa/mogenerator/Xmod/Xmod.xcodeproj/wolf.pbxuser (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cocoa/mogenerator/Xmod/Xmod.applescript
r262 r290 2 2 if not (exists active project document) then  3 3 error "No active project. Please open an Xcode project and re-run the script." 4 my updateProjectXmod(project of active project document) 4 try 5 my updateProjectXmod(project of active project document) 6 on error errMsg 7 my logger("Xmod.scpt exception: " & errMsg) 8 end try 5 9 end tell 6 10 … … 80 84 return text 1 thru -2 of (POSIX path of (modelSrcFolder as alias)) -- kill the trailing slash 81 85 end modelSrcDirPath 86 87 on logger(msg) 88 do shell script "logger '" & msg & "'" 89 end logger trunk/cocoa/mogenerator/Xmod/Xmod.m
r289 r290 1 1 #import "Xmod.h" 2 2 #import "JRSwizzle.h" 3 4 /* 5 Xcode 2.4 6 10.4 SDK ppc, i386 7 Xcode 2.5 8 10.5 SDK ppc, i386 9 Xcode 3.0 10 10.5 SDK ppc GC, ppc64 GC, i386 GC, x86_64 GC 11 */ 3 12 4 13 @interface NSObject (xmod_saveModelToFile) … … 47 56 } else if ([xcodeVersion isEqualToString:@"2.5"]) { 48 57 coreDataPlugin = [NSBundle bundleWithPath:@"/Xcode2.5/Library/Xcode/Plug-ins/XDCoreDataModel.xdplugin"]; 58 } else if ([xcodeVersion isEqualToString:@"3.0"]) { 59 coreDataPlugin = [NSBundle bundleWithPath:@"/Developer/Library/Xcode/Plug-ins/XDCoreDataModel.xdplugin"]; 49 60 } else { 50 61 NSLog(@"Xmod: unknown Xcode version (%@), exiting.", xcodeVersion); … … 81 92 NSString *scriptPath = [bundle pathForResource:scriptName_ ofType:@"scpt" inDirectory:@"Scripts"]; 82 93 NSAssert1(scriptPath, @"failed to find %@.scpt", scriptName_); 94 #if 1 95 NSTask *osascriptTask = [[[NSTask alloc] init] autorelease]; 96 [osascriptTask setLaunchPath:@"/usr/bin/osascript"]; 97 [osascriptTask setArguments:[NSArray arrayWithObject:scriptPath]]; 98 [osascriptTask launch]; 99 #else 100 // Executing an AppleScript inside Xcode's context is weird. 101 // Scripts like `tell app "Finder" to get folder of file` simply fail. I suspect rogue 102 // coercion handlers or namespace bugs. So now I just fire off an osascript invocation 103 // to give the script a clean nonweird enironment. 83 104 NSDictionary *scriptInitError = nil; 84 105 NSAppleScript *script = [[[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:scriptPath] … … 90 111 NSAssert2(!scriptInitError, @"failed to execute %@.scpt: %@", scriptName_, scriptExecuteError); 91 112 } 113 #endif 92 114 } 93 115 trunk/cocoa/mogenerator/Xmod/Xmod.xcodeproj/wolf.mode1v3
r289 r290 278 278 <array> 279 279 <array> 280 <integer>8</integer> 281 <integer>7</integer> 280 282 <integer>0</integer> 281 283 </array> … … 301 303 </array> 302 304 <key>RubberWindowFrame</key> 303 <string> 537 534853 471 0 0 1680 1028 </string>305 <string>799 479 853 471 0 0 1680 1028 </string> 304 306 </dict> 305 307 <key>Module</key> … … 338 340 <string>{{0, 0}, {645, 0}}</string> 339 341 <key>RubberWindowFrame</key> 340 <string> 537 534853 471 0 0 1680 1028 </string>342 <string>799 479 853 471 0 0 1680 1028 </string> 341 343 </dict> 342 344 <key>Module</key> … … 358 360 <string>{{0, 5}, {645, 425}}</string> 359 361 <key>RubberWindowFrame</key> 360 <string> 537 534853 471 0 0 1680 1028 </string>362 <string>799 479 853 471 0 0 1680 1028 </string> 361 363 </dict> 362 364 <key>Module</key> … … 382 384 <key>TableOfContents</key> 383 385 <array> 384 <string>79 1E10A60D56394C0043AD7E</string>386 <string>79A40F110D56713F003978D3</string> 385 387 <string>1CE0B1FE06471DED0097A5F4</string> 386 <string>79 1E10A70D56394C0043AD7E</string>388 <string>79A40F120D56713F003978D3</string> 387 389 <string>1CE0B20306471E060097A5F4</string> 388 390 <string>1CE0B20506471E060097A5F4</string> … … 516 518 <key>WindowOrderList</key> 517 519 <array> 518 <string>79E65E2C0D56333100B09941</string> 520 <string>79EAFC590D5670CD00578856</string> 521 <string>79EAFC5C0D5670CD00578856</string> 522 <string>79EAFC620D5670CD00578856</string> 519 523 <string>/Users/wolf/code/trac/cocoa/mogenerator/Xmod/Xmod.xcodeproj</string> 520 524 </array> 521 525 <key>WindowString</key> 522 <string> 537 534853 471 0 0 1680 1028 </string>526 <string>799 479 853 471 0 0 1680 1028 </string> 523 527 <key>WindowToolsV3</key> 524 528 <array> … … 597 601 <array> 598 602 <string>79E65E2C0D56333100B09941</string> 599 <string>79 1E10A80D56394C0043AD7E</string>603 <string>79EAFBEB0D56422400578856</string> 600 604 <string>1CD0528F0623707200166675</string> 601 605 <string>XCMainBuildResultsModuleGUID</string> trunk/cocoa/mogenerator/Xmod/Xmod.xcodeproj/wolf.pbxuser
r289 r290 78 78 ); 79 79 }; 80 PBXPerProjectTemplateStateSaveDate = 2237 54547;81 PBXWorkspaceStateSaveDate = 2237 54547;80 PBXPerProjectTemplateStateSaveDate = 223768887; 81 PBXWorkspaceStateSaveDate = 223768887; 82 82 }; 83 83 sourceControlManager = 79DFC1170B59B8870056C80E /* Source Control */; … … 115 115 79DFC11E0B59B8C80056C80E /* Xmod.m */ = { 116 116 uiCtxt = { 117 sepNavIntBoundsRect = "{{0, 0}, {862, 1 330}}";118 sepNavSelRange = "{ 0, 0}";119 sepNavVisRange = "{ 0, 2028}";117 sepNavIntBoundsRect = "{{0, 0}, {862, 1638}}"; 118 sepNavSelRange = "{3850, 0}"; 119 sepNavVisRange = "{1817, 2608}"; 120 120 sepNavVisRect = "{{0, 0}, {882, 799}}"; 121 121 sepNavWindowFrame = "{{396, 112}, {921, 904}}";
