Flex SDK Sources and Flexmojos Projects

If you are working with Flexmojos Maven projects in IntelliJ IDEA 9, and have imported Flexmojos project as described in this post, and are planning to debug your application and browse through Flex SDK sources, this post is a must-read for you. Inside you will find details on how to configure IntelliJ IDEA so that it properly recognizes SDK sources and their ASdocs.

When IntelliJ IDEA imports a Maven project, it creates a bunch of module libraries that match pom dependencies. For each library it also configures sources and documentation, assuming that they are located in *-source.jar and *-asdoc.zip respectively. Unless you have these files in your local Maven repository, you’ll see them marked with red (see Projects Structure dialog (Ctrl+Alt+Shift+S), Libraries section).

If there is a remote Maven repository containing these files, you can download them via Maven tool window.

For example, standard Flexmojos repository contains *-sources.jar files for the latest Flex SDK distributions (3.5.0.12683 and 4.0.0.12575): http://repository.sonatype.org/content/groups/flexgroup/, which is enough both for debugging code and viewing documentation, because IntelliJ IDEA automatically picks up ASdoc from sources.

If remote repository does not contain Flex SDK sources, you can set them up them manually, but consider that you’ll have to do a lot of routine work yourself — SDK sources should be individually configured for each module library. You may download a standard Flex SDK installation and keep it somewhere on your computer, and then add source folders to Maven libraries according to the following table.

Flex Library Source Folder
com.adobe.flex.framework:framework:swc [Flex SDK]/frameworks/projects/framework/src/
com.adobe.flex.framework:flex:swc [Flex SDK]/frameworks/projects/flex/src/
com.adobe.flex.framework:rpc:swc [Flex SDK]/frameworks/projects/rpc/src/
com.adobe.flex.framework:utilities [Flex SDK]/frameworks/projects/utilities/src/
com.adobe.flex.framework:osmf:swc [Flex SDK]/frameworks/projects/osmf/src/
com.adobe.flex.framework:spark:swc [Flex SDK]/frameworks/projects/spark/src/
com.adobe.flex.framework:sparkskins:swc [Flex SDK]/frameworks/projects/sparkskins/src/
com.adobe.flex.framework:textLayout:swc [Flex SDK]/frameworks/projects/textLayout/src/

Note that AIR-related libraries have similar source structure and locations.

This entry was posted in Tips & Tricks and tagged , , , . Bookmark the permalink.

2 Responses to Flex SDK Sources and Flexmojos Projects

  1. Maurice says:

    Hi,
    I have created a Flex module using SDK 4.1 from scratch, but I can’t debug inside
    the SDK classes.
    I created an empty application, overriden updateDisplayList() and set a breakpoint, then debugged the application. the debugged stops in my overridden method, but
    The stack in the debugger view says “file name is not available” for all SDK class level.

    However, I can access the source of SDK classes in the editor, when typing Ctrl+N / UIComponent for example.
    Also, I did the same with SDK 3.5, and there I can debug SDK classes.
    That’s very strange.
    Can you help me.

    FYI,I am using IDEA 10.5.2 and SDK 4.1.0.

  2. Alexander Doroshko says:

    @Maurice see reason and workaround here http://youtrack.jetbrains.net/issue/AS-220

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">