How to configure Intellij 8 for Flex third-party libraries

Hi,
I'm using Intellij 8.0 to develop Flex, and it rocks! I've gotten the Flex compiler/debugger to work from within intellij.

Now for the problem: I use a third-party library (cairngorm.swc), and while editting Intellij does not recognize any of the Caingorm classes/imports in my source code, thus flagging them with 'yellow/red' warnings. Note that it compiles just fine, as I've manually registred the cairngorm library in the flex-config.xml file that is used for compilation.

Question: How do I configure Intellij to recognize third-party flex libraries (swc) while editing?

Thanks,
Brad

0
11 comments
Avatar
Permanently deleted user

Not sure but I think you need to add the .swc as a dependency to your Flex module. This should be the same as adding a .jar library dependency for java modules...

...go to Project Structure...
...select your Flex module...
...select the Dependencies tab...
...click Add...
...create a new dependency by navigating to the .swc file...

Cheers

Paul

0
Avatar
Permanently deleted user
  • Removed double post


Edited by: Paul Brooks on Nov 20, 2008 4:11 PM

0
Avatar
Permanently deleted user

You need to add the library in Module | Dependencies settings

brad miller wrote:

Hi,
I'm using Intellij 8.0 to develop Flex, and it rocks! I've gotten the Flex compiler/debugger to work from within intellij.

Now for the problem: I use a third-party library (cairngorm.swc), and while editting Intellij does not recognize any of the Caingorm classes/imports in my source code, thus flagging them with 'yellow/red' warnings. Note that it compiles just fine, as I've manually registred the cairngorm library in the flex-config.xml file that is used for compilation.

Question: How do I configure Intellij to recognize third-party flex libraries (swc) while editing?

Thanks,
Brad



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Thanks to all - adding it as an explicit dependency worked great!

One small suggestion - I'm using the maven 'info.rvin.mojo.flex-compiler-mojo' plugin to compile maven. As such, the maven pom.xml explicitly has the swc files in the maven dependencies section, yet they were NOT picked up by the intellij maven support (the jar files for the java modules are picked up correctly). It would be nice if intellij maven support picks up the maven-defined '.swc' dependencies for intellij modules that have a Flex facet.

Thanks again!

- Brad

0
Avatar
Permanently deleted user

The IDE perfectly resolves libraries when I add them as Module Dependency or Project/Global Library but I have to add them to the compiler settings manually. Is there a way to send them to mxmlc automatically?

0

Are you using IDEA 8.1.4?
I couldn't reproduce the problem. If you are not using custom compiler configuration file - IDEA creates <module name>_temp_flex_config.xml file and places required dependencies there:
<library-path append="true">
      <path-element>path/to/required/library.swc</path-element>
</library-path>

If you are using custom compiler configuration file - then it's your responsibility to add required dependencies there.

0
Avatar
Permanently deleted user

Oh, I didn't realize this conversation was about version 8. I am using Maia 94.192.

I am not using a custom flex config. Dependencies are not being added to the [project]_temp_flex_config.xml.

0

Are swc files added as Classes to Module/Project/Global libraries?
Please attach screenshots of library setup, Flex module dependencies setup and Flex Compiler Settings configuration,
and content of generated *_temp_flex_config.xml file

0
Avatar
Permanently deleted user

I am not using SWCs but source folders.



Attachment(s):
Picture 2.png
0

Third-party libraries (that's the title of the question) are distributed as SWCs, sources play only additional role and may be added for convenience.
If you want to compile against sources - include these sources in your project. Or create a second module, keep required sources there, configure to compile them to SWC library and make your application module depend on library module. In this case IDEA will first compile SWC and then compile application SWF against this SWC.

0
Avatar
Permanently deleted user

Alright, that makes sense. Thanks for your help.

What I did now is adding the source folder as "Source Folder" in the sources-tab - that way mxmlc does not complain. But I might as well use the compiled SWCs.

0

Please sign in to leave a comment.