Changeset 289

Show
Ignore:
Timestamp:
02/03/08 06:14:36 (1 year ago)
Author:
wolf
Message:

[NEW] Xmod: Migrate from MethodSwizzle? to JRSwizzle. Modify project to generate single binary that works on Xcode 2.4 through 3.0 (targeting 10.4u SDK on ppc, 10.5 SDK on x86_64).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cocoa/mogenerator/Xmod/Info.plist

    r249 r289  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
    33<plist version="1.0"> 
    44<dict> 
     
    2020        <string>????</string> 
    2121        <key>CFBundleVersion</key> 
    22         <string>1.6</string> 
     22        <string>1.8</string> 
    2323        <key>NSPrincipalClass</key> 
    2424        <string></string> 
    2525        <key>XCPluginHasUI</key> 
    2626        <false/> 
     27        <key>XCGCReady</key> 
     28        <string>YES</string> 
    2729</dict> 
    2830</plist> 
  • trunk/cocoa/mogenerator/Xmod/Xmod.m

    r264 r289  
    11#import "Xmod.h" 
    2 #import "MethodSwizzle.h" 
     2#import "JRSwizzle.h" 
    33 
    44@interface NSObject (xmod_saveModelToFile) 
     
    4848                coreDataPlugin = [NSBundle bundleWithPath:@"/Xcode2.5/Library/Xcode/Plug-ins/XDCoreDataModel.xdplugin"]; 
    4949        } else { 
    50                 //     Unknown territory, exit. 
     50                NSLog(@"Xmod: unknown Xcode version (%@), exiting.", xcodeVersion); 
    5151                return; 
    5252        } 
     
    5757        NSAssert(persistenceDocumentController, @"failed to load XDPersistenceDocumentController"); 
    5858         
    59         BOOL swizzled = MethodSwizzle(persistenceDocumentController, 
    60                                                                   @selector(saveModelToFile:), 
    61                                                                   @selector(xmod_saveModelToFile:)); 
    62         NSAssert(swizzled, @"failed to swizzle -[XDPersistenceDocumentController saveModelToFile:]"); 
     59        NSError *error = nil; 
     60        BOOL swizzled = [persistenceDocumentController jr_swizzleMethod:@selector(saveModelToFile:) 
     61                                                                                                                 withMethod:@selector(xmod_saveModelToFile:) 
     62                                                                                                                          error:&error]; 
     63        NSAssert1(swizzled, @"failed to swizzle -[XDPersistenceDocumentController saveModelToFile:]: %@", error); 
    6364         
    6465        //      Install the Autocustomize menu item. 
  • trunk/cocoa/mogenerator/Xmod/Xmod.xcodeproj/project.pbxproj

    r250 r289  
    2424                79D150FE0C8FBE01006706AF /* Xmod.applescript in AppleScript */ = {isa = PBXBuildFile; fileRef = 79D150FA0C8FBDE9006706AF /* Xmod.applescript */; settings = {ATTRIBUTES = (Debug, ); }; }; 
    2525                79DFC11F0B59B8C80056C80E /* Xmod.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DFC11E0B59B8C80056C80E /* Xmod.m */; }; 
    26                 79DFC1290B59BFD60056C80E /* MethodSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DFC1280B59BFD60056C80E /* MethodSwizzle.m */; }; 
     26                79E65E0D0D5631EA00B09941 /* JRSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E65E0B0D5631EA00B09941 /* JRSwizzle.m */; }; 
    2727                79F8A9C30C8FF06700082291 /* Autocustomize Entity Classes.applescript in AppleScript */ = {isa = PBXBuildFile; fileRef = 79F8A9C20C8FF06600082291 /* Autocustomize Entity Classes.applescript */; settings = {ATTRIBUTES = (Debug, ); }; }; 
    2828                8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 
     
    3939                79DFC11D0B59B8C80056C80E /* Xmod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xmod.h; sourceTree = "<group>"; }; 
    4040                79DFC11E0B59B8C80056C80E /* Xmod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Xmod.m; sourceTree = "<group>"; }; 
    41                 79DFC1270B59BFD60056C80E /* MethodSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MethodSwizzle.h; sourceTree = "<group>"; }; 
    42                 79DFC1280B59BFD60056C80E /* MethodSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MethodSwizzle.m; sourceTree = "<group>"; }; 
     41                79E65E0B0D5631EA00B09941 /* JRSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JRSwizzle.m; path = ../../JRSwizzle/JRSwizzle.m; sourceTree = "<group>"; }; 
     42                79E65E0C0D5631EA00B09941 /* JRSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JRSwizzle.h; path = ../../JRSwizzle/JRSwizzle.h; sourceTree = "<group>"; }; 
    4343                79F8A9C20C8FF06600082291 /* Autocustomize Entity Classes.applescript */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.applescript; path = "Autocustomize Entity Classes.applescript"; sourceTree = "<group>"; }; 
    4444                8D5B49B6048680CD000E48DA /* Xmod.pbplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Xmod.pbplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 
     
    9696                                79DFC11D0B59B8C80056C80E /* Xmod.h */, 
    9797                                79DFC11E0B59B8C80056C80E /* Xmod.m */, 
    98                                 79DFC1270B59BFD60056C80E /* MethodSwizzle.h */, 
    99                                 79DFC1280B59BFD60056C80E /* MethodSwizzle.m */, 
     98                                79E65E0C0D5631EA00B09941 /* JRSwizzle.h */, 
     99                                79E65E0B0D5631EA00B09941 /* JRSwizzle.m */, 
    100100                        ); 
    101101                        name = Classes; 
     
    164164                        isa = PBXProject; 
    165165                        buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "Xmod" */; 
     166                        compatibilityVersion = "Xcode 2.4"; 
    166167                        hasScannedForEncodings = 1; 
    167168                        mainGroup = 089C166AFE841209C02AAC07 /* Xmod */; 
    168169                        projectDirPath = ""; 
     170                        projectRoot = ""; 
    169171                        targets = ( 
    170172                                8D5B49AC048680CD000E48DA /* Xmod */, 
     
    190192                        files = ( 
    191193                                79DFC11F0B59B8C80056C80E /* Xmod.m in Sources */, 
    192                                 79DFC1290B59BFD60056C80E /* MethodSwizzle.m in Sources */, 
     194                                79E65E0D0D5631EA00B09941 /* JRSwizzle.m in Sources */, 
    193195                        ); 
    194196                        runOnlyForDeploymentPostprocessing = 0; 
     
    211213                        isa = XCBuildConfiguration; 
    212214                        buildSettings = { 
     215                                ARCHS = ( 
     216                                        ppc64, 
     217                                        i386, 
     218                                        ppc, 
     219                                        x86_64, 
     220                                ); 
    213221                                COPY_PHASE_STRIP = NO; 
    214222                                GCC_DYNAMIC_NO_PIC = NO; 
     
    230238                        buildSettings = { 
    231239                                ARCHS = ( 
     240                                        ppc64, 
     241                                        i386, 
    232242                                        ppc, 
    233                                         i386
     243                                        x86_64
    234244                                ); 
    235245                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 
     
    247257                        isa = XCBuildConfiguration; 
    248258                        buildSettings = { 
     259                                GCC_ENABLE_OBJC_GC = YES; 
    249260                                GCC_WARN_ABOUT_RETURN_TYPE = YES; 
    250261                                GCC_WARN_UNUSED_VARIABLE = YES; 
    251262                                PREBINDING = NO; 
    252                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
     263                                SDKROOT = "$(SDKROOT_$(CURRENT_ARCH))"; 
     264                                SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk; 
     265                                SDKROOT_ppc = /Developer/SDKs/MacOSX10.4u.sdk; 
     266                                SDKROOT_ppc64 = /Developer/SDKs/MacOSX10.5.sdk; 
     267                                SDKROOT_ppc7400 = /Developer/SDKs/MacOSX10.4u.sdk; 
     268                                SDKROOT_ppc970 = /Developer/SDKs/MacOSX10.4u.sdk; 
     269                                SDKROOT_x86_64 = /Developer/SDKs/MacOSX10.5.sdk; 
    253270                        }; 
    254271                        name = Debug; 
     
    257274                        isa = XCBuildConfiguration; 
    258275                        buildSettings = { 
     276                                GCC_ENABLE_OBJC_GC = YES; 
    259277                                GCC_WARN_ABOUT_RETURN_TYPE = YES; 
    260278                                GCC_WARN_UNUSED_VARIABLE = YES; 
    261279                                PREBINDING = NO; 
    262                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
     280                                SDKROOT = "$(SDKROOT_$(CURRENT_ARCH))"; 
     281                                SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk; 
     282                                SDKROOT_ppc = /Developer/SDKs/MacOSX10.4u.sdk; 
     283                                SDKROOT_ppc64 = /Developer/SDKs/MacOSX10.5.sdk; 
     284                                SDKROOT_ppc7400 = /Developer/SDKs/MacOSX10.4u.sdk; 
     285                                SDKROOT_ppc970 = /Developer/SDKs/MacOSX10.4u.sdk; 
     286                                SDKROOT_x86_64 = /Developer/SDKs/MacOSX10.5.sdk; 
    263287                        }; 
    264288                        name = Release; 
  • trunk/cocoa/mogenerator/Xmod/Xmod.xcodeproj/wolf.pbxuser

    r264 r289  
    22{ 
    33        089C1669FE841209C02AAC07 /* Project object */ = { 
     4                activeArchitecture = i386; 
    45                activeBuildConfigurationName = Release; 
    56                activeTarget = 8D5B49AC048680CD000E48DA /* Xmod */; 
     
    6061                                PBXFileTableDataSourceColumnWidthsKey = ( 
    6162                                        20, 
    62                                         200
    63                                         119
     63                                        366
     64                                        60
    6465                                        20, 
    6566                                        48, 
     
    7778                                ); 
    7879                        }; 
    79                         PBXPerProjectTemplateStateSaveDate = 217105925; 
    80                         PBXWorkspaceStateSaveDate = 217105925; 
    81                 }; 
    82                 perUserProjectItems = { 
    83                         794C2E520CF0CA070003EC27 /* PBXTextBookmark */ = 794C2E520CF0CA070003EC27 /* PBXTextBookmark */; 
    84                         794C2E670CF0CA330003EC27 /* PBXTextBookmark */ = 794C2E670CF0CA330003EC27 /* PBXTextBookmark */; 
    85                         794C2E680CF0CA330003EC27 /* PBXTextBookmark */ = 794C2E680CF0CA330003EC27 /* PBXTextBookmark */; 
    86                         79A7D2BE0CF0C56F00193A80 /* PBXTextBookmark */ = 79A7D2BE0CF0C56F00193A80 /* PBXTextBookmark */; 
     80                        PBXPerProjectTemplateStateSaveDate = 223754547; 
     81                        PBXWorkspaceStateSaveDate = 223754547; 
    8782                }; 
    8883                sourceControlManager = 79DFC1170B59B8870056C80E /* Source Control */; 
     
    9085                }; 
    9186        }; 
    92         794C2E520CF0CA070003EC27 /* PBXTextBookmark */ = { 
    93                 isa = PBXTextBookmark; 
    94                 fRef = 79DFC11D0B59B8C80056C80E /* Xmod.h */; 
    95                 name = "+ (id)sharedXmod;"; 
    96                 rLen = 17; 
    97                 rLoc = 103; 
    98                 rType = 0; 
    99                 vrLen = 265; 
    100                 vrLoc = 0; 
    101         }; 
    102         794C2E670CF0CA330003EC27 /* PBXTextBookmark */ = { 
    103                 isa = PBXTextBookmark; 
    104                 fRef = 79DFC11E0B59B8C80056C80E /* Xmod.m */; 
    105                 name = "Xmod.m: 1"; 
    106                 rLen = 0; 
    107                 rLoc = 0; 
    108                 rType = 0; 
    109                 vrLen = 1983; 
    110                 vrLoc = 0; 
    111         }; 
    112         794C2E680CF0CA330003EC27 /* PBXTextBookmark */ = { 
    113                 isa = PBXTextBookmark; 
    114                 fRef = 79DFC11D0B59B8C80056C80E /* Xmod.h */; 
    115                 name = "+ (id)sharedXmod;"; 
    116                 rLen = 17; 
    117                 rLoc = 103; 
    118                 rType = 0; 
    119                 vrLen = 265; 
    120                 vrLoc = 0; 
    121         }; 
    122         79A7D2BE0CF0C56F00193A80 /* PBXTextBookmark */ = { 
    123                 isa = PBXTextBookmark; 
    124                 fRef = 79DFC11E0B59B8C80056C80E /* Xmod.m */; 
    125                 name = "Xmod.m: 51"; 
    126                 rLen = 0; 
    127                 rLoc = 1767; 
    128                 rType = 0; 
    129                 vrLen = 2211; 
    130                 vrLoc = 1164; 
    131         }; 
    13287        79D150FA0C8FBDE9006706AF /* Xmod.applescript */ = { 
    13388                uiCtxt = { 
    134                         sepNavIntBoundsRect = "{{0, 0}, {1150, 1240}}"; 
     89                        sepNavIntBoundsRect = "{{0, 0}, {1150, 1221}}"; 
    13590                        sepNavSelRange = "{1862, 0}"; 
    136                         sepNavVisRect = "{{0, 0}, {1150, 1240}}"; 
    137                         sepNavWindowFrame = "{{70, 280}, {1189, 1298}}"; 
     91                        sepNavVisRect = "{{0, 0}, {1150, 854}}"; 
     92                        sepNavWindowFrame = "{{70, 70}, {1189, 958}}"; 
    13893                }; 
    13994        }; 
     
    160115        79DFC11E0B59B8C80056C80E /* Xmod.m */ = { 
    161116                uiCtxt = { 
    162                         sepNavIntBoundsRect = "{{0, 0}, {882, 1316}}"; 
     117                        sepNavIntBoundsRect = "{{0, 0}, {862, 1330}}"; 
    163118                        sepNavSelRange = "{0, 0}"; 
     119                        sepNavVisRange = "{0, 2028}"; 
    164120                        sepNavVisRect = "{{0, 0}, {882, 799}}"; 
    165121                        sepNavWindowFrame = "{{396, 112}, {921, 904}}"; 
    166122                }; 
    167123        }; 
    168         79DFC1280B59BFD60056C80E /* MethodSwizzle.m */ = { 
     124        79E65E0B0D5631EA00B09941 /* JRSwizzle.m */ = { 
    169125                uiCtxt = { 
    170                         sepNavIntBoundsRect = "{{0, 0}, {1186, 1722}}"; 
    171                         sepNavSelRange = "{3053, 23}"; 
    172                         sepNavVisRect = "{{0, 586}, {1186, 856}}"; 
    173                         sepNavWindowFrame = "{{38, 638}, {1225, 914}}"; 
     126                        sepNavIntBoundsRect = "{{0, 0}, {1104, 1610}}"; 
     127                        sepNavSelRange = "{316, 21}"; 
     128                        sepNavVisRange = "{0, 1602}"; 
     129                        sepNavWindowFrame = "{{15, 321}, {1163, 702}}"; 
     130                }; 
     131        }; 
     132        79E65E0C0D5631EA00B09941 /* JRSwizzle.h */ = { 
     133                uiCtxt = { 
     134                        sepNavIntBoundsRect = "{{0, 0}, {1104, 598}}"; 
     135                        sepNavSelRange = "{391, 79}"; 
     136                        sepNavVisRange = "{0, 574}"; 
     137                        sepNavWindowFrame = "{{38, 300}, {1163, 702}}"; 
    174138                }; 
    175139        }; 
     
    187151        8D5B49B7048680CD000E48DA /* Info.plist */ = { 
    188152                uiCtxt = { 
    189                         sepNavIntBoundsRect = "{{0, 0}, {723, 927}}"; 
    190                         sepNavSelRange = "{698, 0}"; 
     153                        sepNavIntBoundsRect = "{{0, 0}, {703, 854}}"; 
     154                        sepNavSelRange = "{826, 0}"; 
     155                        sepNavVisRange = "{0, 844}"; 
    191156                        sepNavVisRect = "{{0, 0}, {723, 927}}"; 
    192                         sepNavWindowFrame = "{{1302, 337}, {762, 985}}"; 
     157                        sepNavWindowFrame = "{{735, 70}, {762, 958}}"; 
    193158                }; 
    194159        }; 
  • trunk/cocoa/mogenerator/mogenerator.xcodeproj/wolf.mode1v3

    r283 r289  
    232232                        <array> 
    233233                                <dict> 
     234                                        <key>BecomeActive</key> 
     235                                        <true/> 
    234236                                        <key>ContentConfiguration</key> 
    235237                                        <dict> 
     
    378380                        <key>TableOfContents</key> 
    379381                        <array> 
    380                                 <string>79AC5C620D3FEA19008AE93A</string> 
     382                                <string>793A85750D53DDA5004463D4</string> 
    381383                                <string>1CE0B1FE06471DED0097A5F4</string> 
    382                                 <string>79AC5C630D3FEA19008AE93A</string> 
     384                                <string>793A85760D53DDA5004463D4</string> 
    383385                                <string>1CE0B20306471E060097A5F4</string> 
    384386                                <string>1CE0B20506471E060097A5F4</string> 
     
    514516        <key>WindowOrderList</key> 
    515517        <array> 
    516                 <string>79AC5C650D3FEA19008AE93A</string> 
    517                 <string>79AC5C670D3FEA19008AE93A</string> 
    518518                <string>/Users/wolf/code/trac/cocoa/mogenerator/mogenerator.xcodeproj</string> 
    519519        </array> 
  • trunk/cocoa/mogenerator/mogenerator.xcodeproj/wolf.pbxuser

    r283 r289  
    7474                                ); 
    7575                        }; 
    76                         PBXPerProjectTemplateStateSaveDate = 222292400
    77                         PBXWorkspaceStateSaveDate = 222292400
     76                        PBXPerProjectTemplateStateSaveDate = 223599997
     77                        PBXWorkspaceStateSaveDate = 223599997
    7878                }; 
    7979                sourceControlManager = 79D2BF0B0ACFAE0700F3F141 /* Source Control */;