Feeling a little bit lost

Greetings,

I'm trying to migrate from Adobe's flash builder to IDEA.  I have a fairly substantial flex project that I would like to develop using IntelliJ IDEA.  Here's my source code layout:-


.
|-- all_projects
|   |-- project
|   |   |-- main_app
|   |   |   |-- libs             // contains swcs as3core, puremvc, spring etc
|   |   |   |-- src
|   |   |   |   |-- assets
|   |   |   |   |   |-- embedded
|   |   |   |   |   |-- locale
|   |   |   |   |   |   `-- en_GB   // locale properties for the main app
|   |   |   |   |   |-- raw
|   |   |   |   |   `-- wrapper
|   |   |   |   `-- puremvc
|   |   |   `-- test              // FlexUnit unit tests in dirs below here
|   |   |
|   |   `-- lib                   // contains source and swcs used by main_app
|   |       |-- 3rdParty
|   |       |-- build
|   |       |-- locale
|   |       |   `-- en_GB
|   |       |-- src               // source for libs used in main_app
|   |       |   `-- com
|   |       |
|   |       |-- swc               // all swcs here and within copied to main_app/libs
|   |       |   |-- 3rdParty      // all swcs we don't compile ourselves ()
|   |       |


How do my lib sources, 3rd party libs, locale sources, main app etc map to IDEA concepts such as global library, module library etc?

How do I set up my dependancies?

Should I use my own flex-config.xml which I use when I build the project with ant??

I would like to follow the nice, wide, well worn path with IDEA and it flex support.  I just want to do what works and not push it.

In short, what is the "best pratice" IDEA setup for a project like mine??

Thanks,
Jeff











4 comments
Comment actions Permalink

This is not really an answer to your original question, but IDEA can actually import a project configuration from Flash/Flex Builder directly.
Have you tried that option?

0
Comment actions Permalink

I suppose that you have already heard about Eclipse vs IDEA terminology, i.e. Eclipse's workspace becomes IDEA's project and Eclipse's projects become IDEA's modules.

Single-entry module library, module library, project library and global library - are similar things. Usually you use global library if you have several IDEA projects using it (just to share once configured library), you use project library if it is used by several modules of one project, you use single entry library when you have swc only, but no library sources or ASDoc.

Own lib, i.e. where you edit sources and which you compile yourselves should be configured as a separate module.

Dependencies are set in the same way in in maven or in any other IDE. Each module depends on SDK, some 3rd party compiled libs and on some other own modules.

Note that in IDEA there are two ways to manage Flex-related modules. One way is to use Flex modules and the other way is to use Java modules with Flex facets. In first case you select Flex SDK at Dependencies tap (File | Project Structure), in the second case you choose Java SDK at Dependencies tab and Flex SDK at Flex facet configuration page. Other settings are the same.

Flex compilation is fully customizable. You can use IDE builder and set compiler options at Flex Compiler Settings tab (or Flex facet page). You can use Ant or Maven build at respective tool windows. What configuration files you use for compilation is up to you.

Locale folders that contain resource bundles should be marked as source folders. Tests are usually stored in test source folders. All are configured at Project Structure | Sources tab.

May be I haven't answered all your questions, so don't hesitate to ask again. Also look for information in webhelp, blog, forums and issue tracker
http://www.jetbrains.com/idea/webhelp/index.jsp
http://blogs.jetbrains.com/idea/tag/flex/
http://jetbrains.net/tracker/welcome

0
Comment actions Permalink

First thanks Alexander and Taras for your prompt replies.


@Taras, I deleted my FlashBuilder project info prematurely.  A foolish thing
to do, I know.



@Alexander, I followed the information you posted and what follows is what I
did.  It seems to work.  :-)



OK, so now I feel much better.  I have managed to setup my app and associated
paraphernalia in IDEA.  I can compile the app now, and run it from IDEA.



At the bottom of this post, for reference, is my project directory structure.
It is that same as in my original post.



Here's what I did:


(1) Created a new IDEA project from scratch.  The dir ./all_projects/project
    contains all the components of my project, such as the main app, 3rd party
    swcs and my own library sources and swcs.  



(2) During creation of the project I added 'main_app' as a Flex module.
    main_app's 'src' dir already exists so I unchecked the 'create src folder'
    box.
    
    (2.1) Setup of main_app's module sources
    
        (a) In main_app's module settings, on the 'Sources' tab, I set
        ./all_projects/project/main_app/src as a 'source folder'.  Ditto for
        ./all_projects/project/main_app/src/assets/locale/en_GB



        (b) I set ./all_projects/project/main_app/test as a 'Test sources' dir


(3) I created a global library called 'thirdParty'.  I attached a jar
    directory, namely ./all_projects/lib/swc/3rdParty



(4) Back in main_app module settings, on the 'Dependencies' tab I hit the
    Add... button and selected 'Project library'.  I called the new library
    'lib' and added ./all_projects/project/lib/src as its 'sources', and
    ./all_projects/project/lib/swc as its jar directory



    I added 'thirdParty' as a dependency of main_app also.


(5) main_app's flex compiler settings


    * Checked 'Use default SDK compiler configuration file'
    * On the 'Advanced' tab set a desired flash player version and locale
      (en_GB).
    * Set the 'Main class:' to main_app.



That's it more or less.  So, in summary


./all_projects/project/lib/{src,swc} configured as a "Project library" and a
dependency of main_app.



./all_prjects/project/lib/swc/3rdParty configured as a "Global library" and a
dependeny of main_app.



./all_projects/project/main_app configured as a flex module within the
overarching IDEA project.  'test' dir configured as 'Test sources'. 'src' dir
and 'src/assets/locale/en_GB' configured as 'Sources'.




.
|-- all_projects
|   |-- project              
|   |   |-- main_app
|   |   |   |-- libs             // contains swcs as3core, puremvc, spring etc
|   |   |   |-- src
|   |   |   |   |-- assets
|   |   |   |   |   |-- embedded
|   |   |   |   |   |-- locale
|   |   |   |   |   |   `-- en_GB   // locale properties for the main app
|   |   |   |   |   |-- raw
|   |   |   |   |   `-- wrapper
|   |   |   |   `-- puremvc
|   |   |   `-- test              // FlexUnit unit tests in dirs below here
|   |   |
|   |   `-- lib                   // contains source and swcs used by main_app
|   |       |-- 3rdParty
|   |       |-- build
|   |       |-- locale
|   |       |   `-- en_GB
|   |       |-- src               // source for libs used in main_app
|   |       |   `-- com
|   |       |
|   |       |-- swc               // all swcs here and within copied to main_app/libs
|   |       |   |-- 3rdParty      // all swcs we don't compile ourselves ()
|   |       |




0
Comment actions Permalink

Glad to hear that you've overcame first difficulties and hope you'll love IDEA's great coding support. Feedback is always welcome at our forums and issue tracker.

0

Please sign in to leave a comment.