Agile software development using Kanban & Scrum. We code Flex & Ruby on Rails in Auckland, New Zealand.

  • Flex Third Party Libraries in Multiple Projects

    I don’t know the answer to this. I need to though. This is what I need to do.

    An existing project structure.

    We start with:

    • LibProjA is a Flex Library Project
    • AppA is a Flex Application Project [LibProjA]

    [ dependencies in square brackets]

    In reality we have a lot more LibProjs and a few Apps.

    Along comes a great library that we must have.

    I’ll use a real example: as3corelib.

    We use it all over the place, so we create a library project and pop the source code in there (behind the scenes we use svn vendor branches)

    Now we have:

    • as3corelib is a 3rd Party Flex Library Project
    • LibProjA is a Flex Library Project [as3corelib]
    • AppA is a Flex Application Project [LibProjA,as3corelib]

    Note: at this point, the library projects also have Antennae configurations for our CI server.

    Along comes another great library that we must have

    Another real example. Googles Map Api. For Flex it’s a .swc called “map_flex_1_16.swc”.

    There’s no way to create a project entry for this library. So the big question:

    Where Do We Put It?

    The dependency tree needs to look like this:

    • GoogleMapAPI is a 3rd party SWC
    • as3corelib is a 3rd party Flex Library Project
    • LibProjA is a Flex Library Project [as3corelib,GoogleMapAPI]
    • AppA is a Flex Application Project [LibProjA,as3corelib,GoogleMapAPI]

    Include it in each lib dir?

    It would work but:

    • It’s stupid
    • It will require a lot of configuration for our CI server (especially when the API is updated)
    • It’s hard work to update all the projects with a new API release
    • It’s possible to fail to update one project and you’d get some strange behaviour.

    Include it in an extra workspace directory

    It would work but:

    • It’s stupid
    • It’s not idiomatic from an Antennae point of view
    • Flex projects refuse to get relative paths to workspace folders right for ‘include SWC’

    The last one’s a biggy. I’m not going to force dev’s to KNOW they need to checkout the workspace to a specific path (or to even use their default drive) to make this work. Absolute paths in projects is just plain dumb.

    What I was looking for

    Another Flex Builder project reference type :)