External documention not working with ActionScript source files directory. Plz help.

== SENTIMENT ==
I'm fairly new to IntelliJ IDEA. I feel lost. I've spent hours trying to get this working. I've mostly been trying different combinations of linking my module swc dependencies to documentation in different folder locations.... it's been kind of a blur, I guess.

== PROBLEM ==
My goal is to have these 2 conveniences (which seem currently mutually exclusive) available to me when working on ActionScript/Flex projects:
   A) When I press F4 over a class, I can view its implementation.
   B) When I press Shift+F1 over a class, I can view its complete external documentation (I'm using HTML ASDocs because that's all I know to work with IntelliJ).

=== Scenario 1: 'A' works, 'B' doesn't ===
'A' works when I'm compiling with AS files in a directory marked as source root.
'B' doesn't work with AS files because it seems the only way to specify external documentation is via the swc.

=== Scenario 2: 'B' works, 'A' doesn't ===
'B' works when I'm compiling with SWCs that have been added with the "Configure Library" dialog (shown below).
'A' doesn't work now because SWC source code is compressed in an unviewable form.

==== SIDE NOTE ====
I just noticed a difference  between a project structure created by selecting "Create module from  scratch" versus "Import module from external model"...
createproject.PNG
There seems to be a discrepancy between the "Configure Library" UI...
Project was created "from scratch". Its Flex module icon is outside of any folder:
new-project-from-scratch.PNG
Also, only SWC files can be added:
new-project-from-scratch_depend.PNG
Project was created "from external model"-- an actual module folder is created for the Flex icon, and classes can be added to the library:
new-project-over-existing-flexbuilder.PNG<-- (Please excuse the fiddling I was doing with the module directories here.)

== REMEDIES ==
- Maybe having multiple modules would solve the problem?
- I've read about potential solutions involving Ant tasks (one of them is shown below) , but these have escaped my grasp.

"There are a few other ways to exclude files from mxmlc. This article shows one method using the compiler options -link-report and -load-externs and it seems pretty clever. So if you are comfortable hand-crafting your own xml exclude file then -load-externs could work for you too.

"The other compiler options that allow you to omit the symbols include: -externs and -compiler.external-library-path.

I'm okay with keeping two versions of each library (SWC & AS files)  in my source path. Ideally, I could just use AS files, though.

10 comments
Comment actions Permalink

So, I've discovered that when I create a project "from external model", the module created is actually a Java module with Flex facet. I'm trying to figure out how this even makes sense, and what the implications are of having that versus a Flex module. Hmmm

0
Comment actions Permalink

The difference of Flex module vs Java module with Flex facet(s) is that  Flex module produces one SWF (or SWC) whereas Java module can contain several Flex facets, thus producing several SWFs/SWCs. Indeed when importing Flash builder project IDEA generates Java module with facets.
Note that you should never edit AUTOGENERATED library! It is made equal to Flex SDK in case of Java module because Java module has Java SK in SDKs combo a Dependencies tab, so we need to configure mFlex SK somehow and it is done at Flex facet page. You should not edit Flex SDK as well. In any case: Flex or Java module you configure Flex dependencies as separate librariesof Flex type and you have the same dialog with 'Add SWCs' button etc.

I'm not sure that I got all your problems with configuration. Let me explain hoe ependencies work, I think you'll get what you need.
1. If you keep source files in source root, i..e these are your own ediatable sources - then it is impossible to attach HTML Asdoc to them because it has no sense. Any change in source files would make ASDoc not in sync with sources - that's not what we want. But IDEA compiles ASDoc view on the fly for your sources so action like Ctrl+Q (quick doc view)  will show you live and current documentation for your source files.
2. If you configure SWC as 3rd party library - then you need to create a library at Dependencies tab, add SWCs using 'Add SWCs' button, also you can add sources of this 3rd party SWC using 'Add SWC sources' button. And also you can add ASDoc for this 3rd party library using 'Add Documentation' button. Both sources and docs can be in zip/jar or unpacked. Once configured you'll get desired behavior for library classes: you'll be able to jump to source and to open html docs in browser.

0
Comment actions Permalink

I got the results I wanted by using someone else's project made in other IDE, importing the project "from external model". But, the module being used is a Java module with a Flex facet.

And, in the "Project Structure" window, I don't even use the Java SDK.
selected-flex-sdk-for-java.PNG

When I change the module SDK inside the "Dependencies" tab, I get a warning saying it seems wrong.
selected-different-sdk-warning.PNG

So, I'm a little perplexed...

  • Does this means I should always be making Java projects now when I want to work on a Flex project?
  • Why would IntelliJ create a Java module for my Flex project, and then show me a warning about how the Flex SDK seems wrong?
0
Comment actions Permalink

Projects in Flash Builder can contain more than one application class - that's why Java module with Flex facets  is created. Flex SDK in this case is configured at facet page (module subnode).
When creatin new module from scratch - it is up to you whether to create Flex module or Java moukle with Flex facets.

By the way we ourselves find current Flrx project setup not enough convenient, so we have completely redesigned it. New project setup is availabel in early access version of a new product with code name Astella
When we will be close to Astella release and will be sure that new settings provide not less functionality than old ones we'll integrate the same project setuo inti IDEA.

0
Comment actions Permalink

This is making more sense now, even though using a "Java" project to work on Flash sounds dumb :-/

In order to get external documentation working for my libraries' ActionScript source files, I need to create "Java" libraries because "Flex" libraries will only attach SWCs. Since my "Java" libraries contain ActionScript... once again, this sounds wrong, but it works. Is this wrong? Or does it sound like a logical way for me to organize my module dependencies?

0
Comment actions Permalink

Sorry, I haven't got why you think you need to use Java libraries. What button do you miss for library of actionScript/Flex type?

0
Comment actions Permalink

Ah-HA! I finally figured it out!!! I never realized the meaning of the "Add SWC sources" button (shown below), which allows you to specify SOURCE FILES for your SWC. This now enables me to see the source code for my libraries' functions! And I can see external documentation! And I can compile with pre-compiled SWCs! Hooray :)

Capture.PNG

0
Comment actions Permalink

Yep, these are IDEA project setup fundamentals. Glad to be of help.

0
Comment actions Permalink

This is just what I needed to know. I want to compile multiple SWFs from a single module, so I'll now need to change my existing module from being a Flex Module to a Java Module with multiple Flex facets. How do I do this? I don't see any options in the Module Settings.

0
Comment actions Permalink

There's no action to change module type. So you'll need to delete one module and create another one.
Also you may try our new product with code name Astella which is in early access stage now. Flex project configuration is completely different there and is more convenient than in IDEA. See: http://blogs.jetbrains.com/idea/2011/10/jetbrains-introduces-astella-a-new-ide-for-actionscript-flex-air-and-html5-development/

0

Please sign in to leave a comment.