A Groovy lib for Xcode pbxproj files

See github

// snippet from the test (spock) spec:

    def "object types and keys are ok"( String key, String klass ) {
        expect:
        proj.objects[ key ].class.simpleName == klass

        where:
        key                        | klass
        'F98F991811A4A86400D21E1F' | 'PBXBuildFile'
        '0597689803D6472D00C9149F' | 'PBXFileReference'
        '059768A803D6494200C9149F' | 'PBXFileReference'
        '05CA34F70433CFDF00C9149F' | 'PBXFileReference'
        'F98F991611A4A85000D21E1F' | 'PBXFileReference'
        'F98F991411A4A85000D21E1F' | 'PBXFrameworksBuildPhase'
        '0597688C03D6465000C9149F' | 'PBXGroup'
        '0597689703D646C100C9149F' | 'PBXGroup'
        'F98F991511A4A85000D21E1F' | 'PBXNativeTarget'
        '0597689003D6465000C9149F' | 'PBXProject'
        'F98F991311A4A85000D21E1F' | 'PBXSourcesBuildPhase'
        '05B1F3D8089068690080B6E2' | 'XCBuildConfiguration'
        'F98F991711A4A85100D21E1F' | 'XCBuildConfiguration'
        '05B1F3D7089068690080B6E2' | 'XCConfigurationList'
        'F98F991911A4A8B900D21E1F' | 'XCConfigurationList'
    }

    def "file references are ok"( def key, def path ) {
        expect:
        proj.objects[ key ].path == path

        where:
        key                        | path
        "0597689803D6472D00C9149F" | "keymgr.c"
        "059768A803D6494200C9149F" | "keymgr.h"
        "05CA34F70433CFDF00C9149F" | "testcases/basic-eh-app.cc"
        "F98F991611A4A85000D21E1F" | "libkeymgr.dylib"
    }

    def "verify product group -- PBXRef links"( def index, def path ) {
        given:
        def children = proj.objects[ "0597688C03D6465000C9149F" ].children

        expect:
        children[ index ].path == path

        where:
        index | path
        1     | "keymgr.c"
        2     | "keymgr.h"
        3     | "testcases/basic-eh-app.cc"
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s